From 040140b3884a06d8c88e495261cb0ca7ff0d4ee6 Mon Sep 17 00:00:00 2001 From: Benjamin Coe Date: Tue, 31 Mar 2020 13:48:44 -0700 Subject: [PATCH 001/152] chore: add initial files for launch --- .../google-cloud-memcache/CODE_OF_CONDUCT.md | 43 ++++ .../google-cloud-memcache/CONTRIBUTING.md | 65 ++++++ packages/google-cloud-memcache/LICENSE | 202 ++++++++++++++++++ packages/google-cloud-memcache/README.md | 122 +++++++++++ packages/google-cloud-memcache/synth.py | 48 +++++ 5 files changed, 480 insertions(+) create mode 100644 packages/google-cloud-memcache/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-memcache/CONTRIBUTING.md create mode 100644 packages/google-cloud-memcache/LICENSE create mode 100644 packages/google-cloud-memcache/README.md create mode 100644 packages/google-cloud-memcache/synth.py diff --git a/packages/google-cloud-memcache/CODE_OF_CONDUCT.md b/packages/google-cloud-memcache/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..46b2a08ea6d --- /dev/null +++ b/packages/google-cloud-memcache/CODE_OF_CONDUCT.md @@ -0,0 +1,43 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, +and in the interest of fostering an open and welcoming community, +we pledge to respect all people who contribute through reporting issues, +posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project +a harassment-free experience for everyone, +regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, +such as physical or electronic +addresses, without explicit permission +* Other unethical or unprofessional conduct. + +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. +By adopting this Code of Conduct, +project maintainers commit themselves to fairly and consistently +applying these principles to every aspect of managing this project. +Project maintainers who do not follow or enforce the Code of Conduct +may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior +may be reported by opening an issue +or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, +available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/packages/google-cloud-memcache/CONTRIBUTING.md b/packages/google-cloud-memcache/CONTRIBUTING.md new file mode 100644 index 00000000000..f6c4cf010e3 --- /dev/null +++ b/packages/google-cloud-memcache/CONTRIBUTING.md @@ -0,0 +1,65 @@ +# 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. + +## 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. + gcloud auth application-default login + npm run samples-test + + # Run all system tests. + gcloud auth application-default login + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup diff --git a/packages/google-cloud-memcache/LICENSE b/packages/google-cloud-memcache/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-memcache/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-memcache/README.md b/packages/google-cloud-memcache/README.md new file mode 100644 index 00000000000..0de02a32ff0 --- /dev/null +++ b/packages/google-cloud-memcache/README.md @@ -0,0 +1,122 @@ +[//]: # "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 + +# [Memorystore for Memcached: Node.js Client](https://github.com/googleapis/nodejs-memcache) + +[![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/memcache.svg)](https://www.npmjs.org/package/@google-cloud/memcache) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-memcache/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-memcache) + + + + +Memcache client for Node.js + + +* [Memorystore for Memcached Node.js Client API Reference][client-docs] +* [Memorystore for Memcached Documentation][product-docs] +* [github.com/googleapis/nodejs-memcache](https://github.com/googleapis/nodejs-memcache) + +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 Memorystore for Memcached 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/memcache +``` + + + + + +The [Memorystore for Memcached 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 targetting some end-of-life versions of Node.js are available, and +can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. + +_Legacy Node.js versions are supported as a best effort:_ + +* Legacy versions will not be tested in continuous integration. +* Some security patches may not be able to be backported. +* Dependencies will not be kept up-to-date, and features will not be backported. + +#### Legacy tags available + +* `legacy-8`: install client libraries from this dist-tag for versions + compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be in **beta**. This means it is expected to be +mostly stable while we work toward a general availability release; however, +complete stability is not guaranteed. We will address issues and requests +against beta libraries with a high priority. + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-memcache/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-memcache/blob/master/LICENSE) + +[client-docs]: https://googleapis.dev/nodejs/memcache/latest/index.html +[product-docs]: https://cloud.google.com/memorystore/docs/memcached +[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=memcache.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-memcache/synth.py b/packages/google-cloud-memcache/synth.py new file mode 100644 index 00000000000..ea45075171e --- /dev/null +++ b/packages/google-cloud-memcache/synth.py @@ -0,0 +1,48 @@ +# 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. +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +import synthtool.gcp as gcp +import subprocess +import logging + +logging.basicConfig(level=logging.DEBUG) + +# run the gapic generator +gapic = gcp.GAPICMicrogenerator() +versions = ['v1beta2'] +name = 'memcache' +for version in versions: + library = gapic.typescript_library( + name, + generator_args={ + "grpc-service-config": f"google/cloud/{name}/{version}/{name}_grpc_service_config.json", + 'package-name': '@google-cloud/memcache', + }, + extra_proto_files=['google/cloud/common_resources.proto'], + proto_path=f'/google/cloud/{name}/{version}', + version=version) +s.copy(library, excludes=['README.md']) + +# Copy common templates +common_templates = gcp.CommonTemplates() +templates = common_templates.node_library(source_location='build/src') +s.copy(templates, excludes=[]) + +# Node.js specific cleanup +subprocess.run(['npm', 'install']) +subprocess.run(['npm', 'run', 'fix']) +subprocess.run(['npx', 'compileProtos', 'src']) + From 9a4efa3fe10784522c1dd18848cd7cf7fb14e0fe Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 3 Apr 2020 10:57:52 -0700 Subject: [PATCH 002/152] feat!: initial generation of library (#3) --- packages/google-cloud-memcache/.eslintignore | 5 + packages/google-cloud-memcache/.eslintrc.json | 3 + packages/google-cloud-memcache/.gitignore | 14 + packages/google-cloud-memcache/.jsdoc.js | 55 + packages/google-cloud-memcache/.mocharc.js | 28 + packages/google-cloud-memcache/.mocharc.json | 5 + packages/google-cloud-memcache/.nycrc | 24 + .../google-cloud-memcache/.prettierignore | 3 + packages/google-cloud-memcache/.prettierrc.js | 17 + .../google-cloud-memcache/.repo-metadata.json | 13 + packages/google-cloud-memcache/README.md | 27 +- packages/google-cloud-memcache/codecov.yaml | 4 + .../linkinator.config.json | 12 + packages/google-cloud-memcache/package.json | 53 + .../google/cloud/common_resources.proto | 52 + .../memcache/v1beta2/cloud_memcache.proto | 503 + .../google-cloud-memcache/protos/protos.d.ts | 7117 ++++++ .../google-cloud-memcache/protos/protos.js | 18131 ++++++++++++++++ .../google-cloud-memcache/protos/protos.json | 1867 ++ .../google-cloud-memcache/samples/README.md | 50 + .../samples/package.json | 23 + .../samples/quickstart.js | 31 + .../samples/test/quickstart.js | 38 + packages/google-cloud-memcache/src/index.ts | 24 + .../src/v1beta2/cloud_memcache_client.ts | 1355 ++ .../v1beta2/cloud_memcache_client_config.json | 61 + .../v1beta2/cloud_memcache_proto_list.json | 3 + .../src/v1beta2/index.ts | 19 + packages/google-cloud-memcache/synth.metadata | 24 + packages/google-cloud-memcache/synth.py | 2 +- .../system-test/fixtures/sample/src/index.js | 26 + .../system-test/fixtures/sample/src/index.ts | 25 + .../system-test/install.ts | 51 + .../test/gapic_cloud_memcache_v1beta2.ts | 1576 ++ packages/google-cloud-memcache/tsconfig.json | 19 + .../google-cloud-memcache/webpack.config.js | 64 + 36 files changed, 31321 insertions(+), 3 deletions(-) create mode 100644 packages/google-cloud-memcache/.eslintignore create mode 100644 packages/google-cloud-memcache/.eslintrc.json create mode 100644 packages/google-cloud-memcache/.gitignore create mode 100644 packages/google-cloud-memcache/.jsdoc.js create mode 100644 packages/google-cloud-memcache/.mocharc.js create mode 100644 packages/google-cloud-memcache/.mocharc.json create mode 100644 packages/google-cloud-memcache/.nycrc create mode 100644 packages/google-cloud-memcache/.prettierignore create mode 100644 packages/google-cloud-memcache/.prettierrc.js create mode 100644 packages/google-cloud-memcache/.repo-metadata.json create mode 100644 packages/google-cloud-memcache/codecov.yaml create mode 100644 packages/google-cloud-memcache/linkinator.config.json create mode 100644 packages/google-cloud-memcache/package.json create mode 100644 packages/google-cloud-memcache/protos/google/cloud/common_resources.proto create mode 100644 packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto create mode 100644 packages/google-cloud-memcache/protos/protos.d.ts create mode 100644 packages/google-cloud-memcache/protos/protos.js create mode 100644 packages/google-cloud-memcache/protos/protos.json create mode 100644 packages/google-cloud-memcache/samples/README.md create mode 100644 packages/google-cloud-memcache/samples/package.json create mode 100644 packages/google-cloud-memcache/samples/quickstart.js create mode 100644 packages/google-cloud-memcache/samples/test/quickstart.js create mode 100644 packages/google-cloud-memcache/src/index.ts create mode 100644 packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts create mode 100644 packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client_config.json create mode 100644 packages/google-cloud-memcache/src/v1beta2/cloud_memcache_proto_list.json create mode 100644 packages/google-cloud-memcache/src/v1beta2/index.ts create mode 100644 packages/google-cloud-memcache/synth.metadata create mode 100644 packages/google-cloud-memcache/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-cloud-memcache/system-test/install.ts create mode 100644 packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts create mode 100644 packages/google-cloud-memcache/tsconfig.json create mode 100644 packages/google-cloud-memcache/webpack.config.js diff --git a/packages/google-cloud-memcache/.eslintignore b/packages/google-cloud-memcache/.eslintignore new file mode 100644 index 00000000000..09b31fe735a --- /dev/null +++ b/packages/google-cloud-memcache/.eslintignore @@ -0,0 +1,5 @@ +**/node_modules +src/**/doc/* +build/ +docs/ +protos/ diff --git a/packages/google-cloud-memcache/.eslintrc.json b/packages/google-cloud-memcache/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-memcache/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-memcache/.gitignore b/packages/google-cloud-memcache/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-memcache/.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-memcache/.jsdoc.js b/packages/google-cloud-memcache/.jsdoc.js new file mode 100644 index 00000000000..a2556619eda --- /dev/null +++ b/packages/google-cloud-memcache/.jsdoc.js @@ -0,0 +1,55 @@ +// 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 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 2019 Google, LLC.', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/memcache', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-memcache/.mocharc.js b/packages/google-cloud-memcache/.mocharc.js new file mode 100644 index 00000000000..ff7b34fa5d1 --- /dev/null +++ b/packages/google-cloud-memcache/.mocharc.js @@ -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 +// +// 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 +} +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-memcache/.mocharc.json b/packages/google-cloud-memcache/.mocharc.json new file mode 100644 index 00000000000..670c5e2c24b --- /dev/null +++ b/packages/google-cloud-memcache/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/packages/google-cloud-memcache/.nycrc b/packages/google-cloud-memcache/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-memcache/.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-memcache/.prettierignore b/packages/google-cloud-memcache/.prettierignore new file mode 100644 index 00000000000..f6fac98b0a8 --- /dev/null +++ b/packages/google-cloud-memcache/.prettierignore @@ -0,0 +1,3 @@ +node_modules/* +samples/node_modules/* +src/**/doc/* diff --git a/packages/google-cloud-memcache/.prettierrc.js b/packages/google-cloud-memcache/.prettierrc.js new file mode 100644 index 00000000000..08cba3775be --- /dev/null +++ b/packages/google-cloud-memcache/.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 +// +// 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-memcache/.repo-metadata.json b/packages/google-cloud-memcache/.repo-metadata.json new file mode 100644 index 00000000000..d8b2652bb05 --- /dev/null +++ b/packages/google-cloud-memcache/.repo-metadata.json @@ -0,0 +1,13 @@ +{ + "name": "memcache", + "name_pretty": "Memorystore for Memcached", + "product_documentation": "https://cloud.google.com/memorystore/docs/memcached", + "client_documentation": "https://googleapis.dev/nodejs/memcache/latest/index.html", + "issue_tracker": "https://issuetracker.google.com/savedsearches/5169231", + "release_level": "beta", + "language": "nodejs", + "repo": "googleapis/nodejs-memcache", + "distribution_name": "@google-cloud/memcache", + "api_id": "memcache.googleapis.com", + "requires_billing": true +} diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md index 0de02a32ff0..35cde352334 100644 --- a/packages/google-cloud-memcache/README.md +++ b/packages/google-cloud-memcache/README.md @@ -29,8 +29,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) @@ -52,6 +52,29 @@ npm install @google-cloud/memcache ``` +### Using the client library + +```javascript +// Imports the Google Cloud client library +const {CloudMemcacheClient} = require('@google-cloud/memcache'); + +// Creates a client +const cmc = new CloudMemcacheClient(); +console.info(cmc); +// project = 'my-project' + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-memcache/tree/master/samples) directory. The samples' `README.md` +has instructions for running the samples. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/nodejs-memcache/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-memcache&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | diff --git a/packages/google-cloud-memcache/codecov.yaml b/packages/google-cloud-memcache/codecov.yaml new file mode 100644 index 00000000000..5724ea9478d --- /dev/null +++ b/packages/google-cloud-memcache/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/packages/google-cloud-memcache/linkinator.config.json b/packages/google-cloud-memcache/linkinator.config.json new file mode 100644 index 00000000000..6cd67ccafff --- /dev/null +++ b/packages/google-cloud-memcache/linkinator.config.json @@ -0,0 +1,12 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + ".*github.com/googleapis/nodejs-memcache.*", + "https://googleapis.dev.*" + ], + "silent": true, + "concurrency": 10 +} diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json new file mode 100644 index 00000000000..72a3f0513ad --- /dev/null +++ b/packages/google-cloud-memcache/package.json @@ -0,0 +1,53 @@ +{ + "name": "@google-cloud/memcache", + "version": "0.1.0", + "description": "Memcache client for Node.js", + "repository": "googleapis/nodejs-memcache", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prelint": "cd samples; npm link ../; npm i", + "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.0.2" + }, + "devDependencies": { + "@types/mocha": "^5.2.7", + "@types/node": "^12.12.34", + "@types/sinon": "^9.0.0", + "c8": "^7.1.0", + "gts": "2.0.0-alpha.9", + "jsdoc": "^3.6.3", + "jsdoc-fresh": "^1.0.2", + "jsdoc-region-tag": "^1.0.4", + "linkinator": "^2.0.4", + "mocha": "^6.2.3", + "null-loader": "^3.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^9.0.1", + "ts-loader": "^6.2.2", + "typescript": "~3.8.3", + "webpack": "^4.42.1", + "webpack-cli": "^3.3.11" + }, + "engines": { + "node": ">=10.0.0" + } +} diff --git a/packages/google-cloud-memcache/protos/google/cloud/common_resources.proto b/packages/google-cloud-memcache/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000000..56c9f800d5e --- /dev/null +++ b/packages/google-cloud-memcache/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto b/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto new file mode 100644 index 00000000000..5d75ae49eda --- /dev/null +++ b/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto @@ -0,0 +1,503 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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.memcache.v1beta2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/memcache/v1beta2;memcache"; +option java_multiple_files = true; +option java_outer_classname = "CloudMemcacheProto"; +option java_package = "com.google.cloud.memcache.v1beta2"; + +// Configures and manages Cloud Memorystore for Memcached instances. +// +// +// The `memcache.googleapis.com` service implements the Google Cloud Memorystore +// for Memcached API and defines the following resource model for managing +// Memorystore Memcached (also called Memcached below) 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 Memcached instances, named: +// `/instances/*` +// * As such, Memcached instances are resources of the form: +// `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` +// +// Note that location_id must be refering to a GCP `region`; for example: +// * `projects/my-memcached-project/locations/us-central1/instances/my-memcached` +service CloudMemcache { + option (google.api.default_host) = "memcache.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Instances in a given project and location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1beta2/{parent=projects/*/locations/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1beta2/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Instance in a given project and location. + rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta2/{parent=projects/*/locations/*}/instances" + body: "resource" + }; + option (google.api.method_signature) = "parent,instance_id,resource"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1beta2.Instance" + metadata_type: "google.cloud.memcache.v1beta2.OperationMetadata" + }; + } + + // Updates an existing Instance in a given project and location. + rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta2/{resource.name=projects/*/locations/*/instances/*}" + body: "resource" + }; + option (google.api.method_signature) = "update_mask,resource"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1beta2.Instance" + metadata_type: "google.cloud.memcache.v1beta2.OperationMetadata" + }; + } + + // Updates the defined Memcached Parameters for an existing Instance. + // This method only stages the parameters, it must be followed by + // ApplyParameters to apply the parameters to nodes of the Memcached Instance. + rpc UpdateParameters(UpdateParametersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta2/{name=projects/*/locations/*/instances/*}:updateParameters" + body: "*" + }; + option (google.api.method_signature) = "name,update_mask,parameters"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1beta2.Instance" + metadata_type: "google.cloud.memcache.v1beta2.OperationMetadata" + }; + } + + // Deletes a single Instance. + rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta2/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.memcache.v1beta2.OperationMetadata" + }; + } + + // ApplyParameters will update current set of Parameters to the set of + // specified nodes of the Memcached Instance. + rpc ApplyParameters(ApplyParametersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta2/{name=projects/*/locations/*/instances/*}:applyParameters" + body: "*" + }; + option (google.api.method_signature) = "name,node_ids,apply_all"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1beta2.Instance" + metadata_type: "google.cloud.memcache.v1beta2.OperationMetadata" + }; + } +} + +message Instance { + option (google.api.resource) = { + type: "memcache.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + }; + + // Configuration for a Memcached Node. + message NodeConfig { + // Required. Number of cpus per Memcached node. + int32 cpu_count = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Memory size in MiB for each Memcached node. + int32 memory_size_mb = 2 [(google.api.field_behavior) = REQUIRED]; + } + + message Node { + // Different states of a Memcached node. + // LINT.IfChange + enum State { + // Node state is not set. + STATE_UNSPECIFIED = 0; + + // Node is being created. + CREATING = 1; + + // Node has been created and ready to be used. + READY = 2; + + // Node is being deleted. + DELETING = 3; + + // Node is being updated. + UPDATING = 4; + } + + // Output only. Identifier of the Memcached node. The node id does not + // include project or location like the Memcached instance name. + string node_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Location (GCP Zone) for the Memcached node. + string zone = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the Memcached node. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Hostname or IP address of the Memcached node used by the + // clients to connect to the Memcached server on this node. + string host = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The port number of the Memcached server on this node. + int32 port = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User defined parameters currently applied to the node. + MemcacheParameters parameters = 6; + } + + message InstanceMessage { + enum Code { + // Message Code not set. + CODE_UNSPECIFIED = 0; + + // Memcached nodes are distributed unevenly. + ZONE_DISTRIBUTION_UNBALANCED = 1; + } + + // A code that correspond to one type of user-facing message. + Code code = 1; + + // Message on memcached instance which will be exposed to users. + string message = 2; + } + + // Different states of a Memcached instance. + // LINT.IfChange + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // Memcached instance is being created. + CREATING = 1; + + // Memcached instance has been created and ready to be used. + READY = 2; + + // Memcached instance is being deleted. + DELETING = 4; + + // Memcached instance is going through maintenance, e.g. data plane rollout. + PERFORMING_MAINTENANCE = 5; + } + + // Required. Unique name of the resource in this scope including project and + // location using the form: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // + // Note: Memcached instances are managed and addressed at regional level so + // location_id here refers to a GCP region; however, users may choose which + // zones Memcached nodes within an instances should be provisioned in. + // Refer to [zones] field for more details. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. User provided name for the instance only used for display + // purposes. Cannot be more than 80 characters. + string display_name = 2; + + // Optional. Resource labels to represent user-provided metadata. + // Refer to cloud documentation on labels for more details. + // https://cloud.google.com/compute/docs/labeling-resources + map labels = 3; + + // Optional. The full name of the Google Compute Engine + // [network](/compute/docs/networks-and-firewalls#networks) to which the + // instance is connected. If left unspecified, the `default` network + // will be used. + string authorized_network = 4; + + // Optional. Zones where Memcached nodes should be provisioned in. + // Memcached nodes will be equally distributed across these zones. If not + // provided, the service will by default create nodes in all zones in the + // region for the instance. + repeated string zones = 5; + + // Required. Number of nodes in the Memcached instance. + int32 node_count = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. Configuration for Memcached nodes. + NodeConfig node_config = 7 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The major version of Memcached software. + // If not provided, latest supported version will be used. Currently the + // latest supported major version is MEMCACHE_1_5. + // The minor version will be automatically determined by our system based on + // the latest supported minor version. + MemcacheVersion memcache_version = 9; + + // Optional: User defined parameters to apply to the memcached process + // on each node. + MemcacheParameters parameters = 11; + + // Output only. List of Memcached nodes. + // Refer to [Node] message for more details. + repeated Node memcache_nodes = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the instance was created. + google.protobuf.Timestamp create_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the instance was updated. + google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of this Memcached instance. + State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The full version of memcached server running on this instance. + // System automatically determines the full memcached version for an instance + // based on the input MemcacheVersion. + // The full version format will be "memcached-1.5.16". + string memcache_full_version = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // List of messages that describe current statuses of memcached instance. + repeated InstanceMessage instance_messages = 19; + + // Output only. Endpoint for Discovery API + string discovery_endpoint = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request for [ListInstances][google.cloud.memcache.v1beta2.CloudMemcache.ListInstances]. +message ListInstancesRequest { + // Required. The resource name of the instance location using the form: + // `projects/{project_id}/locations/{location_id}` + // where `location_id` refers to a GCP region + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of items to return. + // + // If not specified, a default value of 1000 will be used by the service. + // Regardless of the page_size value, the response may include a partial list + // and a caller should only rely on response's + // [next_page_token][CloudMemcache.ListInstancesResponse.next_page_token] + // to determine if there are more instances left to be queried. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, + // if any. + string page_token = 3; + + // List filter. For example, exclude all Memcached instances with name as + // my-instance by specifying "name != my-instance". + string filter = 4; + + // Sort results. Supported values are "name", "name desc" or "" (unsorted). + string order_by = 5; +} + +// Response for [ListInstances][google.cloud.memcache.v1beta2.CloudMemcache.ListInstances]. +message ListInstancesResponse { + // A list of Memcached instances in the project in the specified location, + // or across all locations. + // + // If the `location_id` in the parent field of the request is "-", all regions + // available to the project are queried, and the results aggregated. + repeated Instance resources = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for [GetInstance][google.cloud.memcache.v1beta2.CloudMemcache.GetInstance]. +message GetInstanceRequest { + // Required. Memcached instance resource name in the format: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // where `location_id` refers to a GCP region + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; +} + +// Request for [CreateInstance][google.cloud.memcache.v1beta2.CloudMemcache.CreateInstance]. +message CreateInstanceRequest { + // Required. The resource name of the instance location using the form: + // `projects/{project_id}/locations/{location_id}` + // where `location_id` refers to a GCP region + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The logical name of the Memcached instance in the user + // project with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-40 characters. + // * Must end with a number or a letter. + // * Must be unique within the user project / location + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A Memcached [Instance] resource + Instance resource = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for [UpdateInstance][google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstance]. +message UpdateInstanceRequest { + // Required. Mask of fields to update. + // * `displayName` + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A Memcached [Instance] resource. + // Only fields specified in update_mask are updated. + Instance resource = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for [DeleteInstance][google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstance]. +message DeleteInstanceRequest { + // Memcached instance resource name in the format: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // where `location_id` refers to a GCP region + string name = 1; +} + +// Request for [ApplyParameters][google.cloud.memcache.v1beta2.CloudMemcache.ApplyParameters]. +message ApplyParametersRequest { + // Required. Resource name of the Memcached instance for which parameter group updates + // should be applied. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; + + // Nodes to which we should apply the instance-level parameter group. + repeated string node_ids = 2; + + // Whether to apply instance-level parameter group to all nodes. If set to + // true, will explicitly restrict users from specifying any nodes, and apply + // parameter group updates to all nodes within the instance. + bool apply_all = 3; +} + +// Request for [UpdateParameters][google.cloud.memcache.v1beta2.CloudMemcache.UpdateParameters]. +message UpdateParametersRequest { + // Required. Resource name of the Memcached instance for which the parameters should be + // updated. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; + + // Required. Mask of fields to update. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + + // The parameters to apply to the instance. + MemcacheParameters parameters = 3; +} + +message MemcacheParameters { + // Output only. The unique ID associated with this set of parameters. Users + // can use this id to determine if the parameters associated with the instance + // differ from the parameters associated with the nodes and any action needs + // to be taken to apply parameters on nodes. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User defined set of parameters to use in the memcached process. + map params = 3; +} + +// Represents the metadata of a long-running operation. +message OperationMetadata { + // Time when the operation was created. + google.protobuf.Timestamp create_time = 1; + + // Time when the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // Server-defined resource path for the target of the operation. + string target = 3; + + // Name of the verb executed by the operation. + string verb = 4; + + // Human-readable status of the operation, if any. + string status_detail = 5; + + // Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool cancel_requested = 6; + + // API version used to start the operation. + string api_version = 7; +} + +// Memcached versions supported by our service. +enum MemcacheVersion { + MEMCACHE_VERSION_UNSPECIFIED = 0; + + // Memcached 1.5 version. + MEMCACHE_1_5 = 1; +} + +// Metadata for the given [google.cloud.location.Location][google.cloud.location.Location]. +message LocationMetadata { + // Output only. The set of available zones in the location. The map is keyed + // by the lowercase ID of each zone, as defined by GCE. These keys can be + // specified in the `zones` field when creating a Memcached instance. + map available_zones = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +message ZoneMetadata { + +} diff --git a/packages/google-cloud-memcache/protos/protos.d.ts b/packages/google-cloud-memcache/protos/protos.d.ts new file mode 100644 index 00000000000..16656f5152a --- /dev/null +++ b/packages/google-cloud-memcache/protos/protos.d.ts @@ -0,0 +1,7117 @@ +// 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. + +import * as Long from "long"; +import * as $protobuf from "protobufjs"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace memcache. */ + namespace memcache { + + /** Namespace v1beta2. */ + namespace v1beta2 { + + /** Represents a CloudMemcache */ + class CloudMemcache extends $protobuf.rpc.Service { + + /** + * Constructs a new CloudMemcache 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 CloudMemcache 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): CloudMemcache; + + /** + * 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.memcache.v1beta2.IListInstancesRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.memcache.v1beta2.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.memcache.v1beta2.IGetInstanceRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.memcache.v1beta2.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.memcache.v1beta2.ICreateInstanceRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.memcache.v1beta2.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.memcache.v1beta2.IUpdateInstanceRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public updateInstance(request: google.cloud.memcache.v1beta2.IUpdateInstanceRequest): Promise; + + /** + * Calls UpdateParameters. + * @param request UpdateParametersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateParameters(request: google.cloud.memcache.v1beta2.IUpdateParametersRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.UpdateParametersCallback): void; + + /** + * Calls UpdateParameters. + * @param request UpdateParametersRequest message or plain object + * @returns Promise + */ + public updateParameters(request: google.cloud.memcache.v1beta2.IUpdateParametersRequest): 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.memcache.v1beta2.IDeleteInstanceRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.memcache.v1beta2.IDeleteInstanceRequest): Promise; + + /** + * Calls ApplyParameters. + * @param request ApplyParametersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public applyParameters(request: google.cloud.memcache.v1beta2.IApplyParametersRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.ApplyParametersCallback): void; + + /** + * Calls ApplyParameters. + * @param request ApplyParametersRequest message or plain object + * @returns Promise + */ + public applyParameters(request: google.cloud.memcache.v1beta2.IApplyParametersRequest): Promise; + } + + namespace CloudMemcache { + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.memcache.v1beta2.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.memcache.v1beta2.Instance) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#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.memcache.v1beta2.CloudMemcache#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.memcache.v1beta2.CloudMemcache#updateParameters}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateParametersCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#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.memcache.v1beta2.CloudMemcache#applyParameters}. + * @param error Error, if any + * @param [response] Operation + */ + type ApplyParametersCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance displayName */ + displayName?: (string|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance authorizedNetwork */ + authorizedNetwork?: (string|null); + + /** Instance zones */ + zones?: (string[]|null); + + /** Instance nodeCount */ + nodeCount?: (number|null); + + /** Instance nodeConfig */ + nodeConfig?: (google.cloud.memcache.v1beta2.Instance.INodeConfig|null); + + /** Instance memcacheVersion */ + memcacheVersion?: (google.cloud.memcache.v1beta2.MemcacheVersion|keyof typeof google.cloud.memcache.v1beta2.MemcacheVersion|null); + + /** Instance parameters */ + parameters?: (google.cloud.memcache.v1beta2.IMemcacheParameters|null); + + /** Instance memcacheNodes */ + memcacheNodes?: (google.cloud.memcache.v1beta2.Instance.INode[]|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance state */ + state?: (google.cloud.memcache.v1beta2.Instance.State|keyof typeof google.cloud.memcache.v1beta2.Instance.State|null); + + /** Instance memcacheFullVersion */ + memcacheFullVersion?: (string|null); + + /** Instance instanceMessages */ + instanceMessages?: (google.cloud.memcache.v1beta2.Instance.IInstanceMessage[]|null); + + /** Instance discoveryEndpoint */ + discoveryEndpoint?: (string|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance displayName. */ + public displayName: string; + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance authorizedNetwork. */ + public authorizedNetwork: string; + + /** Instance zones. */ + public zones: string[]; + + /** Instance nodeCount. */ + public nodeCount: number; + + /** Instance nodeConfig. */ + public nodeConfig?: (google.cloud.memcache.v1beta2.Instance.INodeConfig|null); + + /** Instance memcacheVersion. */ + public memcacheVersion: (google.cloud.memcache.v1beta2.MemcacheVersion|keyof typeof google.cloud.memcache.v1beta2.MemcacheVersion); + + /** Instance parameters. */ + public parameters?: (google.cloud.memcache.v1beta2.IMemcacheParameters|null); + + /** Instance memcacheNodes. */ + public memcacheNodes: google.cloud.memcache.v1beta2.Instance.INode[]; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance state. */ + public state: (google.cloud.memcache.v1beta2.Instance.State|keyof typeof google.cloud.memcache.v1beta2.Instance.State); + + /** Instance memcacheFullVersion. */ + public memcacheFullVersion: string; + + /** Instance instanceMessages. */ + public instanceMessages: google.cloud.memcache.v1beta2.Instance.IInstanceMessage[]; + + /** Instance discoveryEndpoint. */ + public discoveryEndpoint: string; + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IInstance): google.cloud.memcache.v1beta2.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Instance { + + /** Properties of a NodeConfig. */ + interface INodeConfig { + + /** NodeConfig cpuCount */ + cpuCount?: (number|null); + + /** NodeConfig memorySizeMb */ + memorySizeMb?: (number|null); + } + + /** Represents a NodeConfig. */ + class NodeConfig implements INodeConfig { + + /** + * Constructs a new NodeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.Instance.INodeConfig); + + /** NodeConfig cpuCount. */ + public cpuCount: number; + + /** NodeConfig memorySizeMb. */ + public memorySizeMb: number; + + /** + * Creates a new NodeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeConfig instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.Instance.INodeConfig): google.cloud.memcache.v1beta2.Instance.NodeConfig; + + /** + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.Instance.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.Instance.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.Instance.NodeConfig; + + /** + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.Instance.NodeConfig; + + /** + * Verifies a NodeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.Instance.NodeConfig; + + /** + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @param message NodeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.Instance.NodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Node. */ + interface INode { + + /** Node nodeId */ + nodeId?: (string|null); + + /** Node zone */ + zone?: (string|null); + + /** Node state */ + state?: (google.cloud.memcache.v1beta2.Instance.Node.State|keyof typeof google.cloud.memcache.v1beta2.Instance.Node.State|null); + + /** Node host */ + host?: (string|null); + + /** Node port */ + port?: (number|null); + + /** Node parameters */ + parameters?: (google.cloud.memcache.v1beta2.IMemcacheParameters|null); + } + + /** Represents a Node. */ + class Node implements INode { + + /** + * Constructs a new Node. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.Instance.INode); + + /** Node nodeId. */ + public nodeId: string; + + /** Node zone. */ + public zone: string; + + /** Node state. */ + public state: (google.cloud.memcache.v1beta2.Instance.Node.State|keyof typeof google.cloud.memcache.v1beta2.Instance.Node.State); + + /** Node host. */ + public host: string; + + /** Node port. */ + public port: number; + + /** Node parameters. */ + public parameters?: (google.cloud.memcache.v1beta2.IMemcacheParameters|null); + + /** + * Creates a new Node instance using the specified properties. + * @param [properties] Properties to set + * @returns Node instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.Instance.INode): google.cloud.memcache.v1beta2.Instance.Node; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Node message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.Instance.Node; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.Instance.Node; + + /** + * Verifies a Node message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Node + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.Instance.Node; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @param message Node + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.Instance.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Node to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Node { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + DELETING = 3, + UPDATING = 4 + } + } + + /** Properties of an InstanceMessage. */ + interface IInstanceMessage { + + /** InstanceMessage code */ + code?: (google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code|keyof typeof google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code|null); + + /** InstanceMessage message */ + message?: (string|null); + } + + /** Represents an InstanceMessage. */ + class InstanceMessage implements IInstanceMessage { + + /** + * Constructs a new InstanceMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.Instance.IInstanceMessage); + + /** InstanceMessage code. */ + public code: (google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code|keyof typeof google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code); + + /** InstanceMessage message. */ + public message: string; + + /** + * Creates a new InstanceMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceMessage instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.Instance.IInstanceMessage): google.cloud.memcache.v1beta2.Instance.InstanceMessage; + + /** + * Encodes the specified InstanceMessage message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.InstanceMessage.verify|verify} messages. + * @param message InstanceMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.Instance.IInstanceMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceMessage message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.InstanceMessage.verify|verify} messages. + * @param message InstanceMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.Instance.IInstanceMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.Instance.InstanceMessage; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.Instance.InstanceMessage; + + /** + * Verifies an InstanceMessage message. + * @param message Plain 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 InstanceMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.Instance.InstanceMessage; + + /** + * Creates a plain object from an InstanceMessage message. Also converts values to other types if specified. + * @param message InstanceMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.Instance.InstanceMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InstanceMessage { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + ZONE_DISTRIBUTION_UNBALANCED = 1 + } + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + DELETING = 4, + PERFORMING_MAINTENANCE = 5 + } + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + + /** ListInstancesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** ListInstancesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IListInstancesRequest): google.cloud.memcache.v1beta2.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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 resources */ + resources?: (google.cloud.memcache.v1beta2.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.memcache.v1beta2.IListInstancesResponse); + + /** ListInstancesResponse resources. */ + public resources: google.cloud.memcache.v1beta2.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.memcache.v1beta2.IListInstancesResponse): google.cloud.memcache.v1beta2.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse 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.memcache.v1beta2.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.memcache.v1beta2.IGetInstanceRequest): google.cloud.memcache.v1beta2.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest resource */ + resource?: (google.cloud.memcache.v1beta2.IInstance|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest resource. */ + public resource?: (google.cloud.memcache.v1beta2.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.memcache.v1beta2.ICreateInstanceRequest): google.cloud.memcache.v1beta2.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateInstanceRequest. */ + interface IUpdateInstanceRequest { + + /** UpdateInstanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest resource */ + resource?: (google.cloud.memcache.v1beta2.IInstance|null); + } + + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { + + /** + * Constructs a new UpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IUpdateInstanceRequest); + + /** UpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest resource. */ + public resource?: (google.cloud.memcache.v1beta2.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.memcache.v1beta2.IUpdateInstanceRequest): google.cloud.memcache.v1beta2.UpdateInstanceRequest; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceRequest 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.memcache.v1beta2.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.memcache.v1beta2.IDeleteInstanceRequest): google.cloud.memcache.v1beta2.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ApplyParametersRequest. */ + interface IApplyParametersRequest { + + /** ApplyParametersRequest name */ + name?: (string|null); + + /** ApplyParametersRequest nodeIds */ + nodeIds?: (string[]|null); + + /** ApplyParametersRequest applyAll */ + applyAll?: (boolean|null); + } + + /** Represents an ApplyParametersRequest. */ + class ApplyParametersRequest implements IApplyParametersRequest { + + /** + * Constructs a new ApplyParametersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IApplyParametersRequest); + + /** ApplyParametersRequest name. */ + public name: string; + + /** ApplyParametersRequest nodeIds. */ + public nodeIds: string[]; + + /** ApplyParametersRequest applyAll. */ + public applyAll: boolean; + + /** + * Creates a new ApplyParametersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplyParametersRequest instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IApplyParametersRequest): google.cloud.memcache.v1beta2.ApplyParametersRequest; + + /** + * Encodes the specified ApplyParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.ApplyParametersRequest.verify|verify} messages. + * @param message ApplyParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IApplyParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplyParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ApplyParametersRequest.verify|verify} messages. + * @param message ApplyParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IApplyParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplyParametersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.ApplyParametersRequest; + + /** + * Decodes an ApplyParametersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.ApplyParametersRequest; + + /** + * Verifies an ApplyParametersRequest message. + * @param message Plain 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 ApplyParametersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplyParametersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.ApplyParametersRequest; + + /** + * Creates a plain object from an ApplyParametersRequest message. Also converts values to other types if specified. + * @param message ApplyParametersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.ApplyParametersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplyParametersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateParametersRequest. */ + interface IUpdateParametersRequest { + + /** UpdateParametersRequest name */ + name?: (string|null); + + /** UpdateParametersRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateParametersRequest parameters */ + parameters?: (google.cloud.memcache.v1beta2.IMemcacheParameters|null); + } + + /** Represents an UpdateParametersRequest. */ + class UpdateParametersRequest implements IUpdateParametersRequest { + + /** + * Constructs a new UpdateParametersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IUpdateParametersRequest); + + /** UpdateParametersRequest name. */ + public name: string; + + /** UpdateParametersRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateParametersRequest parameters. */ + public parameters?: (google.cloud.memcache.v1beta2.IMemcacheParameters|null); + + /** + * Creates a new UpdateParametersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateParametersRequest instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IUpdateParametersRequest): google.cloud.memcache.v1beta2.UpdateParametersRequest; + + /** + * Encodes the specified UpdateParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.UpdateParametersRequest.verify|verify} messages. + * @param message UpdateParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IUpdateParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.UpdateParametersRequest.verify|verify} messages. + * @param message UpdateParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IUpdateParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateParametersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.UpdateParametersRequest; + + /** + * Decodes an UpdateParametersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.UpdateParametersRequest; + + /** + * Verifies an UpdateParametersRequest message. + * @param message Plain 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 UpdateParametersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateParametersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.UpdateParametersRequest; + + /** + * Creates a plain object from an UpdateParametersRequest message. Also converts values to other types if specified. + * @param message UpdateParametersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.UpdateParametersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateParametersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MemcacheParameters. */ + interface IMemcacheParameters { + + /** MemcacheParameters id */ + id?: (string|null); + + /** MemcacheParameters params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a MemcacheParameters. */ + class MemcacheParameters implements IMemcacheParameters { + + /** + * Constructs a new MemcacheParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IMemcacheParameters); + + /** MemcacheParameters id. */ + public id: string; + + /** MemcacheParameters params. */ + public params: { [k: string]: string }; + + /** + * Creates a new MemcacheParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns MemcacheParameters instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IMemcacheParameters): google.cloud.memcache.v1beta2.MemcacheParameters; + + /** + * Encodes the specified MemcacheParameters message. Does not implicitly {@link google.cloud.memcache.v1beta2.MemcacheParameters.verify|verify} messages. + * @param message MemcacheParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IMemcacheParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MemcacheParameters message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.MemcacheParameters.verify|verify} messages. + * @param message MemcacheParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IMemcacheParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MemcacheParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MemcacheParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.MemcacheParameters; + + /** + * Decodes a MemcacheParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MemcacheParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.MemcacheParameters; + + /** + * Verifies a MemcacheParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MemcacheParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MemcacheParameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.MemcacheParameters; + + /** + * Creates a plain object from a MemcacheParameters message. Also converts values to other types if specified. + * @param message MemcacheParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.MemcacheParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MemcacheParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusDetail */ + statusDetail?: (string|null); + + /** OperationMetadata 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.memcache.v1beta2.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.memcache.v1beta2.IOperationMetadata): google.cloud.memcache.v1beta2.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** MemcacheVersion enum. */ + enum MemcacheVersion { + MEMCACHE_VERSION_UNSPECIFIED = 0, + MEMCACHE_1_5 = 1 + } + + /** Properties of a LocationMetadata. */ + interface ILocationMetadata { + + /** LocationMetadata availableZones */ + availableZones?: ({ [k: string]: google.cloud.memcache.v1beta2.IZoneMetadata }|null); + } + + /** Represents a LocationMetadata. */ + class LocationMetadata implements ILocationMetadata { + + /** + * Constructs a new LocationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.ILocationMetadata); + + /** LocationMetadata availableZones. */ + public availableZones: { [k: string]: google.cloud.memcache.v1beta2.IZoneMetadata }; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationMetadata instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.ILocationMetadata): google.cloud.memcache.v1beta2.LocationMetadata; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.memcache.v1beta2.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.LocationMetadata; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.LocationMetadata; + + /** + * Verifies a LocationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.LocationMetadata; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @param message LocationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ZoneMetadata. */ + interface IZoneMetadata { + } + + /** Represents a ZoneMetadata. */ + class ZoneMetadata implements IZoneMetadata { + + /** + * Constructs a new ZoneMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IZoneMetadata); + + /** + * Creates a new ZoneMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ZoneMetadata instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IZoneMetadata): google.cloud.memcache.v1beta2.ZoneMetadata; + + /** + * Encodes the specified ZoneMetadata message. Does not implicitly {@link google.cloud.memcache.v1beta2.ZoneMetadata.verify|verify} messages. + * @param message ZoneMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IZoneMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZoneMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ZoneMetadata.verify|verify} messages. + * @param message ZoneMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IZoneMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZoneMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.ZoneMetadata; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZoneMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.ZoneMetadata; + + /** + * Verifies a ZoneMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ZoneMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZoneMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.ZoneMetadata; + + /** + * Creates a plain object from a ZoneMetadata message. Also converts values to other types if specified. + * @param message ZoneMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.ZoneMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ZoneMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get: string; + + /** HttpRule put. */ + public put: string; + + /** HttpRule post. */ + public post: string; + + /** HttpRule delete. */ + public delete: string; + + /** HttpRule patch. */ + public patch: string; + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5 + } + + /** 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); + } + + /** 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; + + /** + * 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 + } + } + + /** 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); + } + + /** 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); + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations#listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } +} diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js new file mode 100644 index 00000000000..72715769110 --- /dev/null +++ b/packages/google-cloud-memcache/protos/protos.js @@ -0,0 +1,18131 @@ +// 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. + +/*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("protobufjs/minimal")); + +})(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_memcache_0_1_0_protos || ($protobuf.roots._google_cloud_memcache_0_1_0_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.memcache = (function() { + + /** + * Namespace memcache. + * @memberof google.cloud + * @namespace + */ + var memcache = {}; + + memcache.v1beta2 = (function() { + + /** + * Namespace v1beta2. + * @memberof google.cloud.memcache + * @namespace + */ + var v1beta2 = {}; + + v1beta2.CloudMemcache = (function() { + + /** + * Constructs a new CloudMemcache service. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a CloudMemcache + * @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 CloudMemcache(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CloudMemcache.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudMemcache; + + /** + * Creates new CloudMemcache service using the specified rpc implementation. + * @function create + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @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 {CloudMemcache} RPC service. Useful where requests and/or responses are streamed. + */ + CloudMemcache.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#listInstances}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.memcache.v1beta2.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.memcache.v1beta2.ListInstancesRequest, $root.google.cloud.memcache.v1beta2.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#getInstance}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.memcache.v1beta2.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.memcache.v1beta2.GetInstanceRequest, $root.google.cloud.memcache.v1beta2.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#createInstance}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.memcache.v1beta2.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#updateInstance}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.cloud.memcache.v1beta2.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#updateParameters}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef UpdateParametersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateParameters. + * @function updateParameters + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IUpdateParametersRequest} request UpdateParametersRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.UpdateParametersCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.updateParameters = function updateParameters(request, callback) { + return this.rpcCall(updateParameters, $root.google.cloud.memcache.v1beta2.UpdateParametersRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateParameters" }); + + /** + * Calls UpdateParameters. + * @function updateParameters + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IUpdateParametersRequest} request UpdateParametersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#deleteInstance}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.memcache.v1beta2.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#applyParameters}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef ApplyParametersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ApplyParameters. + * @function applyParameters + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IApplyParametersRequest} request ApplyParametersRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.ApplyParametersCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.applyParameters = function applyParameters(request, callback) { + return this.rpcCall(applyParameters, $root.google.cloud.memcache.v1beta2.ApplyParametersRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ApplyParameters" }); + + /** + * Calls ApplyParameters. + * @function applyParameters + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IApplyParametersRequest} request ApplyParametersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CloudMemcache; + })(); + + v1beta2.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.memcache.v1beta2 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [displayName] Instance displayName + * @property {Object.|null} [labels] Instance labels + * @property {string|null} [authorizedNetwork] Instance authorizedNetwork + * @property {Array.|null} [zones] Instance zones + * @property {number|null} [nodeCount] Instance nodeCount + * @property {google.cloud.memcache.v1beta2.Instance.INodeConfig|null} [nodeConfig] Instance nodeConfig + * @property {google.cloud.memcache.v1beta2.MemcacheVersion|null} [memcacheVersion] Instance memcacheVersion + * @property {google.cloud.memcache.v1beta2.IMemcacheParameters|null} [parameters] Instance parameters + * @property {Array.|null} [memcacheNodes] Instance memcacheNodes + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.cloud.memcache.v1beta2.Instance.State|null} [state] Instance state + * @property {string|null} [memcacheFullVersion] Instance memcacheFullVersion + * @property {Array.|null} [instanceMessages] Instance instanceMessages + * @property {string|null} [discoveryEndpoint] Instance discoveryEndpoint + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.memcache.v1beta2.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.zones = []; + this.memcacheNodes = []; + this.instanceMessages = []; + if (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.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.displayName = ""; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance authorizedNetwork. + * @member {string} authorizedNetwork + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.authorizedNetwork = ""; + + /** + * Instance zones. + * @member {Array.} zones + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.zones = $util.emptyArray; + + /** + * Instance nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.nodeCount = 0; + + /** + * Instance nodeConfig. + * @member {google.cloud.memcache.v1beta2.Instance.INodeConfig|null|undefined} nodeConfig + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.nodeConfig = null; + + /** + * Instance memcacheVersion. + * @member {google.cloud.memcache.v1beta2.MemcacheVersion} memcacheVersion + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.memcacheVersion = 0; + + /** + * Instance parameters. + * @member {google.cloud.memcache.v1beta2.IMemcacheParameters|null|undefined} parameters + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.parameters = null; + + /** + * Instance memcacheNodes. + * @member {Array.} memcacheNodes + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.memcacheNodes = $util.emptyArray; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance state. + * @member {google.cloud.memcache.v1beta2.Instance.State} state + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance memcacheFullVersion. + * @member {string} memcacheFullVersion + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.memcacheFullVersion = ""; + + /** + * Instance instanceMessages. + * @member {Array.} instanceMessages + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.instanceMessages = $util.emptyArray; + + /** + * Instance discoveryEndpoint. + * @member {string} discoveryEndpoint + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.discoveryEndpoint = ""; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {google.cloud.memcache.v1beta2.IInstance=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {google.cloud.memcache.v1beta2.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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.labels != null && message.hasOwnProperty("labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.authorizedNetwork != null && message.hasOwnProperty("authorizedNetwork")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.authorizedNetwork); + if (message.zones != null && message.zones.length) + for (var i = 0; i < message.zones.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.zones[i]); + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.nodeCount); + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) + $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.memcacheVersion != null && message.hasOwnProperty("memcacheVersion")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.memcacheVersion); + if (message.parameters != null && message.hasOwnProperty("parameters")) + $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.memcacheNodes != null && message.memcacheNodes.length) + for (var i = 0; i < message.memcacheNodes.length; ++i) + $root.google.cloud.memcache.v1beta2.Instance.Node.encode(message.memcacheNodes[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.state); + if (message.memcacheFullVersion != null && message.hasOwnProperty("memcacheFullVersion")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.memcacheFullVersion); + if (message.instanceMessages != null && message.instanceMessages.length) + for (var i = 0; i < message.instanceMessages.length; ++i) + $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.encode(message.instanceMessages[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.discoveryEndpoint); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.Instance(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + break; + case 4: + message.authorizedNetwork = reader.string(); + break; + case 5: + if (!(message.zones && message.zones.length)) + message.zones = []; + message.zones.push(reader.string()); + break; + case 6: + message.nodeCount = reader.int32(); + break; + case 7: + message.nodeConfig = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.decode(reader, reader.uint32()); + break; + case 9: + message.memcacheVersion = reader.int32(); + break; + case 11: + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); + break; + case 12: + if (!(message.memcacheNodes && message.memcacheNodes.length)) + message.memcacheNodes = []; + message.memcacheNodes.push($root.google.cloud.memcache.v1beta2.Instance.Node.decode(reader, reader.uint32())); + break; + case 13: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 14: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 15: + message.state = reader.int32(); + break; + case 18: + message.memcacheFullVersion = reader.string(); + break; + case 19: + if (!(message.instanceMessages && message.instanceMessages.length)) + message.instanceMessages = []; + message.instanceMessages.push($root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.decode(reader, reader.uint32())); + break; + case 20: + message.discoveryEndpoint = reader.string(); + 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.memcache.v1beta2.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.authorizedNetwork != null && message.hasOwnProperty("authorizedNetwork")) + if (!$util.isString(message.authorizedNetwork)) + return "authorizedNetwork: string expected"; + if (message.zones != null && message.hasOwnProperty("zones")) { + if (!Array.isArray(message.zones)) + return "zones: array expected"; + for (var i = 0; i < message.zones.length; ++i) + if (!$util.isString(message.zones[i])) + return "zones: string[] expected"; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) { + var error = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.verify(message.nodeConfig); + if (error) + return "nodeConfig." + error; + } + if (message.memcacheVersion != null && message.hasOwnProperty("memcacheVersion")) + switch (message.memcacheVersion) { + default: + return "memcacheVersion: enum value expected"; + case 0: + case 1: + break; + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.memcache.v1beta2.MemcacheParameters.verify(message.parameters); + if (error) + return "parameters." + error; + } + if (message.memcacheNodes != null && message.hasOwnProperty("memcacheNodes")) { + if (!Array.isArray(message.memcacheNodes)) + return "memcacheNodes: array expected"; + for (var i = 0; i < message.memcacheNodes.length; ++i) { + var error = $root.google.cloud.memcache.v1beta2.Instance.Node.verify(message.memcacheNodes[i]); + if (error) + return "memcacheNodes." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + break; + } + if (message.memcacheFullVersion != null && message.hasOwnProperty("memcacheFullVersion")) + if (!$util.isString(message.memcacheFullVersion)) + return "memcacheFullVersion: string expected"; + if (message.instanceMessages != null && message.hasOwnProperty("instanceMessages")) { + if (!Array.isArray(message.instanceMessages)) + return "instanceMessages: array expected"; + for (var i = 0; i < message.instanceMessages.length; ++i) { + var error = $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.verify(message.instanceMessages[i]); + if (error) + return "instanceMessages." + error; + } + } + if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) + if (!$util.isString(message.discoveryEndpoint)) + return "discoveryEndpoint: string expected"; + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.Instance) + return object; + var message = new $root.google.cloud.memcache.v1beta2.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.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.authorizedNetwork != null) + message.authorizedNetwork = String(object.authorizedNetwork); + if (object.zones) { + if (!Array.isArray(object.zones)) + throw TypeError(".google.cloud.memcache.v1beta2.Instance.zones: array expected"); + message.zones = []; + for (var i = 0; i < object.zones.length; ++i) + message.zones[i] = String(object.zones[i]); + } + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.nodeConfig != null) { + if (typeof object.nodeConfig !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.nodeConfig: object expected"); + message.nodeConfig = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.fromObject(object.nodeConfig); + } + switch (object.memcacheVersion) { + case "MEMCACHE_VERSION_UNSPECIFIED": + case 0: + message.memcacheVersion = 0; + break; + case "MEMCACHE_1_5": + case 1: + message.memcacheVersion = 1; + break; + } + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.parameters: object expected"); + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.fromObject(object.parameters); + } + if (object.memcacheNodes) { + if (!Array.isArray(object.memcacheNodes)) + throw TypeError(".google.cloud.memcache.v1beta2.Instance.memcacheNodes: array expected"); + message.memcacheNodes = []; + for (var i = 0; i < object.memcacheNodes.length; ++i) { + if (typeof object.memcacheNodes[i] !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.memcacheNodes: object expected"); + message.memcacheNodes[i] = $root.google.cloud.memcache.v1beta2.Instance.Node.fromObject(object.memcacheNodes[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "PERFORMING_MAINTENANCE": + case 5: + message.state = 5; + break; + } + if (object.memcacheFullVersion != null) + message.memcacheFullVersion = String(object.memcacheFullVersion); + if (object.instanceMessages) { + if (!Array.isArray(object.instanceMessages)) + throw TypeError(".google.cloud.memcache.v1beta2.Instance.instanceMessages: array expected"); + message.instanceMessages = []; + for (var i = 0; i < object.instanceMessages.length; ++i) { + if (typeof object.instanceMessages[i] !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.instanceMessages: object expected"); + message.instanceMessages[i] = $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.fromObject(object.instanceMessages[i]); + } + } + if (object.discoveryEndpoint != null) + message.discoveryEndpoint = String(object.discoveryEndpoint); + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {google.cloud.memcache.v1beta2.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.zones = []; + object.memcacheNodes = []; + object.instanceMessages = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.authorizedNetwork = ""; + object.nodeCount = 0; + object.nodeConfig = null; + object.memcacheVersion = options.enums === String ? "MEMCACHE_VERSION_UNSPECIFIED" : 0; + object.parameters = null; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.memcacheFullVersion = ""; + object.discoveryEndpoint = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + 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.authorizedNetwork != null && message.hasOwnProperty("authorizedNetwork")) + object.authorizedNetwork = message.authorizedNetwork; + if (message.zones && message.zones.length) { + object.zones = []; + for (var j = 0; j < message.zones.length; ++j) + object.zones[j] = message.zones[j]; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) + object.nodeConfig = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.toObject(message.nodeConfig, options); + if (message.memcacheVersion != null && message.hasOwnProperty("memcacheVersion")) + object.memcacheVersion = options.enums === String ? $root.google.cloud.memcache.v1beta2.MemcacheVersion[message.memcacheVersion] : message.memcacheVersion; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.toObject(message.parameters, options); + if (message.memcacheNodes && message.memcacheNodes.length) { + object.memcacheNodes = []; + for (var j = 0; j < message.memcacheNodes.length; ++j) + object.memcacheNodes[j] = $root.google.cloud.memcache.v1beta2.Instance.Node.toObject(message.memcacheNodes[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.memcache.v1beta2.Instance.State[message.state] : message.state; + if (message.memcacheFullVersion != null && message.hasOwnProperty("memcacheFullVersion")) + object.memcacheFullVersion = message.memcacheFullVersion; + if (message.instanceMessages && message.instanceMessages.length) { + object.instanceMessages = []; + for (var j = 0; j < message.instanceMessages.length; ++j) + object.instanceMessages[j] = $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.toObject(message.instanceMessages[j], options); + } + if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) + object.discoveryEndpoint = message.discoveryEndpoint; + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Instance.NodeConfig = (function() { + + /** + * Properties of a NodeConfig. + * @memberof google.cloud.memcache.v1beta2.Instance + * @interface INodeConfig + * @property {number|null} [cpuCount] NodeConfig cpuCount + * @property {number|null} [memorySizeMb] NodeConfig memorySizeMb + */ + + /** + * Constructs a new NodeConfig. + * @memberof google.cloud.memcache.v1beta2.Instance + * @classdesc Represents a NodeConfig. + * @implements INodeConfig + * @constructor + * @param {google.cloud.memcache.v1beta2.Instance.INodeConfig=} [properties] Properties to set + */ + function NodeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeConfig cpuCount. + * @member {number} cpuCount + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @instance + */ + NodeConfig.prototype.cpuCount = 0; + + /** + * NodeConfig memorySizeMb. + * @member {number} memorySizeMb + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @instance + */ + NodeConfig.prototype.memorySizeMb = 0; + + /** + * Creates a new NodeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INodeConfig=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.Instance.NodeConfig} NodeConfig instance + */ + NodeConfig.create = function create(properties) { + return new NodeConfig(properties); + }; + + /** + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.NodeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); + if (message.memorySizeMb != null && message.hasOwnProperty("memorySizeMb")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.memorySizeMb); + return writer; + }; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.NodeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.Instance.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.Instance.NodeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cpuCount = reader.int32(); + break; + case 2: + message.memorySizeMb = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.Instance.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeConfig message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + if (!$util.isInteger(message.cpuCount)) + return "cpuCount: integer expected"; + if (message.memorySizeMb != null && message.hasOwnProperty("memorySizeMb")) + if (!$util.isInteger(message.memorySizeMb)) + return "memorySizeMb: integer expected"; + return null; + }; + + /** + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.Instance.NodeConfig} NodeConfig + */ + NodeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.Instance.NodeConfig) + return object; + var message = new $root.google.cloud.memcache.v1beta2.Instance.NodeConfig(); + if (object.cpuCount != null) + message.cpuCount = object.cpuCount | 0; + if (object.memorySizeMb != null) + message.memorySizeMb = object.memorySizeMb | 0; + return message; + }; + + /** + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1beta2.Instance.NodeConfig} message NodeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpuCount = 0; + object.memorySizeMb = 0; + } + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + object.cpuCount = message.cpuCount; + if (message.memorySizeMb != null && message.hasOwnProperty("memorySizeMb")) + object.memorySizeMb = message.memorySizeMb; + return object; + }; + + /** + * Converts this NodeConfig to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @instance + * @returns {Object.} JSON object + */ + NodeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeConfig; + })(); + + Instance.Node = (function() { + + /** + * Properties of a Node. + * @memberof google.cloud.memcache.v1beta2.Instance + * @interface INode + * @property {string|null} [nodeId] Node nodeId + * @property {string|null} [zone] Node zone + * @property {google.cloud.memcache.v1beta2.Instance.Node.State|null} [state] Node state + * @property {string|null} [host] Node host + * @property {number|null} [port] Node port + * @property {google.cloud.memcache.v1beta2.IMemcacheParameters|null} [parameters] Node parameters + */ + + /** + * Constructs a new Node. + * @memberof google.cloud.memcache.v1beta2.Instance + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {google.cloud.memcache.v1beta2.Instance.INode=} [properties] Properties to set + */ + function Node(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Node nodeId. + * @member {string} nodeId + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.nodeId = ""; + + /** + * Node zone. + * @member {string} zone + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.zone = ""; + + /** + * Node state. + * @member {google.cloud.memcache.v1beta2.Instance.Node.State} state + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.state = 0; + + /** + * Node host. + * @member {string} host + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.host = ""; + + /** + * Node port. + * @member {number} port + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.port = 0; + + /** + * Node parameters. + * @member {google.cloud.memcache.v1beta2.IMemcacheParameters|null|undefined} parameters + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.parameters = null; + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INode=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.Instance.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.Node.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeId); + if (message.zone != null && message.hasOwnProperty("zone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.host != null && message.hasOwnProperty("host")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.host); + if (message.port != null && message.hasOwnProperty("port")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.port); + if (message.parameters != null && message.hasOwnProperty("parameters")) + $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.Instance.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nodeId = reader.string(); + break; + case 2: + message.zone = reader.string(); + break; + case 3: + message.state = reader.int32(); + break; + case 4: + message.host = reader.string(); + break; + case 5: + message.port = reader.int32(); + break; + case 6: + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + if (!$util.isString(message.nodeId)) + return "nodeId: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: 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.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.memcache.v1beta2.MemcacheParameters.verify(message.parameters); + if (error) + return "parameters." + error; + } + return null; + }; + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.Instance.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.Instance.Node) + return object; + var message = new $root.google.cloud.memcache.v1beta2.Instance.Node(); + if (object.nodeId != null) + message.nodeId = String(object.nodeId); + if (object.zone != null) + message.zone = String(object.zone); + 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 "DELETING": + case 3: + message.state = 3; + break; + case "UPDATING": + case 4: + message.state = 4; + break; + } + if (object.host != null) + message.host = String(object.host); + if (object.port != null) + message.port = object.port | 0; + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.Node.parameters: object expected"); + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.fromObject(object.parameters); + } + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {google.cloud.memcache.v1beta2.Instance.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.nodeId = ""; + object.zone = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.host = ""; + object.port = 0; + object.parameters = null; + } + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + object.nodeId = message.nodeId; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.memcache.v1beta2.Instance.Node.State[message.state] : message.state; + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.toObject(message.parameters, options); + return object; + }; + + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.memcache.v1beta2.Instance.Node.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + * @property {number} DELETING=3 DELETING value + * @property {number} UPDATING=4 UPDATING value + */ + Node.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] = "DELETING"] = 3; + values[valuesById[4] = "UPDATING"] = 4; + return values; + })(); + + return Node; + })(); + + Instance.InstanceMessage = (function() { + + /** + * Properties of an InstanceMessage. + * @memberof google.cloud.memcache.v1beta2.Instance + * @interface IInstanceMessage + * @property {google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code|null} [code] InstanceMessage code + * @property {string|null} [message] InstanceMessage message + */ + + /** + * Constructs a new InstanceMessage. + * @memberof google.cloud.memcache.v1beta2.Instance + * @classdesc Represents an InstanceMessage. + * @implements IInstanceMessage + * @constructor + * @param {google.cloud.memcache.v1beta2.Instance.IInstanceMessage=} [properties] Properties to set + */ + function InstanceMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceMessage code. + * @member {google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code} code + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @instance + */ + InstanceMessage.prototype.code = 0; + + /** + * InstanceMessage message. + * @member {string} message + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @instance + */ + InstanceMessage.prototype.message = ""; + + /** + * Creates a new InstanceMessage instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1beta2.Instance.IInstanceMessage=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.Instance.InstanceMessage} InstanceMessage instance + */ + InstanceMessage.create = function create(properties) { + return new InstanceMessage(properties); + }; + + /** + * Encodes the specified InstanceMessage message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.InstanceMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1beta2.Instance.IInstanceMessage} message InstanceMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && message.hasOwnProperty("code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && message.hasOwnProperty("message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + return writer; + }; + + /** + * Encodes the specified InstanceMessage message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.InstanceMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1beta2.Instance.IInstanceMessage} message InstanceMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.Instance.InstanceMessage} InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.Instance.InstanceMessage} InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceMessage message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates an InstanceMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.Instance.InstanceMessage} InstanceMessage + */ + InstanceMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage) + return object; + var message = new $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage(); + switch (object.code) { + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "ZONE_DISTRIBUTION_UNBALANCED": + case 1: + message.code = 1; + break; + } + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from an InstanceMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1beta2.Instance.InstanceMessage} message InstanceMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "CODE_UNSPECIFIED" : 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code[message.code] : message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this InstanceMessage to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @instance + * @returns {Object.} JSON object + */ + InstanceMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Code enum. + * @name google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code + * @enum {string} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} ZONE_DISTRIBUTION_UNBALANCED=1 ZONE_DISTRIBUTION_UNBALANCED value + */ + InstanceMessage.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ZONE_DISTRIBUTION_UNBALANCED"] = 1; + return values; + })(); + + return InstanceMessage; + })(); + + /** + * State enum. + * @name google.cloud.memcache.v1beta2.Instance.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + * @property {number} DELETING=4 DELETING value + * @property {number} PERFORMING_MAINTENANCE=5 PERFORMING_MAINTENANCE 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[4] = "DELETING"] = 4; + values[valuesById[5] = "PERFORMING_MAINTENANCE"] = 5; + return values; + })(); + + return Instance; + })(); + + v1beta2.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [filter] ListInstancesRequest filter + * @property {string|null} [orderBy] ListInstancesRequest orderBy + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @static + * @param {google.cloud.memcache.v1beta2.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @static + * @param {google.cloud.memcache.v1beta2.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 && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @static + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + case 5: + message.orderBy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.ListInstancesRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @static + * @param {google.cloud.memcache.v1beta2.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesRequest; + })(); + + v1beta2.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.cloud.memcache.v1beta2 + * @interface IListInstancesResponse + * @property {Array.|null} [resources] ListInstancesResponse resources + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.memcache.v1beta2.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + this.resources = []; + 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 resources. + * @member {Array.} resources + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.resources = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @static + * @param {google.cloud.memcache.v1beta2.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.memcache.v1beta2.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @static + * @param {google.cloud.memcache.v1beta2.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.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + $root.google.cloud.memcache.v1beta2.Instance.encode(message.resources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("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.memcache.v1beta2.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @static + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.memcache.v1beta2.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.memcache.v1beta2.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.resources != null && message.hasOwnProperty("resources")) { + if (!Array.isArray(message.resources)) + return "resources: array expected"; + for (var i = 0; i < message.resources.length; ++i) { + var error = $root.google.cloud.memcache.v1beta2.Instance.verify(message.resources[i]); + if (error) + return "resources." + 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.memcache.v1beta2.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.ListInstancesResponse) + return object; + var message = new $root.google.cloud.memcache.v1beta2.ListInstancesResponse(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.memcache.v1beta2.ListInstancesResponse.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) { + if (typeof object.resources[i] !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.ListInstancesResponse.resources: object expected"); + message.resources[i] = $root.google.cloud.memcache.v1beta2.Instance.fromObject(object.resources[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.memcache.v1beta2.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.memcache.v1beta2.ListInstancesResponse + * @static + * @param {google.cloud.memcache.v1beta2.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.resources = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = $root.google.cloud.memcache.v1beta2.Instance.toObject(message.resources[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.memcache.v1beta2.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesResponse; + })(); + + v1beta2.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.GetInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.GetInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.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 && message.hasOwnProperty("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.memcache.v1beta2.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.GetInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.GetInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.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.memcache.v1beta2.GetInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInstanceRequest; + })(); + + v1beta2.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.memcache.v1beta2.IInstance|null} [resource] CreateInstanceRequest resource + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest resource. + * @member {google.cloud.memcache.v1beta2.IInstance|null|undefined} resource + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.resource = null; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.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 && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.google.cloud.memcache.v1beta2.Instance.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.resource = $root.google.cloud.memcache.v1beta2.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.memcache.v1beta2.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.memcache.v1beta2.Instance.verify(message.resource); + if (error) + return "resource." + error; + } + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.CreateInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.CreateInstanceRequest.resource: object expected"); + message.resource = $root.google.cloud.memcache.v1beta2.Instance.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.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.resource = 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.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.memcache.v1beta2.Instance.toObject(message.resource, options); + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateInstanceRequest; + })(); + + v1beta2.UpdateInstanceRequest = (function() { + + /** + * Properties of an UpdateInstanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface IUpdateInstanceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask + * @property {google.cloud.memcache.v1beta2.IInstance|null} [resource] UpdateInstanceRequest resource + */ + + /** + * Constructs a new UpdateInstanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.updateMask = null; + + /** + * UpdateInstanceRequest resource. + * @member {google.cloud.memcache.v1beta2.IInstance|null|undefined} resource + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.resource = null; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.UpdateInstanceRequest} UpdateInstanceRequest instance + */ + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.UpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.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 && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.google.cloud.memcache.v1beta2.Instance.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.UpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.resource = $root.google.cloud.memcache.v1beta2.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.memcache.v1beta2.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.memcache.v1beta2.Instance.verify(message.resource); + if (error) + return "resource." + error; + } + return null; + }; + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.UpdateInstanceRequest} UpdateInstanceRequest + */ + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.UpdateInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.UpdateInstanceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.UpdateInstanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.UpdateInstanceRequest.resource: object expected"); + message.resource = $root.google.cloud.memcache.v1beta2.Instance.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.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.resource = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.memcache.v1beta2.Instance.toObject(message.resource, options); + return object; + }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateInstanceRequest; + })(); + + v1beta2.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.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 && message.hasOwnProperty("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.memcache.v1beta2.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.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.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteInstanceRequest; + })(); + + v1beta2.ApplyParametersRequest = (function() { + + /** + * Properties of an ApplyParametersRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface IApplyParametersRequest + * @property {string|null} [name] ApplyParametersRequest name + * @property {Array.|null} [nodeIds] ApplyParametersRequest nodeIds + * @property {boolean|null} [applyAll] ApplyParametersRequest applyAll + */ + + /** + * Constructs a new ApplyParametersRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents an ApplyParametersRequest. + * @implements IApplyParametersRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.IApplyParametersRequest=} [properties] Properties to set + */ + function ApplyParametersRequest(properties) { + this.nodeIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplyParametersRequest name. + * @member {string} name + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @instance + */ + ApplyParametersRequest.prototype.name = ""; + + /** + * ApplyParametersRequest nodeIds. + * @member {Array.} nodeIds + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @instance + */ + ApplyParametersRequest.prototype.nodeIds = $util.emptyArray; + + /** + * ApplyParametersRequest applyAll. + * @member {boolean} applyAll + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @instance + */ + ApplyParametersRequest.prototype.applyAll = false; + + /** + * Creates a new ApplyParametersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1beta2.IApplyParametersRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.ApplyParametersRequest} ApplyParametersRequest instance + */ + ApplyParametersRequest.create = function create(properties) { + return new ApplyParametersRequest(properties); + }; + + /** + * Encodes the specified ApplyParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.ApplyParametersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1beta2.IApplyParametersRequest} message ApplyParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyParametersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.nodeIds != null && message.nodeIds.length) + for (var i = 0; i < message.nodeIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIds[i]); + if (message.applyAll != null && message.hasOwnProperty("applyAll")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.applyAll); + return writer; + }; + + /** + * Encodes the specified ApplyParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ApplyParametersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1beta2.IApplyParametersRequest} message ApplyParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyParametersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplyParametersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.ApplyParametersRequest} ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyParametersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.ApplyParametersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.nodeIds && message.nodeIds.length)) + message.nodeIds = []; + message.nodeIds.push(reader.string()); + break; + case 3: + message.applyAll = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApplyParametersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.ApplyParametersRequest} ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyParametersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplyParametersRequest message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplyParametersRequest.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.nodeIds != null && message.hasOwnProperty("nodeIds")) { + if (!Array.isArray(message.nodeIds)) + return "nodeIds: array expected"; + for (var i = 0; i < message.nodeIds.length; ++i) + if (!$util.isString(message.nodeIds[i])) + return "nodeIds: string[] expected"; + } + if (message.applyAll != null && message.hasOwnProperty("applyAll")) + if (typeof message.applyAll !== "boolean") + return "applyAll: boolean expected"; + return null; + }; + + /** + * Creates an ApplyParametersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.ApplyParametersRequest} ApplyParametersRequest + */ + ApplyParametersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.ApplyParametersRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.ApplyParametersRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.nodeIds) { + if (!Array.isArray(object.nodeIds)) + throw TypeError(".google.cloud.memcache.v1beta2.ApplyParametersRequest.nodeIds: array expected"); + message.nodeIds = []; + for (var i = 0; i < object.nodeIds.length; ++i) + message.nodeIds[i] = String(object.nodeIds[i]); + } + if (object.applyAll != null) + message.applyAll = Boolean(object.applyAll); + return message; + }; + + /** + * Creates a plain object from an ApplyParametersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1beta2.ApplyParametersRequest} message ApplyParametersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplyParametersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeIds = []; + if (options.defaults) { + object.name = ""; + object.applyAll = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.nodeIds && message.nodeIds.length) { + object.nodeIds = []; + for (var j = 0; j < message.nodeIds.length; ++j) + object.nodeIds[j] = message.nodeIds[j]; + } + if (message.applyAll != null && message.hasOwnProperty("applyAll")) + object.applyAll = message.applyAll; + return object; + }; + + /** + * Converts this ApplyParametersRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @instance + * @returns {Object.} JSON object + */ + ApplyParametersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ApplyParametersRequest; + })(); + + v1beta2.UpdateParametersRequest = (function() { + + /** + * Properties of an UpdateParametersRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface IUpdateParametersRequest + * @property {string|null} [name] UpdateParametersRequest name + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateParametersRequest updateMask + * @property {google.cloud.memcache.v1beta2.IMemcacheParameters|null} [parameters] UpdateParametersRequest parameters + */ + + /** + * Constructs a new UpdateParametersRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents an UpdateParametersRequest. + * @implements IUpdateParametersRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.IUpdateParametersRequest=} [properties] Properties to set + */ + function UpdateParametersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateParametersRequest name. + * @member {string} name + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @instance + */ + UpdateParametersRequest.prototype.name = ""; + + /** + * UpdateParametersRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @instance + */ + UpdateParametersRequest.prototype.updateMask = null; + + /** + * UpdateParametersRequest parameters. + * @member {google.cloud.memcache.v1beta2.IMemcacheParameters|null|undefined} parameters + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @instance + */ + UpdateParametersRequest.prototype.parameters = null; + + /** + * Creates a new UpdateParametersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1beta2.IUpdateParametersRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.UpdateParametersRequest} UpdateParametersRequest instance + */ + UpdateParametersRequest.create = function create(properties) { + return new UpdateParametersRequest(properties); + }; + + /** + * Encodes the specified UpdateParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.UpdateParametersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1beta2.IUpdateParametersRequest} message UpdateParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateParametersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parameters != null && message.hasOwnProperty("parameters")) + $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.UpdateParametersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1beta2.IUpdateParametersRequest} message UpdateParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateParametersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateParametersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.UpdateParametersRequest} UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateParametersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.UpdateParametersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateParametersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.UpdateParametersRequest} UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateParametersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateParametersRequest message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateParametersRequest.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.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.memcache.v1beta2.MemcacheParameters.verify(message.parameters); + if (error) + return "parameters." + error; + } + return null; + }; + + /** + * Creates an UpdateParametersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.UpdateParametersRequest} UpdateParametersRequest + */ + UpdateParametersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.UpdateParametersRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.UpdateParametersRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.UpdateParametersRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.UpdateParametersRequest.parameters: object expected"); + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.fromObject(object.parameters); + } + return message; + }; + + /** + * Creates a plain object from an UpdateParametersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1beta2.UpdateParametersRequest} message UpdateParametersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateParametersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.updateMask = null; + object.parameters = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.toObject(message.parameters, options); + return object; + }; + + /** + * Converts this UpdateParametersRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateParametersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateParametersRequest; + })(); + + v1beta2.MemcacheParameters = (function() { + + /** + * Properties of a MemcacheParameters. + * @memberof google.cloud.memcache.v1beta2 + * @interface IMemcacheParameters + * @property {string|null} [id] MemcacheParameters id + * @property {Object.|null} [params] MemcacheParameters params + */ + + /** + * Constructs a new MemcacheParameters. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a MemcacheParameters. + * @implements IMemcacheParameters + * @constructor + * @param {google.cloud.memcache.v1beta2.IMemcacheParameters=} [properties] Properties to set + */ + function MemcacheParameters(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MemcacheParameters id. + * @member {string} id + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @instance + */ + MemcacheParameters.prototype.id = ""; + + /** + * MemcacheParameters params. + * @member {Object.} params + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @instance + */ + MemcacheParameters.prototype.params = $util.emptyObject; + + /** + * Creates a new MemcacheParameters instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1beta2.IMemcacheParameters=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.MemcacheParameters} MemcacheParameters instance + */ + MemcacheParameters.create = function create(properties) { + return new MemcacheParameters(properties); + }; + + /** + * Encodes the specified MemcacheParameters message. Does not implicitly {@link google.cloud.memcache.v1beta2.MemcacheParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1beta2.IMemcacheParameters} message MemcacheParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MemcacheParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && message.hasOwnProperty("id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.params != null && message.hasOwnProperty("params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified MemcacheParameters message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.MemcacheParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1beta2.IMemcacheParameters} message MemcacheParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MemcacheParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MemcacheParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.MemcacheParameters} MemcacheParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MemcacheParameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.MemcacheParameters(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 3: + reader.skip().pos++; + if (message.params === $util.emptyObject) + message.params = {}; + key = reader.string(); + reader.pos++; + message.params[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MemcacheParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.MemcacheParameters} MemcacheParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MemcacheParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MemcacheParameters message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MemcacheParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a MemcacheParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.MemcacheParameters} MemcacheParameters + */ + MemcacheParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.MemcacheParameters) + return object; + var message = new $root.google.cloud.memcache.v1beta2.MemcacheParameters(); + if (object.id != null) + message.id = String(object.id); + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.MemcacheParameters.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a MemcacheParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1beta2.MemcacheParameters} message MemcacheParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MemcacheParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this MemcacheParameters to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @instance + * @returns {Object.} JSON object + */ + MemcacheParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MemcacheParameters; + })(); + + v1beta2.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.memcache.v1beta2 + * @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.memcache.v1beta2 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusDetail. + * @member {string} statusDetail + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusDetail = ""; + + /** + * OperationMetadata cancelRequested. + * @member {boolean} cancelRequested + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.cancelRequested = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @static + * @param {google.cloud.memcache.v1beta2.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.memcache.v1beta2.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @static + * @param {google.cloud.memcache.v1beta2.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 && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && message.hasOwnProperty("target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && message.hasOwnProperty("verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusDetail != null && message.hasOwnProperty("statusDetail")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusDetail); + if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.cancelRequested); + if (message.apiVersion != null && message.hasOwnProperty("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.memcache.v1beta2.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @static + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.OperationMetadata) + return object; + var message = new $root.google.cloud.memcache.v1beta2.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.OperationMetadata + * @static + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OperationMetadata; + })(); + + /** + * MemcacheVersion enum. + * @name google.cloud.memcache.v1beta2.MemcacheVersion + * @enum {string} + * @property {number} MEMCACHE_VERSION_UNSPECIFIED=0 MEMCACHE_VERSION_UNSPECIFIED value + * @property {number} MEMCACHE_1_5=1 MEMCACHE_1_5 value + */ + v1beta2.MemcacheVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEMCACHE_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "MEMCACHE_1_5"] = 1; + return values; + })(); + + v1beta2.LocationMetadata = (function() { + + /** + * Properties of a LocationMetadata. + * @memberof google.cloud.memcache.v1beta2 + * @interface ILocationMetadata + * @property {Object.|null} [availableZones] LocationMetadata availableZones + */ + + /** + * Constructs a new LocationMetadata. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a LocationMetadata. + * @implements ILocationMetadata + * @constructor + * @param {google.cloud.memcache.v1beta2.ILocationMetadata=} [properties] Properties to set + */ + function LocationMetadata(properties) { + this.availableZones = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationMetadata availableZones. + * @member {Object.} availableZones + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @instance + */ + LocationMetadata.prototype.availableZones = $util.emptyObject; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {google.cloud.memcache.v1beta2.ILocationMetadata=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.LocationMetadata} LocationMetadata instance + */ + LocationMetadata.create = function create(properties) { + return new LocationMetadata(properties); + }; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.memcache.v1beta2.LocationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {google.cloud.memcache.v1beta2.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.availableZones != null && message.hasOwnProperty("availableZones")) + for (var keys = Object.keys(message.availableZones), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.memcache.v1beta2.ZoneMetadata.encode(message.availableZones[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.LocationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {google.cloud.memcache.v1beta2.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.LocationMetadata(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + reader.skip().pos++; + if (message.availableZones === $util.emptyObject) + message.availableZones = {}; + key = reader.string(); + reader.pos++; + message.availableZones[key] = $root.google.cloud.memcache.v1beta2.ZoneMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationMetadata message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.availableZones != null && message.hasOwnProperty("availableZones")) { + if (!$util.isObject(message.availableZones)) + return "availableZones: object expected"; + var key = Object.keys(message.availableZones); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.memcache.v1beta2.ZoneMetadata.verify(message.availableZones[key[i]]); + if (error) + return "availableZones." + error; + } + } + return null; + }; + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.LocationMetadata} LocationMetadata + */ + LocationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.LocationMetadata) + return object; + var message = new $root.google.cloud.memcache.v1beta2.LocationMetadata(); + if (object.availableZones) { + if (typeof object.availableZones !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.LocationMetadata.availableZones: object expected"); + message.availableZones = {}; + for (var keys = Object.keys(object.availableZones), i = 0; i < keys.length; ++i) { + if (typeof object.availableZones[keys[i]] !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.LocationMetadata.availableZones: object expected"); + message.availableZones[keys[i]] = $root.google.cloud.memcache.v1beta2.ZoneMetadata.fromObject(object.availableZones[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {google.cloud.memcache.v1beta2.LocationMetadata} message LocationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.availableZones = {}; + var keys2; + if (message.availableZones && (keys2 = Object.keys(message.availableZones)).length) { + object.availableZones = {}; + for (var j = 0; j < keys2.length; ++j) + object.availableZones[keys2[j]] = $root.google.cloud.memcache.v1beta2.ZoneMetadata.toObject(message.availableZones[keys2[j]], options); + } + return object; + }; + + /** + * Converts this LocationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @instance + * @returns {Object.} JSON object + */ + LocationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LocationMetadata; + })(); + + v1beta2.ZoneMetadata = (function() { + + /** + * Properties of a ZoneMetadata. + * @memberof google.cloud.memcache.v1beta2 + * @interface IZoneMetadata + */ + + /** + * Constructs a new ZoneMetadata. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a ZoneMetadata. + * @implements IZoneMetadata + * @constructor + * @param {google.cloud.memcache.v1beta2.IZoneMetadata=} [properties] Properties to set + */ + function ZoneMetadata(properties) { + if (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 ZoneMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {google.cloud.memcache.v1beta2.IZoneMetadata=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.ZoneMetadata} ZoneMetadata instance + */ + ZoneMetadata.create = function create(properties) { + return new ZoneMetadata(properties); + }; + + /** + * Encodes the specified ZoneMetadata message. Does not implicitly {@link google.cloud.memcache.v1beta2.ZoneMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {google.cloud.memcache.v1beta2.IZoneMetadata} message ZoneMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZoneMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ZoneMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ZoneMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {google.cloud.memcache.v1beta2.IZoneMetadata} message ZoneMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZoneMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.ZoneMetadata} ZoneMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZoneMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.ZoneMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.ZoneMetadata} ZoneMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZoneMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZoneMetadata message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ZoneMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ZoneMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.ZoneMetadata} ZoneMetadata + */ + ZoneMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.ZoneMetadata) + return object; + return new $root.google.cloud.memcache.v1beta2.ZoneMetadata(); + }; + + /** + * Creates a plain object from a ZoneMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {google.cloud.memcache.v1beta2.ZoneMetadata} message ZoneMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZoneMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ZoneMetadata to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @instance + * @returns {Object.} JSON object + */ + ZoneMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ZoneMetadata; + })(); + + return v1beta2; + })(); + + return memcache; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("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} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = ""; + + /** + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = ""; + + /** + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = ""; + + /** + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = ""; + + /** + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = ""; + + /** + * 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 && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CustomHttpPattern; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {string} + * @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 + */ + 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; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + */ + + /** + * 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 = []; + if (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 = ""; + + /** + * 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 && message.hasOwnProperty("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 && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + 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; + 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"; + 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); + 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 = []; + 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; + 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 {string} + * @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; + })(); + + 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 && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && message.hasOwnProperty("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 && message.hasOwnProperty("options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && message.hasOwnProperty("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 && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("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 + */ + + /** + * 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; + + /** + * 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && message.hasOwnProperty("extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && message.hasOwnProperty("label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && message.hasOwnProperty("typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + 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; + 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; + } + 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); + } + 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 = ""; + } + 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; + 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 {string} + * @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 {string} + * @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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && message.hasOwnProperty("inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && message.hasOwnProperty("outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && message.hasOwnProperty("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 = false; + + /** + * 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 && message.hasOwnProperty("javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && message.hasOwnProperty("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 = false; + 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 {string} + * @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 && message.hasOwnProperty("messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && message.hasOwnProperty("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 && message.hasOwnProperty(".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 && message.hasOwnProperty("ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && message.hasOwnProperty("packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && message.hasOwnProperty("lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && message.hasOwnProperty("jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && message.hasOwnProperty("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 && message.hasOwnProperty(".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: + 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; + } + } + 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 {string} + * @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 {string} + * @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 && message.hasOwnProperty("allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty(".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".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 && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && message.hasOwnProperty("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 && message.hasOwnProperty(".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 && message.hasOwnProperty(".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 {string} + * @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 && message.hasOwnProperty("identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && message.hasOwnProperty("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 && message.hasOwnProperty("leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && message.hasOwnProperty("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 && message.hasOwnProperty("sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && message.hasOwnProperty("begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && message.hasOwnProperty("type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && message.hasOwnProperty("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 && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Duration; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FieldMask; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations#listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && message.hasOwnProperty("metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && message.hasOwnProperty("done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && message.hasOwnProperty("error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && message.hasOwnProperty("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 && message.hasOwnProperty("responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && message.hasOwnProperty("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 && message.hasOwnProperty("code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && message.hasOwnProperty("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-memcache/protos/protos.json b/packages/google-cloud-memcache/protos/protos.json new file mode 100644 index 00000000000..094db45346e --- /dev/null +++ b/packages/google-cloud-memcache/protos/protos.json @@ -0,0 +1,1867 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "memcache": { + "nested": { + "v1beta2": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/memcache/v1beta2;memcache", + "java_multiple_files": true, + "java_outer_classname": "CloudMemcacheProto", + "java_package": "com.google.cloud.memcache.v1beta2" + }, + "nested": { + "CloudMemcache": { + "options": { + "(google.api.default_host)": "memcache.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v1beta2/{parent=projects/*/locations/*}/instances", + "(google.api.method_signature)": "parent" + } + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1beta2/{name=projects/*/locations/*/instances/*}", + "(google.api.method_signature)": "name" + } + }, + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta2/{parent=projects/*/locations/*}/instances", + "(google.api.http).body": "resource", + "(google.api.method_signature)": "parent,instance_id,resource", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1beta2.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + }, + "UpdateInstance": { + "requestType": "UpdateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta2/{resource.name=projects/*/locations/*/instances/*}", + "(google.api.http).body": "resource", + "(google.api.method_signature)": "update_mask,resource", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1beta2.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + }, + "UpdateParameters": { + "requestType": "UpdateParametersRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta2/{name=projects/*/locations/*/instances/*}:updateParameters", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,update_mask,parameters", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1beta2.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta2/{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.memcache.v1beta2.OperationMetadata" + } + }, + "ApplyParameters": { + "requestType": "ApplyParametersRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta2/{name=projects/*/locations/*/instances/*}:applyParameters", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,node_ids,apply_all", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1beta2.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "memcache.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "authorizedNetwork": { + "type": "string", + "id": 4 + }, + "zones": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "nodeCount": { + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeConfig": { + "type": "NodeConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "memcacheVersion": { + "type": "MemcacheVersion", + "id": 9 + }, + "parameters": { + "type": "MemcacheParameters", + "id": 11 + }, + "memcacheNodes": { + "rule": "repeated", + "type": "Node", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "memcacheFullVersion": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceMessages": { + "rule": "repeated", + "type": "InstanceMessage", + "id": 19 + }, + "discoveryEndpoint": { + "type": "string", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "NodeConfig": { + "fields": { + "cpuCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "memorySizeMb": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Node": { + "fields": { + "nodeId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "zone": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "host": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "port": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "parameters": { + "type": "MemcacheParameters", + "id": 6 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "DELETING": 3, + "UPDATING": 4 + } + } + } + }, + "InstanceMessage": { + "fields": { + "code": { + "type": "Code", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Code": { + "values": { + "CODE_UNSPECIFIED": 0, + "ZONE_DISTRIBUTION_UNBALANCED": 1 + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "DELETING": 4, + "PERFORMING_MAINTENANCE": 5 + } + } + } + }, + "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 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListInstancesResponse": { + "fields": { + "resources": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + } + } + }, + "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" + } + }, + "resource": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateInstanceRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "Instance", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ApplyParametersRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + }, + "nodeIds": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "applyAll": { + "type": "bool", + "id": 3 + } + } + }, + "UpdateParametersRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parameters": { + "type": "MemcacheParameters", + "id": 3 + } + } + }, + "MemcacheParameters": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "params": { + "keyType": "string", + "type": "string", + "id": 3 + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "target": { + "type": "string", + "id": 3 + }, + "verb": { + "type": "string", + "id": 4 + }, + "statusDetail": { + "type": "string", + "id": 5 + }, + "cancelRequested": { + "type": "bool", + "id": 6 + }, + "apiVersion": { + "type": "string", + "id": 7 + } + } + }, + "MemcacheVersion": { + "values": { + "MEMCACHE_VERSION_UNSPECIFIED": 0, + "MEMCACHE_1_5": 1 + } + }, + "LocationMetadata": { + "fields": { + "availableZones": { + "keyType": "string", + "type": "ZoneMetadata", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ZoneMetadata": { + "fields": {} + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5 + } + }, + "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 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "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 + } + }, + "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": false + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}" + } + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}" + } + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}" + } + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*" + } + }, + "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": { + "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-memcache/samples/README.md b/packages/google-cloud-memcache/samples/README.md new file mode 100644 index 00000000000..c45d3fe4faf --- /dev/null +++ b/packages/google-cloud-memcache/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 + +# [Memorystore for Memcached: Node.js Samples](https://github.com/googleapis/nodejs-memcache) + +[![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-memcache#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-memcache/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-memcache&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-memcache&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/memorystore/docs/memcached diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json new file mode 100644 index 00000000000..4086bd76577 --- /dev/null +++ b/packages/google-cloud-memcache/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-memcache-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=8" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/memcache": "^0.1.0" + }, + "devDependencies": { + "c8": "^7.0.0", + "chai": "^4.2.0", + "mocha": "^7.0.0" + } +} diff --git a/packages/google-cloud-memcache/samples/quickstart.js b/packages/google-cloud-memcache/samples/quickstart.js new file mode 100644 index 00000000000..7f01ca4e961 --- /dev/null +++ b/packages/google-cloud-memcache/samples/quickstart.js @@ -0,0 +1,31 @@ +// 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. +// + +'use strict'; + +async function quickstart() { + // [START memcache_quickstart] + // Imports the Google Cloud client library + const {CloudMemcacheClient} = require('@google-cloud/memcache'); + + // Creates a client + const cmc = new CloudMemcacheClient(); + console.info(cmc); + // project = 'my-project' + // [END memcache_quickstart] +} + +const args = process.argv.slice(2); +quickstart(...args).catch(console.error); diff --git a/packages/google-cloud-memcache/samples/test/quickstart.js b/packages/google-cloud-memcache/samples/test/quickstart.js new file mode 100644 index 00000000000..79f96109e2a --- /dev/null +++ b/packages/google-cloud-memcache/samples/test/quickstart.js @@ -0,0 +1,38 @@ +// 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. +// + +'use strict'; + +const path = require('path'); +// const {assert} = require('chai'); +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_ID = process.env.GCLOUD_PROJECT; + +describe('Sample Integration Tests', () => { + it('should run quickstart.js', async () => { + const stdout = execSync(`node ./quickstart.js ${PROJECT_ID}`, { + cwd, + }); + // build should have exited with success status. + // assert.include(stdout, '...'); + console.info(stdout); + }); +}); diff --git a/packages/google-cloud-memcache/src/index.ts b/packages/google-cloud-memcache/src/index.ts new file mode 100644 index 00000000000..3e4d6b8fca0 --- /dev/null +++ b/packages/google-cloud-memcache/src/index.ts @@ -0,0 +1,24 @@ +// 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 gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta2 from './v1beta2'; +const CloudMemcacheClient = v1beta2.CloudMemcacheClient; +export {v1beta2, CloudMemcacheClient}; +export default {v1beta2, CloudMemcacheClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts new file mode 100644 index 00000000000..412d7b7477a --- /dev/null +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -0,0 +1,1355 @@ +// 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 gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import * as gapicConfig from './cloud_memcache_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Configures and manages Cloud Memorystore for Memcached instances. + * + * + * The `memcache.googleapis.com` service implements the Google Cloud Memorystore + * for Memcached API and defines the following resource model for managing + * Memorystore Memcached (also called Memcached below) 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 Memcached instances, named: + * `/instances/*` + * * As such, Memcached instances are resources of the form: + * `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * + * Note that location_id must be refering to a GCP `region`; for example: + * * `projects/my-memcached-project/locations/us-central1/instances/my-memcached` + * @class + * @memberof v1beta2 + */ +export class CloudMemcacheClient { + private _terminated = false; + private _opts: ClientOptions; + 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: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + cloudMemcacheStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CloudMemcacheClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof CloudMemcacheClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof CloudMemcacheClient).scopes; + 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; + + // 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}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + 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', + 'resources' + ), + }; + + // 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 protoFilesRoot = opts.fallback + ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); + + 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.memcache.v1beta2.Instance' + ) as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.OperationMetadata' + ) as gax.protobuf.Type; + const updateInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.Instance' + ) as gax.protobuf.Type; + const updateInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.OperationMetadata' + ) as gax.protobuf.Type; + const updateParametersResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.Instance' + ) as gax.protobuf.Type; + const updateParametersMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.OperationMetadata' + ) as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.OperationMetadata' + ) as gax.protobuf.Type; + const applyParametersResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.Instance' + ) as gax.protobuf.Type; + const applyParametersMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.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) + ), + updateParameters: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateParametersResponse.decode.bind(updateParametersResponse), + updateParametersMetadata.decode.bind(updateParametersMetadata) + ), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata) + ), + applyParameters: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + applyParametersResponse.decode.bind(applyParametersResponse), + applyParametersMetadata.decode.bind(applyParametersMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.memcache.v1beta2.CloudMemcache', + 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 = {}; + } + + /** + * 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.cloudMemcacheStub) { + return this.cloudMemcacheStub; + } + + // Put together the "service stub" for + // google.cloud.memcache.v1beta2.CloudMemcache. + this.cloudMemcacheStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.memcache.v1beta2.CloudMemcache' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.memcache.v1beta2.CloudMemcache, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const cloudMemcacheStubMethods = [ + 'listInstances', + 'getInstance', + 'createInstance', + 'updateInstance', + 'updateParameters', + 'deleteInstance', + 'applyParameters', + ]; + for (const methodName of cloudMemcacheStubMethods) { + const callPromise = this.cloudMemcacheStub.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 apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.cloudMemcacheStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'memcache.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'memcache.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + 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. + * @param {function(Error, string)} callback - the callback to + * be called with the current 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.memcache.v1beta2.IGetInstanceRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IGetInstanceRequest | undefined, + {} | undefined + ] + >; + getInstance( + request: protos.google.cloud.memcache.v1beta2.IGetInstanceRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.memcache.v1beta2.IInstance, + | protos.google.cloud.memcache.v1beta2.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstance( + request: protos.google.cloud.memcache.v1beta2.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.memcache.v1beta2.IInstance, + | protos.google.cloud.memcache.v1beta2.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets details of a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.memcache.v1beta2.Instance}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getInstance( + request: protos.google.cloud.memcache.v1beta2.IGetInstanceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.memcache.v1beta2.IInstance, + | protos.google.cloud.memcache.v1beta2.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.memcache.v1beta2.IInstance, + | protos.google.cloud.memcache.v1beta2.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IGetInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getInstance(request, options, callback); + } + + createInstance( + request: protos.google.cloud.memcache.v1beta2.ICreateInstanceRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createInstance( + request: protos.google.cloud.memcache.v1beta2.ICreateInstanceRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInstance( + request: protos.google.cloud.memcache.v1beta2.ICreateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new Instance in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {string} request.instanceId + * Required. The logical name of the Memcached instance in the user + * project with the following restrictions: + * + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-40 characters. + * * Must end with a number or a letter. + * * Must be unique within the user project / location + * @param {google.cloud.memcache.v1beta2.Instance} request.resource + * Required. A Memcached [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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createInstance( + request: protos.google.cloud.memcache.v1beta2.ICreateInstanceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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); + } + updateInstance( + request: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateInstance( + request: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateInstance( + request: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates an existing Instance in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * * `displayName` + * @param {google.cloud.memcache.v1beta2.Instance} request.resource + * Required. A Memcached [Instance] resource. + * 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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateInstance( + request: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'resource.name': request.resource!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateInstance(request, options, callback); + } + updateParameters( + request: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateParameters( + request: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateParameters( + request: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the defined Memcached Parameters for an existing Instance. + * This method only stages the parameters, it must be followed by + * ApplyParameters to apply the parameters to nodes of the Memcached Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the Memcached instance for which the parameters should be + * updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * @param {google.cloud.memcache.v1beta2.MemcacheParameters} request.parameters + * The parameters to apply to the instance. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateParameters( + request: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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.updateParameters(request, options, callback); + } + deleteInstance( + request: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteInstance( + request: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteInstance( + request: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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); + } + applyParameters( + request: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + applyParameters( + request: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + applyParameters( + request: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * ApplyParameters will update current set of Parameters to the set of + * specified nodes of the Memcached Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the Memcached instance for which parameter group updates + * should be applied. + * @param {string[]} request.nodeIds + * Nodes to which we should apply the instance-level parameter group. + * @param {boolean} request.applyAll + * Whether to apply instance-level parameter group to all nodes. If set to + * true, will explicitly restrict users from specifying any nodes, and apply + * parameter group updates to all nodes within the instance. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + applyParameters( + request: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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.applyParameters(request, options, callback); + } + listInstances( + request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.memcache.v1beta2.IInstance[], + protos.google.cloud.memcache.v1beta2.IListInstancesRequest | null, + protos.google.cloud.memcache.v1beta2.IListInstancesResponse + ] + >; + listInstances( + request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + | protos.google.cloud.memcache.v1beta2.IListInstancesResponse + | null + | undefined, + protos.google.cloud.memcache.v1beta2.IInstance + > + ): void; + listInstances( + request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + | protos.google.cloud.memcache.v1beta2.IListInstancesResponse + | null + | undefined, + protos.google.cloud.memcache.v1beta2.IInstance + > + ): void; + /** + * Lists Instances in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {number} request.pageSize + * The maximum number of items to return. + * + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * {@link CloudMemcache.ListInstancesResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, + * if any. + * @param {string} request.filter + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying "name != my-instance". + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Instance]{@link google.cloud.memcache.v1beta2.Instance}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Instance]{@link google.cloud.memcache.v1beta2.Instance} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListInstancesRequest]{@link google.cloud.memcache.v1beta2.ListInstancesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListInstancesResponse]{@link google.cloud.memcache.v1beta2.ListInstancesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listInstances( + request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< + protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + | protos.google.cloud.memcache.v1beta2.IListInstancesResponse + | null + | undefined, + protos.google.cloud.memcache.v1beta2.IInstance + >, + callback?: PaginationCallback< + protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + | protos.google.cloud.memcache.v1beta2.IListInstancesResponse + | null + | undefined, + protos.google.cloud.memcache.v1beta2.IInstance + > + ): Promise< + [ + protos.google.cloud.memcache.v1beta2.IInstance[], + protos.google.cloud.memcache.v1beta2.IListInstancesRequest | null, + protos.google.cloud.memcache.v1beta2.IListInstancesResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 {@link listInstances}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listInstances} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {number} request.pageSize + * The maximum number of items to return. + * + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * {@link CloudMemcache.ListInstancesResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, + * if any. + * @param {string} request.filter + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying "name != my-instance". + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Instance]{@link google.cloud.memcache.v1beta2.Instance} on 'data' event. + */ + listInstancesStream( + request?: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + options?: gax.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 {@link listInstances}, but 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.parent + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {number} request.pageSize + * The maximum number of items to return. + * + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * {@link CloudMemcache.ListInstancesResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, + * if any. + * @param {string} request.filter + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying "name != my-instance". + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listInstancesAsync( + request?: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + options?: gax.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; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project: string, location: string, instance: string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified 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. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.cloudMemcacheStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client_config.json b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client_config.json new file mode 100644 index 00000000000..318b8dab0e0 --- /dev/null +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client_config.json @@ -0,0 +1,61 @@ +{ + "interfaces": { + "google.cloud.memcache.v1beta2.CloudMemcache": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListInstances": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInstance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateParameters": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ApplyParameters": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_proto_list.json b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_proto_list.json new file mode 100644 index 00000000000..f37919f31b7 --- /dev/null +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/memcache/v1beta2/cloud_memcache.proto" +] diff --git a/packages/google-cloud-memcache/src/v1beta2/index.ts b/packages/google-cloud-memcache/src/v1beta2/index.ts new file mode 100644 index 00000000000..e5270cf8d53 --- /dev/null +++ b/packages/google-cloud-memcache/src/v1beta2/index.ts @@ -0,0 +1,19 @@ +// 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 gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {CloudMemcacheClient} from './cloud_memcache_client'; diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata new file mode 100644 index 00000000000..2323347b38b --- /dev/null +++ b/packages/google-cloud-memcache/synth.metadata @@ -0,0 +1,24 @@ +{ + "updateTime": "2020-04-03T01:16:12.318274Z", + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "3d5d228a58bdf875e6147b228db3159010c735ee", + "internalRef": "304500143" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "memcache", + "apiVersion": "v1beta2", + "language": "typescript", + "generator": "gapic-generator-typescript" + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-memcache/synth.py b/packages/google-cloud-memcache/synth.py index ea45075171e..9edad64ef57 100644 --- a/packages/google-cloud-memcache/synth.py +++ b/packages/google-cloud-memcache/synth.py @@ -34,7 +34,7 @@ extra_proto_files=['google/cloud/common_resources.proto'], proto_path=f'/google/cloud/{name}/{version}', version=version) -s.copy(library, excludes=['README.md']) +s.copy(library, excludes=['package.json', 'README.md']) # Copy common templates common_templates = gcp.CommonTemplates() diff --git a/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.js b/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..961aabfe1b2 --- /dev/null +++ b/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// 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 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 memcache = require('@google-cloud/memcache'); + +function main() { + const cloudMemcacheClient = new memcache.CloudMemcacheClient(); +} + +main(); diff --git a/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..acc2234db08 --- /dev/null +++ b/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,25 @@ +// 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 gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {CloudMemcacheClient} from '@google-cloud/memcache'; + +function main() { + new CloudMemcacheClient(); +} + +main(); diff --git a/packages/google-cloud-memcache/system-test/install.ts b/packages/google-cloud-memcache/system-test/install.ts new file mode 100644 index 00000000000..4c1ba3eb79a --- /dev/null +++ b/packages/google-cloud-memcache/system-test/install.ts @@ -0,0 +1,51 @@ +// 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 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('typescript consumer tests', () => { + it('should have correct type signature for typescript users', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); + + it('should have correct type signature for javascript users', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); +}); diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts new file mode 100644 index 00000000000..c555f79f410 --- /dev/null +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts @@ -0,0 +1,1576 @@ +// 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 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 cloudmemcacheModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation} 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('v1beta2.CloudMemcacheClient', () => { + it('has servicePath', () => { + const servicePath = + cloudmemcacheModule.v1beta2.CloudMemcacheClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + cloudmemcacheModule.v1beta2.CloudMemcacheClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = cloudmemcacheModule.v1beta2.CloudMemcacheClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudMemcacheStub, undefined); + await client.initialize(); + assert(client.cloudMemcacheStub); + }); + + it('has close method', () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 + ); + assert.rejects(async () => { + await client.getInstance(request); + }, expectedError); + assert( + (client.innerApiCalls.getInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 + ); + assert.rejects(async () => { + await 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.createInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() + ); + request.resource = {}; + request.resource.name = ''; + const expectedHeaderRequestParams = 'resource.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() + ); + request.resource = {}; + request.resource.name = ''; + const expectedHeaderRequestParams = 'resource.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.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() + ); + request.resource = {}; + request.resource.name = ''; + const expectedHeaderRequestParams = 'resource.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() + ); + request.resource = {}; + request.resource.name = ''; + const expectedHeaderRequestParams = 'resource.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); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateParameters', () => { + it('invokes updateParameters without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateParameters = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.updateParameters(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateParameters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateParameters without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateParameters = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateParameters( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateParameters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateParameters with call error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateParameters = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateParameters(request); + }, expectedError); + assert( + (client.innerApiCalls.updateParameters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateParameters with LRO error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateParameters = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateParameters(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.updateParameters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 + ); + assert.rejects(async () => { + await 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('applyParameters', () => { + it('invokes applyParameters without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.applyParameters = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.applyParameters(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.applyParameters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes applyParameters without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.applyParameters = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.applyParameters( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.applyParameters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes applyParameters with call error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.applyParameters = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.applyParameters(request); + }, expectedError); + assert( + (client.innerApiCalls.applyParameters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes applyParameters with LRO error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.applyParameters = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.applyParameters(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.applyParameters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + ]; + client.innerApiCalls.listInstances = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 + ); + assert.rejects(async () => { + await 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + ]; + client.descriptors.page.listInstances.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.memcache.v1beta2.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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.memcache.v1beta2.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.memcache.v1beta2.Instance) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + ]; + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listInstancesAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.memcache.v1beta2.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInstances + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listInstances + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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-memcache/tsconfig.json b/packages/google-cloud-memcache/tsconfig.json new file mode 100644 index 00000000000..613d35597b5 --- /dev/null +++ b/packages/google-cloud-memcache/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2016", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-memcache/webpack.config.js b/packages/google-cloud-memcache/webpack.config.js new file mode 100644 index 00000000000..081ae54092e --- /dev/null +++ b/packages/google-cloud-memcache/webpack.config.js @@ -0,0 +1,64 @@ +// 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. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'CloudMemcache', + filename: './cloud-memcache.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 afd9caeb630903aa0f36cedd256e2c72289b47a8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2020 11:06:16 -0700 Subject: [PATCH 003/152] chore: release 1.0.0 (#6) --- packages/google-cloud-memcache/CHANGELOG.md | 12 ++++++++++++ packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-memcache/CHANGELOG.md diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md new file mode 100644 index 00000000000..1187950d3f0 --- /dev/null +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog + +## 1.0.0 (2020-04-03) + + +### ⚠ BREAKING CHANGES + +* initial generation of library (#3) + +### Features + +* initial generation of library ([#3](https://www.github.com/googleapis/nodejs-memcache/issues/3)) ([a94f499](https://www.github.com/googleapis/nodejs-memcache/commit/a94f499651bc3f56032261c51a030c893c71d7c3)) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 72a3f0513ad..274f558aad9 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "0.1.0", + "version": "1.0.0", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index 4086bd76577..e7948f57517 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^0.1.0" + "@google-cloud/memcache": "^1.0.0" }, "devDependencies": { "c8": "^7.0.0", From d412056efca8f9228125660b12169262555fbe3d Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sun, 5 Apr 2020 12:49:41 -0700 Subject: [PATCH 004/152] chore: remove duplicate mocha config (#9) --- packages/google-cloud-memcache/.mocharc.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 packages/google-cloud-memcache/.mocharc.json diff --git a/packages/google-cloud-memcache/.mocharc.json b/packages/google-cloud-memcache/.mocharc.json deleted file mode 100644 index 670c5e2c24b..00000000000 --- a/packages/google-cloud-memcache/.mocharc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} From af24088891fa9b1f4b378b774e25523f1a83dba4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 7 Apr 2020 08:43:18 +0200 Subject: [PATCH 005/152] chore(deps): update dependency mocha to v7 (#7) --- packages/google-cloud-memcache/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 274f558aad9..e1ea684d277 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -29,7 +29,7 @@ "google-gax": "^2.0.2" }, "devDependencies": { - "@types/mocha": "^5.2.7", + "@types/mocha": "^7.0.0", "@types/node": "^12.12.34", "@types/sinon": "^9.0.0", "c8": "^7.1.0", @@ -38,7 +38,7 @@ "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.0.4", - "mocha": "^6.2.3", + "mocha": "^7.0.0", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", From 378bcb5ffe471f1e1d30eba4a5743048dad172dc Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 6 Apr 2020 23:54:06 -0700 Subject: [PATCH 006/152] test: await assert.rejects (#8) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2020-04-04 04:24:12,054 synthtool > Executing /tmpfs/src/git/autosynth/working_repo/synth.py. 2020-04-04 04:24:12,108 synthtool > Ensuring dependencies. 2020-04-04 04:24:12,112 synthtool > Cloning googleapis. 2020-04-04 04:24:12,792 synthtool > Pulling Docker image: gapic-generator-typescript:latest latest: Pulling from gapic-images/gapic-generator-typescript Digest: sha256:f25d30a37a42848b016827018da524260cd343f29161482e9a5a8f4de349b5c7 Status: Image is up to date for gcr.io/gapic-images/gapic-generator-typescript:latest 2020-04-04 04:24:13,672 synthtool > Generating code for: google/cloud/memcache/v1beta2. 2020-04-04 04:24:14,887 synthtool > Generated code into /tmpfs/tmp/tmpzzn5mg0_. .eslintignore .eslintrc.json .github/ISSUE_TEMPLATE/bug_report.md .github/ISSUE_TEMPLATE/feature_request.md .github/ISSUE_TEMPLATE/support_request.md .github/PULL_REQUEST_TEMPLATE.md .github/publish.yml .github/release-please.yml .github/workflows/ci.yaml .kokoro/common.cfg .kokoro/continuous/node10/common.cfg .kokoro/continuous/node10/docs.cfg .kokoro/continuous/node10/lint.cfg .kokoro/continuous/node10/samples-test.cfg .kokoro/continuous/node10/system-test.cfg .kokoro/continuous/node10/test.cfg .kokoro/continuous/node12/common.cfg .kokoro/continuous/node12/test.cfg .kokoro/continuous/node8/common.cfg .kokoro/continuous/node8/test.cfg .kokoro/docs.sh .kokoro/lint.sh .kokoro/presubmit/node10/common.cfg .kokoro/presubmit/node10/docs.cfg .kokoro/presubmit/node10/lint.cfg .kokoro/presubmit/node10/samples-test.cfg .kokoro/presubmit/node10/system-test.cfg .kokoro/presubmit/node10/test.cfg .kokoro/presubmit/node12/common.cfg .kokoro/presubmit/node12/test.cfg .kokoro/presubmit/node8/common.cfg .kokoro/presubmit/node8/test.cfg .kokoro/presubmit/windows/common.cfg .kokoro/presubmit/windows/test.cfg .kokoro/publish.sh .kokoro/release/docs.cfg .kokoro/release/docs.sh .kokoro/release/publish.cfg .kokoro/samples-test.sh .kokoro/system-test.sh .kokoro/test.bat .kokoro/test.sh .kokoro/trampoline.sh .mocharc.js .nycrc .prettierignore .prettierrc.js CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE README.md codecov.yaml renovate.json samples/README.md npm WARN npm npm does not support Node.js v12.16.1 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11. npm WARN npm You can find the latest version at https://nodejs.org/ npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated > protobufjs@6.8.9 postinstall /tmpfs/src/git/autosynth/working_repo/node_modules/protobufjs > node scripts/postinstall > @google-cloud/memcache@1.0.0 prepare /tmpfs/src/git/autosynth/working_repo > npm run compile-protos && npm run compile npm WARN npm npm does not support Node.js v12.16.1 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11. npm WARN npm You can find the latest version at https://nodejs.org/ > @google-cloud/memcache@1.0.0 compile-protos /tmpfs/src/git/autosynth/working_repo > compileProtos src installing semver@^5.5.0 installing chalk@^2.4.1 installing uglify-js@^3.3.25 installing espree@^3.5.4 installing escodegen@^1.9.1 npm WARN npm npm does not support Node.js v12.16.1 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11. npm WARN npm You can find the latest version at https://nodejs.org/ > @google-cloud/memcache@1.0.0 compile /tmpfs/src/git/autosynth/working_repo > tsc -p . && cp -r protos build/ npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: abbrev@1.1.1 (node_modules/fsevents/node_modules/abbrev): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/abbrev' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.abbrev.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ansi-regex@2.1.1 (node_modules/fsevents/node_modules/ansi-regex): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/ansi-regex' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.ansi-regex.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: aproba@1.2.0 (node_modules/fsevents/node_modules/aproba): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/aproba' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.aproba.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: balanced-match@1.0.0 (node_modules/fsevents/node_modules/balanced-match): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/balanced-match' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.balanced-match.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: chownr@1.1.4 (node_modules/fsevents/node_modules/chownr): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/chownr' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.chownr.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: code-point-at@1.1.0 (node_modules/fsevents/node_modules/code-point-at): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/code-point-at' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.code-point-at.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: concat-map@0.0.1 (node_modules/fsevents/node_modules/concat-map): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/concat-map' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.concat-map.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: console-control-strings@1.1.0 (node_modules/fsevents/node_modules/console-control-strings): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/console-control-strings' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.console-control-strings.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: core-util-is@1.0.2 (node_modules/fsevents/node_modules/core-util-is): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/core-util-is' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.core-util-is.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: deep-extend@0.6.0 (node_modules/fsevents/node_modules/deep-extend): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/deep-extend' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.deep-extend.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: delegates@1.0.0 (node_modules/fsevents/node_modules/delegates): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/delegates' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.delegates.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: detect-libc@1.0.3 (node_modules/fsevents/node_modules/detect-libc): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/detect-libc' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.detect-libc.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs.realpath@1.0.0 (node_modules/fsevents/node_modules/fs.realpath): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/fs.realpath' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.fs.realpath.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: has-unicode@2.0.1 (node_modules/fsevents/node_modules/has-unicode): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/has-unicode' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.has-unicode.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: inherits@2.0.4 (node_modules/fsevents/node_modules/inherits): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/inherits' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.inherits.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ini@1.3.5 (node_modules/fsevents/node_modules/ini): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/ini' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.ini.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: isarray@1.0.0 (node_modules/fsevents/node_modules/isarray): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/isarray' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.isarray.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: minimist@1.2.5 (node_modules/fsevents/node_modules/minimist): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/minimist' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.minimist.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ms@2.1.2 (node_modules/fsevents/node_modules/ms): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/ms' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.ms.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: npm-normalize-package-bin@1.0.1 (node_modules/fsevents/node_modules/npm-normalize-package-bin): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/npm-normalize-package-bin' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.npm-normalize-package-bin.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: number-is-nan@1.0.1 (node_modules/fsevents/node_modules/number-is-nan): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/number-is-nan' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.number-is-nan.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: object-assign@4.1.1 (node_modules/fsevents/node_modules/object-assign): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/object-assign' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.object-assign.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: os-homedir@1.0.2 (node_modules/fsevents/node_modules/os-homedir): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/os-homedir' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.os-homedir.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: os-tmpdir@1.0.2 (node_modules/fsevents/node_modules/os-tmpdir): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/os-tmpdir' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.os-tmpdir.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: path-is-absolute@1.0.1 (node_modules/fsevents/node_modules/path-is-absolute): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/path-is-absolute' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.path-is-absolute.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: process-nextick-args@2.0.1 (node_modules/fsevents/node_modules/process-nextick-args): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/process-nextick-args' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.process-nextick-args.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: safe-buffer@5.1.2 (node_modules/fsevents/node_modules/safe-buffer): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/safe-buffer' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.safe-buffer.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: safer-buffer@2.1.2 (node_modules/fsevents/node_modules/safer-buffer): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/safer-buffer' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.safer-buffer.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sax@1.2.4 (node_modules/fsevents/node_modules/sax): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/sax' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.sax.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: semver@5.7.1 (node_modules/fsevents/node_modules/semver): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/semver' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.semver.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: set-blocking@2.0.0 (node_modules/fsevents/node_modules/set-blocking): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/set-blocking' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.set-blocking.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: signal-exit@3.0.2 (node_modules/fsevents/node_modules/signal-exit): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/signal-exit' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.signal-exit.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: strip-json-comments@2.0.1 (node_modules/fsevents/node_modules/strip-json-comments): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/strip-json-comments' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.strip-json-comments.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: util-deprecate@1.0.2 (node_modules/fsevents/node_modules/util-deprecate): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/util-deprecate' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.util-deprecate.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: wrappy@1.0.2 (node_modules/fsevents/node_modules/wrappy): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/wrappy' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.wrappy.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: yallist@3.1.1 (node_modules/fsevents/node_modules/yallist): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/yallist' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/fsevents/node_modules/.yallist.DELETE' added 955 packages from 1295 contributors and audited 6817 packages in 31.019s found 0 vulnerabilities npm WARN npm npm does not support Node.js v12.16.1 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11. npm WARN npm You can find the latest version at https://nodejs.org/ > @google-cloud/memcache@1.0.0 fix /tmpfs/src/git/autosynth/working_repo > gts fix /tmpfs/src/git/autosynth/working_repo/samples/quickstart.js 21:41 error "@google-cloud/memcache" is not found node/no-missing-require ✖ 1 problem (1 error, 0 warnings) Error: Command failed with exit code 1: node ./node_modules/eslint/bin/eslint --fix **/*.ts **/*.js **/*.tsx **/*.jsx --no-error-on-unmatched-pattern at makeError (/tmpfs/src/git/autosynth/working_repo/node_modules/execa/lib/error.js:58:11) at handlePromise (/tmpfs/src/git/autosynth/working_repo/node_modules/execa/index.js:114:26) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async run (/tmpfs/src/git/autosynth/working_repo/node_modules/gts/build/src/cli.js:103:17) { shortMessage: 'Command failed with exit code 1: node ./node_modules/eslint/bin/eslint --fix **/*.ts **/*.js **/*.tsx **/*.jsx --no-error-on-unmatched-pattern', command: 'node ./node_modules/eslint/bin/eslint --fix **/*.ts **/*.js **/*.tsx **/*.jsx --no-error-on-unmatched-pattern', exitCode: 1, signal: undefined, signalDescription: undefined, stdout: undefined, stderr: undefined, failed: true, timedOut: false, isCanceled: false, killed: false } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @google-cloud/memcache@1.0.0 fix: `gts fix` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @google-cloud/memcache@1.0.0 fix script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/kbuilder/.npm/_logs/2020-04-04T11_24_53_373Z-debug.log 2020-04-04 04:24:56,791 synthtool > Wrote metadata to synth.metadata. ```
--- packages/google-cloud-memcache/.jsdoc.js | 2 +- .../linkinator.config.json | 4 +-- .../google-cloud-memcache/protos/protos.js | 2 +- packages/google-cloud-memcache/synth.metadata | 14 ++++++++-- .../test/gapic_cloud_memcache_v1beta2.ts | 28 +++++++++---------- 5 files changed, 28 insertions(+), 22 deletions(-) diff --git a/packages/google-cloud-memcache/.jsdoc.js b/packages/google-cloud-memcache/.jsdoc.js index a2556619eda..3aa0e5e8fd4 100644 --- a/packages/google-cloud-memcache/.jsdoc.js +++ b/packages/google-cloud-memcache/.jsdoc.js @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2019 Google, LLC.', + copyright: 'Copyright 2020 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/memcache', diff --git a/packages/google-cloud-memcache/linkinator.config.json b/packages/google-cloud-memcache/linkinator.config.json index 6cd67ccafff..29a223b6db6 100644 --- a/packages/google-cloud-memcache/linkinator.config.json +++ b/packages/google-cloud-memcache/linkinator.config.json @@ -3,9 +3,7 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io", - ".*github.com/googleapis/nodejs-memcache.*", - "https://googleapis.dev.*" + "img.shields.io" ], "silent": true, "concurrency": 10 diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index 72715769110..2926bf774c3 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots._google_cloud_memcache_0_1_0_protos || ($protobuf.roots._google_cloud_memcache_0_1_0_protos = {}); + var $root = $protobuf.roots._google_cloud_memcache_1_0_0_protos || ($protobuf.roots._google_cloud_memcache_1_0_0_protos = {}); $root.google = (function() { diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 2323347b38b..b9cb9d24919 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -1,12 +1,20 @@ { - "updateTime": "2020-04-03T01:16:12.318274Z", + "updateTime": "2020-04-04T11:24:56.790874Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3d5d228a58bdf875e6147b228db3159010c735ee", - "internalRef": "304500143" + "sha": "d6cb4997910eda04c0c66c0f2fd043eeaa0f660d", + "internalRef": "304724866", + "log": "d6cb4997910eda04c0c66c0f2fd043eeaa0f660d\nchore: enable gapic v2 and proto annotation for documentai API.\n\ncommitter @summer-ji-eng\n\nPiperOrigin-RevId: 304724866\n\n490bc556608bfa5b1548c9374b06152fa33d657e\nEnable gapicv2 for devtools/remoteworkers/v1test2\n\nCommitter: @miraleung\nPiperOrigin-RevId: 304718691\n\n9f78ce31a5bd7f4a63e3cf0ddf28221557adb7ed\nEnable gapicv2 for managedidentities/v1beta1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 304718676\n\n6e17d259b8e320bc51aa240cefef05ec753e2b83\ndocs: treat a dummy example URL as a string literal instead of a link\n\nPiperOrigin-RevId: 304716376\n\na8d76f99d3073aaccabdcc122c798a63e812c4fe\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 304702368\n\n65c749bc6a1d240416a0e6979381b67f97aff907\ndocs: fix formatting of some regexes and string literals.\n\nPiperOrigin-RevId: 304701150\n\n9119eefcd2b5ce845a680fa4ec4093ed733498f0\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304698702\n\n62a2a7cc33d3535638d220df238823eefcca930d\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304696461\n\n23848c8f64a5e81a239d6133378468185f1756dc\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304696192\n\n9514fa9e390a4c0715972c5b510cf4c10ad049a1\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 304695334\n\n0f7b1509a9a452808c3d07fe90fedfcea763d7d5\nfix: change config_schema_version to 2.0.0 for containeranalysis v1 gapic config.\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 304672648\n\n3d52f3c126fbfc31f067a7f54737b7f0dfbce163\nDialogflow weekly v2 library update:\n- Change `parent` field's resource_reference to specify child_type instead of type per client library generation requirement;\n- Change Session with its child resource pattern to support both projects/{project}/agent/sessions/{session} and projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session};\n- Fix `method_signature`\n- Regular documentation update\n\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 304635286\n\n4a6a01ce0ead505c245d11a2ce156de34800c58f\ndocs: change a relative URL to an absolute URL to fix broken links.\n\nPiperOrigin-RevId: 304633630\n\n1b969c28a6579265e89cd35e6c2ecacc89970e2d\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304620317\n\n5378173a889f9c7d83e36e52d38a6267190de692\nAdd v1beta2 SubmitJobAsOperation RPC to Dataproc.\n\nPiperOrigin-RevId: 304594381\n\n" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "99820243d348191bc9c634f2b48ddf65096285ed" } } ], diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts index c555f79f410..29fe1857783 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts @@ -331,7 +331,7 @@ describe('v1beta2.CloudMemcacheClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getInstance(request); }, expectedError); assert( @@ -455,7 +455,7 @@ describe('v1beta2.CloudMemcacheClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createInstance(request); }, expectedError); assert( @@ -490,7 +490,7 @@ describe('v1beta2.CloudMemcacheClient', () => { expectedError ); const [operation] = await client.createInstance(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -617,7 +617,7 @@ describe('v1beta2.CloudMemcacheClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateInstance(request); }, expectedError); assert( @@ -653,7 +653,7 @@ describe('v1beta2.CloudMemcacheClient', () => { expectedError ); const [operation] = await client.updateInstance(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -777,7 +777,7 @@ describe('v1beta2.CloudMemcacheClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateParameters(request); }, expectedError); assert( @@ -812,7 +812,7 @@ describe('v1beta2.CloudMemcacheClient', () => { expectedError ); const [operation] = await client.updateParameters(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -936,7 +936,7 @@ describe('v1beta2.CloudMemcacheClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.deleteInstance(request); }, expectedError); assert( @@ -971,7 +971,7 @@ describe('v1beta2.CloudMemcacheClient', () => { expectedError ); const [operation] = await client.deleteInstance(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -1095,7 +1095,7 @@ describe('v1beta2.CloudMemcacheClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.applyParameters(request); }, expectedError); assert( @@ -1130,7 +1130,7 @@ describe('v1beta2.CloudMemcacheClient', () => { expectedError ); const [operation] = await client.applyParameters(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -1260,7 +1260,7 @@ describe('v1beta2.CloudMemcacheClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listInstances(request); }, expectedError); assert( @@ -1359,7 +1359,7 @@ describe('v1beta2.CloudMemcacheClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -1438,7 +1438,7 @@ describe('v1beta2.CloudMemcacheClient', () => { expectedError ); const iterable = client.listInstancesAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.memcache.v1beta2.IInstance[] = []; for await (const resource of iterable) { responses.push(resource!); From d3706a9616af60f9c9d5785d998909eda0ffed41 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Apr 2020 20:57:12 +0200 Subject: [PATCH 007/152] chore(deps): update dependency gts to v2.0.0 (#12) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [gts](https://togithub.com/google/gts) | devDependencies | patch | [`2.0.0-alpha.9` -> `2.0.0`](https://renovatebot.com/diffs/npm/gts/2.0.0-alpha.9/2.0.0) | --- ### Release Notes
google/gts ### [`v2.0.0`](https://togithub.com/google/gts/blob/master/CHANGELOG.md#​200-httpswwwgithubcomgooglegtscomparev112v200-2020-04-02) [Compare Source](https://togithub.com/google/gts/compare/39a2705e51b4b6329a70f91f8293a2d7a363bf5d...v2.0.0) ##### ⚠ BREAKING CHANGES ⚠ This is a major rewrite of the tool. Based on community guidance, we've switched from using [tslint](https://palantir.github.io/tslint/) to [eslint](https://eslint.org/). _Please read all of the steps below to upgrade_. ##### Configuring `eslint` With the shift to `eslint`, `gts` now will format and lint JavaScript _as well_ as TypeScript. Upgrading will require a number of manual steps. To format JavaScript and TypeScript, you can run: $ npx gts fix To specify only TypeScript: $ npx gts fix '**/*.ts' ##### Delete `tslint.json` This file is no longer used, and can lead to confusion. ##### Create a `.eslintrc.json` Now that we're using eslint, you need to extend the eslint configuration baked into the module. Create a new file named `.eslintrc.json`, and paste the following: ```js { "extends": "./node_modules/gts" } ``` ##### Create a `.eslintignore` The `.eslintignore` file lets you ignore specific directories. This tool now lints and formats JavaScript, so it's _really_ important to ignore your build directory! Here is an example of a `.eslintignore` file: **/node_modules build/ ##### Rule changes The underlying linter was changed, so naturally there are going to be a variety of rule changes along the way. To see the full list, check out [.eslintrc.json](https://togithub.com/google/gts/blob/master/.eslintrc.json). ##### Require Node.js 10.x and up Node.js 8.x is now end of life - this module now requires Ndoe.js 10.x and up. ##### Features - add the eol-last rule ([#​425](https://www.github.com/google/gts/issues/425)) ([50ebd4d](https://www.github.com/google/gts/commit/50ebd4dbaf063615f4c025f567ca28076a734223)) - allow eslintrc to run over tsx files ([#​469](https://www.github.com/google/gts/issues/469)) ([a21db94](https://www.github.com/google/gts/commit/a21db94601def563952d677cb0980a12b6730f4c)) - disable global rule for checking TODO comments ([#​459](https://www.github.com/google/gts/issues/459)) ([96aa84a](https://www.github.com/google/gts/commit/96aa84a0a42181046daa248750cc8fef0c320619)) - override require-atomic-updates ([#​468](https://www.github.com/google/gts/issues/468)) ([8105c93](https://www.github.com/google/gts/commit/8105c9334ee5104b05f6b1b2f150e51419637262)) - prefer single quotes if possible ([#​475](https://www.github.com/google/gts/issues/475)) ([39a2705](https://www.github.com/google/gts/commit/39a2705e51b4b6329a70f91f8293a2d7a363bf5d)) - use eslint instead of tslint ([#​400](https://www.github.com/google/gts/issues/400)) ([b3096fb](https://www.github.com/google/gts/commit/b3096fbd5076d302d93c2307bf627e12c423e726)) ##### Bug Fixes - use .prettierrc.js ([#​437](https://www.github.com/google/gts/issues/437)) ([06efa84](https://www.github.com/google/gts/commit/06efa8444cdf1064b64f3e8d61ebd04f45d90b4c)) - **deps:** update dependency chalk to v4 ([#​477](https://www.github.com/google/gts/issues/477)) ([061d64e](https://www.github.com/google/gts/commit/061d64e29d37b93ce55228937cc100e05ddef352)) - **deps:** update dependency eslint-plugin-node to v11 ([#​426](https://www.github.com/google/gts/issues/426)) ([a394b7c](https://www.github.com/google/gts/commit/a394b7c1f80437f25017ca5c500b968ebb789ece)) - **deps:** update dependency execa to v4 ([#​427](https://www.github.com/google/gts/issues/427)) ([f42ef36](https://www.github.com/google/gts/commit/f42ef36709251553342e655e287e889df72ee3e3)) - **deps:** update dependency prettier to v2 ([#​464](https://www.github.com/google/gts/issues/464)) ([20ef43d](https://www.github.com/google/gts/commit/20ef43d566df17d3c93949ef7db3b72ee9123ca3)) - disable no-use-before-define ([#​431](https://www.github.com/google/gts/issues/431)) ([dea2c22](https://www.github.com/google/gts/commit/dea2c223d1d3a60a1786aa820eebb93be27016a7)) - **deps:** update dependency update-notifier to v4 ([#​403](https://www.github.com/google/gts/issues/403)) ([57393b7](https://www.github.com/google/gts/commit/57393b74c6cf299e8ae09311f0382226b8baa3e3)) - **deps:** upgrade to meow 6.x ([#​423](https://www.github.com/google/gts/issues/423)) ([8f93d00](https://www.github.com/google/gts/commit/8f93d0049337a832d9a22b6ae4e86fd41140ec56)) - align back to the google style guide ([#​440](https://www.github.com/google/gts/issues/440)) ([8bd78c4](https://www.github.com/google/gts/commit/8bd78c4c78526a72400f618a95a987d2a7c1a8db)) - disable empty-function check ([#​467](https://www.github.com/google/gts/issues/467)) ([6455d7a](https://www.github.com/google/gts/commit/6455d7a9d227320d3ffe1b00c9c739b846f339a8)) - drop support for node 8 ([#​422](https://www.github.com/google/gts/issues/422)) ([888c686](https://www.github.com/google/gts/commit/888c68692079065f38ce66ec84472f1f3311a050)) - emit .prettierrc.js with init ([#​462](https://www.github.com/google/gts/issues/462)) ([b114614](https://www.github.com/google/gts/commit/b114614d22ab5560d2d1dd5cb6695968cc80027b)) - enable trailing comma ([#​470](https://www.github.com/google/gts/issues/470)) ([6518f58](https://www.github.com/google/gts/commit/6518f5843d3093e3beb7d3371b56d9aecedf3924)) - include _.tsx and _.jsx in default fix command ([#​473](https://www.github.com/google/gts/issues/473)) ([0509780](https://www.github.com/google/gts/commit/050978005ad089d9b3b5d8895b25ea1175d75db2)) ##### [1.1.2](https://www.github.com/google/gts/compare/v1.1.1...v1.1.2) (2019-11-20) ##### Bug Fixes - **deps:** update to newest prettier (with support for optional chain) ([#​396](https://www.github.com/google/gts/issues/396)) ([ce8ad06](https://www.github.com/google/gts/commit/ce8ad06c8489c44a9e2ed5292382637b3ebb7601)) ##### [1.1.1](https://www.github.com/google/gts/compare/v1.1.0...v1.1.1) (2019-11-11) ##### Bug Fixes - **deps:** update dependency chalk to v3 ([#​389](https://www.github.com/google/gts/issues/389)) ([1ce0f45](https://www.github.com/google/gts/commit/1ce0f450677e143a27efc39def617d13c66503e8)) - **deps:** update dependency inquirer to v7 ([#​377](https://www.github.com/google/gts/issues/377)) ([bf2c349](https://www.github.com/google/gts/commit/bf2c349b2208ac63e551542599ac9cd27b461338)) - **deps:** update dependency rimraf to v3 ([#​374](https://www.github.com/google/gts/issues/374)) ([2058eaa](https://www.github.com/google/gts/commit/2058eaa682f4baae978b469fd708d1f866e7da74)) - **deps:** update dependency write-file-atomic to v3 ([#​353](https://www.github.com/google/gts/issues/353)) ([59e6aa8](https://www.github.com/google/gts/commit/59e6aa8580a2f8e9457d2d2b6fa9e18e86347592))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index e1ea684d277..0b3d1642315 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -33,7 +33,7 @@ "@types/node": "^12.12.34", "@types/sinon": "^9.0.0", "c8": "^7.1.0", - "gts": "2.0.0-alpha.9", + "gts": "2.0.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", From 306d3c5cae2f8f61f5d64ff0c7a8377e0abe9994 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 10 Apr 2020 18:48:20 -0700 Subject: [PATCH 008/152] fix: remove eslint, update gax, fix generated protos, run the generator (#13) Run the latest version of the generator, update google-gax, update gts, and remove direct dependencies on eslint. --- packages/google-cloud-memcache/.prettierrc.js | 2 +- packages/google-cloud-memcache/package.json | 8 ++++---- .../google-cloud-memcache/protos/protos.json | 16 ++++++++++++---- packages/google-cloud-memcache/synth.metadata | 14 +++----------- packages/google-cloud-memcache/synth.py | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/google-cloud-memcache/.prettierrc.js b/packages/google-cloud-memcache/.prettierrc.js index 08cba3775be..d1b95106f4c 100644 --- a/packages/google-cloud-memcache/.prettierrc.js +++ b/packages/google-cloud-memcache/.prettierrc.js @@ -4,7 +4,7 @@ // 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, diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 0b3d1642315..0756fefa212 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -18,22 +18,22 @@ "predocs-test": "npm run docs", "docs-test": "linkinator docs", "fix": "gts fix", - "lint": "gts check", - "prelint": "cd samples; npm link ../; npm i", + "lint": "gts fix", + "prelint": "cd samples; npm link ../; npm install", "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.0.2" + "google-gax": "^2.1.0" }, "devDependencies": { "@types/mocha": "^7.0.0", "@types/node": "^12.12.34", "@types/sinon": "^9.0.0", "c8": "^7.1.0", - "gts": "2.0.0", + "gts": "^2.0.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", diff --git a/packages/google-cloud-memcache/protos/protos.json b/packages/google-cloud-memcache/protos/protos.json index 094db45346e..525b6cf1c5d 100644 --- a/packages/google-cloud-memcache/protos/protos.json +++ b/packages/google-cloud-memcache/protos/protos.json @@ -1682,26 +1682,32 @@ "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.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.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.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" } }, "CancelOperation": { @@ -1709,7 +1715,8 @@ "responseType": "google.protobuf.Empty", "options": { "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" } }, "WaitOperation": { @@ -1835,6 +1842,7 @@ }, "rpc": { "options": { + "cc_enable_arenas": true, "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", "java_multiple_files": true, "java_outer_classname": "StatusProto", diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index b9cb9d24919..24eef4926c7 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -1,20 +1,12 @@ { - "updateTime": "2020-04-04T11:24:56.790874Z", + "updateTime": "2020-04-11T00:32:10.640121Z", "sources": [ - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d6cb4997910eda04c0c66c0f2fd043eeaa0f660d", - "internalRef": "304724866", - "log": "d6cb4997910eda04c0c66c0f2fd043eeaa0f660d\nchore: enable gapic v2 and proto annotation for documentai API.\n\ncommitter @summer-ji-eng\n\nPiperOrigin-RevId: 304724866\n\n490bc556608bfa5b1548c9374b06152fa33d657e\nEnable gapicv2 for devtools/remoteworkers/v1test2\n\nCommitter: @miraleung\nPiperOrigin-RevId: 304718691\n\n9f78ce31a5bd7f4a63e3cf0ddf28221557adb7ed\nEnable gapicv2 for managedidentities/v1beta1\n\nCommitter: @miraleung\nPiperOrigin-RevId: 304718676\n\n6e17d259b8e320bc51aa240cefef05ec753e2b83\ndocs: treat a dummy example URL as a string literal instead of a link\n\nPiperOrigin-RevId: 304716376\n\na8d76f99d3073aaccabdcc122c798a63e812c4fe\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 304702368\n\n65c749bc6a1d240416a0e6979381b67f97aff907\ndocs: fix formatting of some regexes and string literals.\n\nPiperOrigin-RevId: 304701150\n\n9119eefcd2b5ce845a680fa4ec4093ed733498f0\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304698702\n\n62a2a7cc33d3535638d220df238823eefcca930d\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304696461\n\n23848c8f64a5e81a239d6133378468185f1756dc\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304696192\n\n9514fa9e390a4c0715972c5b510cf4c10ad049a1\ndocs: change relative URLs to absolute URLs to fix broken links.\n\nPiperOrigin-RevId: 304695334\n\n0f7b1509a9a452808c3d07fe90fedfcea763d7d5\nfix: change config_schema_version to 2.0.0 for containeranalysis v1 gapic config.\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 304672648\n\n3d52f3c126fbfc31f067a7f54737b7f0dfbce163\nDialogflow weekly v2 library update:\n- Change `parent` field's resource_reference to specify child_type instead of type per client library generation requirement;\n- Change Session with its child resource pattern to support both projects/{project}/agent/sessions/{session} and projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session};\n- Fix `method_signature`\n- Regular documentation update\n\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 304635286\n\n4a6a01ce0ead505c245d11a2ce156de34800c58f\ndocs: change a relative URL to an absolute URL to fix broken links.\n\nPiperOrigin-RevId: 304633630\n\n1b969c28a6579265e89cd35e6c2ecacc89970e2d\nchore: set Ruby namespace in proto options\n\nPiperOrigin-RevId: 304620317\n\n5378173a889f9c7d83e36e52d38a6267190de692\nAdd v1beta2 SubmitJobAsOperation RPC to Dataproc.\n\nPiperOrigin-RevId: 304594381\n\n" - } - }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "99820243d348191bc9c634f2b48ddf65096285ed" + "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5", + "log": "6f32150677c9784f3c3a7e1949472bd29c9d72c5\nfix: installs test_utils from its common repo (#480)\n\n\n74ce986d3b5431eb66985e9a00c4eb45295a4020\nfix: stop recording update_time in synth.metadata (#478)\n\n\n7f8e62aa3edd225f76347a16f92e400661fdfb52\nchore(java): release-please only updates non maven versions in README (#476)\n\nPrevent release-please and synthtool from fighting over the released library version. Synthtool updates the install snippets from the samples pom.xml files so the bots fight if they are temporarily out of sync after a release.\nc7e0e517d7f46f77bebd27da2e5afcaa6eee7e25\nbuild(java): fix nightly integration test config to run integrations (#465)\n\nThis was only running the units.\nbd69a2aa7b70875f3c988e269706b22fefbef40e\nbuild(java): fix retry_with_backoff when -e option set (#475)\n\n\nd9b173c427bfa0c6cca818233562e7e8841a357c\nfix: record version of working repo in synth.metadata (#473)\n\nPartial revert of b37cf74d12e9a42b9de9e61a4f26133d7cd9c168.\nf73a541770d95a609e5be6bf6b3b220d17cefcbe\nfeat(discogapic): allow local discovery-artifact-manager (#474)\n\n\n8cf0f5d93a70c3dcb0b4999d3152c46d4d9264bf\ndoc: describe the Autosynth & Synthtool protocol (#472)\n\n* doc: describe the Autosynth & Synthtool protocol\n\n* Accommodate review comments.\n980baaa738a1ad8fa02b4fdbd56be075ee77ece5\nfix: pin sphinx to <3.0.0 as new version causes new error (#471)\n\nThe error `toctree contains reference to document changlelog that doesn't have a title: no link will be generated` occurs as of 3.0.0. Pinning to 2.x until we address the docs build issue.\n\nTowards #470\n\nI did this manually for python-datastore https://github.com/googleapis/python-datastore/pull/22\n928b2998ac5023e7c7e254ab935f9ef022455aad\nchore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.15 (#466)\n\nCo-authored-by: Jeffrey Rennie \n188f1b1d53181f739b98f8aa5d40cfe99eb90c47\nfix: allow local and external deps to be specified (#469)\n\nModify noxfile.py to allow local and external dependencies for\nsystem tests to be specified.\n1df68ed6735ddce6797d0f83641a731c3c3f75b4\nfix: apache license URL (#468)\n\n\nf4a59efa54808c4b958263de87bc666ce41e415f\nfeat: Add discogapic support for GAPICBazel generation (#459)\n\n* feat: Add discogapic support for GAPICBazel generation\n\n* reformat with black\n\n* Rename source repository variable\n\nCo-authored-by: Jeffrey Rennie \n" } } ], diff --git a/packages/google-cloud-memcache/synth.py b/packages/google-cloud-memcache/synth.py index 9edad64ef57..56d4816963c 100644 --- a/packages/google-cloud-memcache/synth.py +++ b/packages/google-cloud-memcache/synth.py @@ -43,6 +43,6 @@ # Node.js specific cleanup subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'fix']) +subprocess.run(['npm', 'run', 'lint']) subprocess.run(['npx', 'compileProtos', 'src']) From 5adecd1c53e22e7fb727aeeb49e073c89d323f2f Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sat, 11 Apr 2020 19:17:53 -0700 Subject: [PATCH 009/152] build: remove unused codecov config (#15) --- packages/google-cloud-memcache/codecov.yaml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 packages/google-cloud-memcache/codecov.yaml diff --git a/packages/google-cloud-memcache/codecov.yaml b/packages/google-cloud-memcache/codecov.yaml deleted file mode 100644 index 5724ea9478d..00000000000 --- a/packages/google-cloud-memcache/codecov.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -codecov: - ci: - - source.cloud.google.com From 4e58f8d236dffc34ea4802ecb7eed823ccddb4d8 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 14:54:40 -0700 Subject: [PATCH 010/152] chore: update lint ignore files (#16) --- packages/google-cloud-memcache/.eslintignore | 3 ++- packages/google-cloud-memcache/.prettierignore | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-memcache/.eslintignore b/packages/google-cloud-memcache/.eslintignore index 09b31fe735a..9340ad9b86d 100644 --- a/packages/google-cloud-memcache/.eslintignore +++ b/packages/google-cloud-memcache/.eslintignore @@ -1,5 +1,6 @@ **/node_modules -src/**/doc/* +**/coverage +test/fixtures build/ docs/ protos/ diff --git a/packages/google-cloud-memcache/.prettierignore b/packages/google-cloud-memcache/.prettierignore index f6fac98b0a8..9340ad9b86d 100644 --- a/packages/google-cloud-memcache/.prettierignore +++ b/packages/google-cloud-memcache/.prettierignore @@ -1,3 +1,6 @@ -node_modules/* -samples/node_modules/* -src/**/doc/* +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ From 17b0d52a121318f834d5ca8ef28e2d2241449735 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 15 Apr 2020 17:32:02 +0200 Subject: [PATCH 011/152] chore(deps): update dependency ts-loader to v7 (#17) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | devDependencies | major | [`^6.2.2` -> `^7.0.0`](https://renovatebot.com/diffs/npm/ts-loader/6.2.2/7.0.0) | --- ### Release Notes
TypeStrong/ts-loader ### [`v7.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v700) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v6.2.2...v7.0.0) - [Project reference support enhancements](https://togithub.com/TypeStrong/ts-loader/pull/1076) - thanks [@​sheetalkamat](https://togithub.com/sheetalkamat)! - Following the end of life of Node 8, `ts-loader` no longer supports Node 8 **BREAKING CHANGE**
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 0756fefa212..23dbc4a18b7 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -42,7 +42,7 @@ "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", - "ts-loader": "^6.2.2", + "ts-loader": "^7.0.0", "typescript": "~3.8.3", "webpack": "^4.42.1", "webpack-cli": "^3.3.11" From fa53aac4dc078cb474a7f959be950bb76b29c64d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 15 Apr 2020 18:31:26 +0200 Subject: [PATCH 012/152] chore(deps): update dependency null-loader to v4 (#18) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [null-loader](https://togithub.com/webpack-contrib/null-loader) | devDependencies | major | [`^3.0.0` -> `^4.0.0`](https://renovatebot.com/diffs/npm/null-loader/3.0.0/4.0.0) | --- ### Release Notes
webpack-contrib/null-loader ### [`v4.0.0`](https://togithub.com/webpack-contrib/null-loader/blob/master/CHANGELOG.md#​400-httpsgithubcomwebpack-contribnull-loadercomparev300v400-2020-04-15) [Compare Source](https://togithub.com/webpack-contrib/null-loader/compare/v3.0.0...v4.0.0) ##### Bug Fixes - support `webpack@5` ##### ⚠ BREAKING CHANGES - minimum required Nodejs version is `10.13`
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 23dbc4a18b7..805b3d35366 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -39,7 +39,7 @@ "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.0.4", "mocha": "^7.0.0", - "null-loader": "^3.0.0", + "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", "ts-loader": "^7.0.0", From 1eabc7ebe7eedbcf5a54fed33beab7f67a09a6b5 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 15 Apr 2020 10:30:34 -0700 Subject: [PATCH 013/152] chore: run fix instead of lint in synthfile (#19) --- packages/google-cloud-memcache/synth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/synth.py b/packages/google-cloud-memcache/synth.py index 56d4816963c..9edad64ef57 100644 --- a/packages/google-cloud-memcache/synth.py +++ b/packages/google-cloud-memcache/synth.py @@ -43,6 +43,6 @@ # Node.js specific cleanup subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'lint']) +subprocess.run(['npm', 'run', 'fix']) subprocess.run(['npx', 'compileProtos', 'src']) From 232bf12b735b93f02b08cfe1ac91ea6ae523e8b5 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 20 Apr 2020 15:41:05 -0700 Subject: [PATCH 014/152] build: use codecov's action, now that it's authless --- packages/google-cloud-memcache/synth.metadata | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 24eef4926c7..47236f5f604 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -1,12 +1,25 @@ { - "updateTime": "2020-04-11T00:32:10.640121Z", "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/nodejs-memcache.git", + "sha": "e29d5b4c5b4fc0a063997c58d7b4966304049291" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "42ee97c1b93a0e3759bbba3013da309f670a90ab", + "internalRef": "307114445" + } + }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5", - "log": "6f32150677c9784f3c3a7e1949472bd29c9d72c5\nfix: installs test_utils from its common repo (#480)\n\n\n74ce986d3b5431eb66985e9a00c4eb45295a4020\nfix: stop recording update_time in synth.metadata (#478)\n\n\n7f8e62aa3edd225f76347a16f92e400661fdfb52\nchore(java): release-please only updates non maven versions in README (#476)\n\nPrevent release-please and synthtool from fighting over the released library version. Synthtool updates the install snippets from the samples pom.xml files so the bots fight if they are temporarily out of sync after a release.\nc7e0e517d7f46f77bebd27da2e5afcaa6eee7e25\nbuild(java): fix nightly integration test config to run integrations (#465)\n\nThis was only running the units.\nbd69a2aa7b70875f3c988e269706b22fefbef40e\nbuild(java): fix retry_with_backoff when -e option set (#475)\n\n\nd9b173c427bfa0c6cca818233562e7e8841a357c\nfix: record version of working repo in synth.metadata (#473)\n\nPartial revert of b37cf74d12e9a42b9de9e61a4f26133d7cd9c168.\nf73a541770d95a609e5be6bf6b3b220d17cefcbe\nfeat(discogapic): allow local discovery-artifact-manager (#474)\n\n\n8cf0f5d93a70c3dcb0b4999d3152c46d4d9264bf\ndoc: describe the Autosynth & Synthtool protocol (#472)\n\n* doc: describe the Autosynth & Synthtool protocol\n\n* Accommodate review comments.\n980baaa738a1ad8fa02b4fdbd56be075ee77ece5\nfix: pin sphinx to <3.0.0 as new version causes new error (#471)\n\nThe error `toctree contains reference to document changlelog that doesn't have a title: no link will be generated` occurs as of 3.0.0. Pinning to 2.x until we address the docs build issue.\n\nTowards #470\n\nI did this manually for python-datastore https://github.com/googleapis/python-datastore/pull/22\n928b2998ac5023e7c7e254ab935f9ef022455aad\nchore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.15 (#466)\n\nCo-authored-by: Jeffrey Rennie \n188f1b1d53181f739b98f8aa5d40cfe99eb90c47\nfix: allow local and external deps to be specified (#469)\n\nModify noxfile.py to allow local and external dependencies for\nsystem tests to be specified.\n1df68ed6735ddce6797d0f83641a731c3c3f75b4\nfix: apache license URL (#468)\n\n\nf4a59efa54808c4b958263de87bc666ce41e415f\nfeat: Add discogapic support for GAPICBazel generation (#459)\n\n* feat: Add discogapic support for GAPICBazel generation\n\n* reformat with black\n\n* Rename source repository variable\n\nCo-authored-by: Jeffrey Rennie \n" + "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" } } ], From b02eb45c76777a0b7c29e27a9f278e5a0297dd52 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 21 Apr 2020 20:27:46 -0700 Subject: [PATCH 015/152] build: adopt changes to generator formatter (#21) --- .../google-cloud-memcache/protos/protos.js | 398 +++++++++--------- packages/google-cloud-memcache/synth.metadata | 4 +- 2 files changed, 201 insertions(+), 201 deletions(-) diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index 2926bf774c3..06d488af75d 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/protos/protos.js @@ -527,41 +527,41 @@ Instance.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.labels != null && message.hasOwnProperty("labels")) + 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 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.authorizedNetwork != null && message.hasOwnProperty("authorizedNetwork")) + if (message.authorizedNetwork != null && Object.hasOwnProperty.call(message, "authorizedNetwork")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.authorizedNetwork); if (message.zones != null && message.zones.length) for (var i = 0; i < message.zones.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.zones[i]); - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.nodeCount); - if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) + if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.memcacheVersion != null && message.hasOwnProperty("memcacheVersion")) + if (message.memcacheVersion != null && Object.hasOwnProperty.call(message, "memcacheVersion")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.memcacheVersion); - if (message.parameters != null && message.hasOwnProperty("parameters")) + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.memcacheNodes != null && message.memcacheNodes.length) for (var i = 0; i < message.memcacheNodes.length; ++i) $root.google.cloud.memcache.v1beta2.Instance.Node.encode(message.memcacheNodes[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 15, wireType 0 =*/120).int32(message.state); - if (message.memcacheFullVersion != null && message.hasOwnProperty("memcacheFullVersion")) + if (message.memcacheFullVersion != null && Object.hasOwnProperty.call(message, "memcacheFullVersion")) writer.uint32(/* id 18, wireType 2 =*/146).string(message.memcacheFullVersion); if (message.instanceMessages != null && message.instanceMessages.length) for (var i = 0; i < message.instanceMessages.length; ++i) $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.encode(message.instanceMessages[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) + if (message.discoveryEndpoint != null && Object.hasOwnProperty.call(message, "discoveryEndpoint")) writer.uint32(/* id 20, wireType 2 =*/162).string(message.discoveryEndpoint); return writer; }; @@ -1055,9 +1055,9 @@ NodeConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); - if (message.memorySizeMb != null && message.hasOwnProperty("memorySizeMb")) + if (message.memorySizeMb != null && Object.hasOwnProperty.call(message, "memorySizeMb")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.memorySizeMb); return writer; }; @@ -1301,17 +1301,17 @@ Node.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.nodeId != null && message.hasOwnProperty("nodeId")) + if (message.nodeId != null && Object.hasOwnProperty.call(message, "nodeId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeId); - if (message.zone != null && message.hasOwnProperty("zone")) + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); - if (message.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.host); - if (message.port != null && message.hasOwnProperty("port")) + if (message.port != null && Object.hasOwnProperty.call(message, "port")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.port); - if (message.parameters != null && message.hasOwnProperty("parameters")) + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -1531,7 +1531,7 @@ /** * State enum. * @name google.cloud.memcache.v1beta2.Instance.Node.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} CREATING=1 CREATING value * @property {number} READY=2 READY value @@ -1616,9 +1616,9 @@ InstanceMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && message.hasOwnProperty("message")) + if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); return writer; }; @@ -1774,7 +1774,7 @@ /** * Code enum. * @name google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code - * @enum {string} + * @enum {number} * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value * @property {number} ZONE_DISTRIBUTION_UNBALANCED=1 ZONE_DISTRIBUTION_UNBALANCED value */ @@ -1791,7 +1791,7 @@ /** * State enum. * @name google.cloud.memcache.v1beta2.Instance.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} CREATING=1 CREATING value * @property {number} READY=2 READY value @@ -1903,15 +1903,15 @@ ListInstancesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; @@ -2166,7 +2166,7 @@ if (message.resources != null && message.resources.length) for (var i = 0; i < message.resources.length; ++i) $root.google.cloud.memcache.v1beta2.Instance.encode(message.resources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + 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) @@ -2413,7 +2413,7 @@ GetInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -2618,11 +2618,11 @@ CreateInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.google.cloud.memcache.v1beta2.Instance.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -2846,9 +2846,9 @@ UpdateInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + 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.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.google.cloud.memcache.v1beta2.Instance.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -3057,7 +3057,7 @@ DeleteInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -3263,12 +3263,12 @@ ApplyParametersRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.nodeIds != null && message.nodeIds.length) for (var i = 0; i < message.nodeIds.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIds[i]); - if (message.applyAll != null && message.hasOwnProperty("applyAll")) + if (message.applyAll != null && Object.hasOwnProperty.call(message, "applyAll")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.applyAll); return writer; }; @@ -3511,11 +3511,11 @@ UpdateParametersRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + 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.parameters != null && message.hasOwnProperty("parameters")) + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -3745,9 +3745,9 @@ MemcacheParameters.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && message.hasOwnProperty("id")) + if (message.id != null && Object.hasOwnProperty.call(message, "id")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.params != null && message.hasOwnProperty("params")) + if (message.params != null && Object.hasOwnProperty.call(message, "params")) for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); return writer; @@ -4020,19 +4020,19 @@ OperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && message.hasOwnProperty("createTime")) + 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 && message.hasOwnProperty("endTime")) + 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 && message.hasOwnProperty("target")) + if (message.target != null && Object.hasOwnProperty.call(message, "target")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && message.hasOwnProperty("verb")) + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusDetail != null && message.hasOwnProperty("statusDetail")) + if (message.statusDetail != null && Object.hasOwnProperty.call(message, "statusDetail")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusDetail); - if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) + if (message.cancelRequested != null && Object.hasOwnProperty.call(message, "cancelRequested")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.cancelRequested); - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); return writer; }; @@ -4243,7 +4243,7 @@ /** * MemcacheVersion enum. * @name google.cloud.memcache.v1beta2.MemcacheVersion - * @enum {string} + * @enum {number} * @property {number} MEMCACHE_VERSION_UNSPECIFIED=0 MEMCACHE_VERSION_UNSPECIFIED value * @property {number} MEMCACHE_1_5=1 MEMCACHE_1_5 value */ @@ -4311,7 +4311,7 @@ LocationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.availableZones != null && message.hasOwnProperty("availableZones")) + if (message.availableZones != null && Object.hasOwnProperty.call(message, "availableZones")) for (var keys = Object.keys(message.availableZones), i = 0; i < keys.length; ++i) { writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.memcache.v1beta2.ZoneMetadata.encode(message.availableZones[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); @@ -4716,7 +4716,7 @@ 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 && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; @@ -5030,26 +5030,26 @@ HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) + if (message.get != null && Object.hasOwnProperty.call(message, "get")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) + if (message.put != null && Object.hasOwnProperty.call(message, "put")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) + if (message.post != null && Object.hasOwnProperty.call(message, "post")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) + if (message.body != null && Object.hasOwnProperty.call(message, "body")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("custom")) + 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 && message.hasOwnProperty("responseBody")) + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; @@ -5406,9 +5406,9 @@ CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) + if (message.path != null && Object.hasOwnProperty.call(message, "path")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; @@ -5554,7 +5554,7 @@ /** * FieldBehavior enum. * @name google.api.FieldBehavior - * @enum {string} + * @enum {number} * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value * @property {number} OPTIONAL=1 OPTIONAL value * @property {number} REQUIRED=2 REQUIRED value @@ -5675,18 +5675,18 @@ ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) + 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 && message.hasOwnProperty("nameField")) + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) + if (message.history != null && Object.hasOwnProperty.call(message, "history")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; @@ -5906,7 +5906,7 @@ /** * History enum. * @name google.api.ResourceDescriptor.History - * @enum {string} + * @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 @@ -5987,9 +5987,9 @@ ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; @@ -6514,9 +6514,9 @@ FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && message.hasOwnProperty("package")) + 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) @@ -6533,9 +6533,9 @@ 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 && message.hasOwnProperty("options")) + 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 && message.hasOwnProperty("sourceCodeInfo")) + 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) @@ -6543,7 +6543,7 @@ 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 && message.hasOwnProperty("syntax")) + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; @@ -7081,7 +7081,7 @@ DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + 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) @@ -7098,7 +7098,7 @@ 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 && message.hasOwnProperty("options")) + 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) @@ -7563,11 +7563,11 @@ ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && message.hasOwnProperty("options")) + 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; }; @@ -7791,9 +7791,9 @@ ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -8284,25 +8284,25 @@ FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && message.hasOwnProperty("extendee")) + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && message.hasOwnProperty("label")) + if (message.label != null && Object.hasOwnProperty.call(message, "label")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && message.hasOwnProperty("typeName")) + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && message.hasOwnProperty("options")) + 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 && message.hasOwnProperty("oneofIndex")) + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); return writer; }; @@ -8649,7 +8649,7 @@ /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type - * @enum {string} + * @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 @@ -8695,7 +8695,7 @@ /** * Label enum. * @name google.protobuf.FieldDescriptorProto.Label - * @enum {string} + * @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 @@ -8776,9 +8776,9 @@ OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && message.hasOwnProperty("options")) + 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; }; @@ -9021,12 +9021,12 @@ EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + 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 && message.hasOwnProperty("options")) + 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) @@ -9329,9 +9329,9 @@ EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -9551,11 +9551,11 @@ EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && message.hasOwnProperty("options")) + 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; }; @@ -9789,12 +9789,12 @@ ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + 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 && message.hasOwnProperty("options")) + 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; }; @@ -10074,17 +10074,17 @@ MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && message.hasOwnProperty("inputType")) + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && message.hasOwnProperty("outputType")) + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && message.hasOwnProperty("options")) + 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 && message.hasOwnProperty("clientStreaming")) + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; @@ -10523,45 +10523,45 @@ FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + 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) @@ -10988,7 +10988,7 @@ /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode - * @enum {string} + * @enum {number} * @property {number} SPEED=1 SPEED value * @property {number} CODE_SIZE=2 CODE_SIZE value * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value @@ -11106,18 +11106,18 @@ MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + 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 && message.hasOwnProperty(".google.api.resource")) + 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; }; @@ -11459,17 +11459,17 @@ FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ctype != null && message.hasOwnProperty("ctype")) + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && message.hasOwnProperty("packed")) + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && message.hasOwnProperty("lazy")) + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && message.hasOwnProperty("jstype")) + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && message.hasOwnProperty("weak")) + 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) @@ -11480,7 +11480,7 @@ writer.int32(message[".google.api.fieldBehavior"][i]); writer.ldelim(); } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + 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; }; @@ -11816,7 +11816,7 @@ /** * CType enum. * @name google.protobuf.FieldOptions.CType - * @enum {string} + * @enum {number} * @property {number} STRING=0 STRING value * @property {number} CORD=1 CORD value * @property {number} STRING_PIECE=2 STRING_PIECE value @@ -11832,7 +11832,7 @@ /** * JSType enum. * @name google.protobuf.FieldOptions.JSType - * @enum {string} + * @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 @@ -12131,9 +12131,9 @@ EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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) @@ -12376,7 +12376,7 @@ EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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) @@ -12625,14 +12625,14 @@ ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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 && message.hasOwnProperty(".google.api.defaultHost")) + 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 && message.hasOwnProperty(".google.api.oauthScopes")) + 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; }; @@ -12920,19 +12920,19 @@ MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + 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 && message.hasOwnProperty(".google.longrunning.operationInfo")) + 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 && message.hasOwnProperty(".google.api.http")) + 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; }; @@ -13182,7 +13182,7 @@ /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {string} + * @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 @@ -13312,17 +13312,17 @@ 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 && message.hasOwnProperty("identifierValue")) + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; @@ -14099,9 +14099,9 @@ writer.int32(message.span[i]); writer.ldelim(); } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + 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) @@ -14632,11 +14632,11 @@ writer.int32(message.path[i]); writer.ldelim(); } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && message.hasOwnProperty("begin")) + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; @@ -14889,9 +14889,9 @@ Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type_url != null && message.hasOwnProperty("type_url")) + 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 && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; @@ -15108,9 +15108,9 @@ Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -15695,9 +15695,9 @@ Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -16172,15 +16172,15 @@ Operation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && message.hasOwnProperty("metadata")) + 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 && message.hasOwnProperty("done")) + if (message.done != null && Object.hasOwnProperty.call(message, "done")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && message.hasOwnProperty("error")) + 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 && message.hasOwnProperty("response")) + 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; }; @@ -16440,7 +16440,7 @@ GetOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -16654,13 +16654,13 @@ ListOperationsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); return writer; }; @@ -16894,7 +16894,7 @@ 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 && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -17112,7 +17112,7 @@ CancelOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -17299,7 +17299,7 @@ DeleteOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -17495,9 +17495,9 @@ WaitOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && message.hasOwnProperty("timeout")) + 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; }; @@ -17710,9 +17710,9 @@ OperationInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.responseType != null && message.hasOwnProperty("responseType")) + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); return writer; }; @@ -17942,9 +17942,9 @@ Status.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && message.hasOwnProperty("message")) + 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) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 47236f5f604..d3cd149e329 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "e29d5b4c5b4fc0a063997c58d7b4966304049291" + "sha": "4f4e1a4ac5802418e1e518703e9a80809d0a86a6" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" + "sha": "f5e4c17dc78a966dbf29961dd01f9bbd63e20a04" } } ], From 9598e3feb7bbe4fc80447f72c0e43bdddd39a570 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 23 Apr 2020 19:34:29 -0700 Subject: [PATCH 016/152] chore: update npm scripts and synth.py (#22) Update npm scripts: add clean, prelint, prefix; make sure that lint and fix are set properly. Use post-process feature of synthtool. --- packages/google-cloud-memcache/package.json | 5 +++-- packages/google-cloud-memcache/synth.py | 8 ++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 805b3d35366..704e02cdeb6 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -18,12 +18,13 @@ "predocs-test": "npm run docs", "docs-test": "linkinator docs", "fix": "gts fix", - "lint": "gts fix", + "lint": "gts check", "prelint": "cd samples; npm link ../; npm install", "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" + "test": "c8 mocha build/test", + "precompile": "gts clean" }, "dependencies": { "google-gax": "^2.1.0" diff --git a/packages/google-cloud-memcache/synth.py b/packages/google-cloud-memcache/synth.py index 9edad64ef57..591d61d4e46 100644 --- a/packages/google-cloud-memcache/synth.py +++ b/packages/google-cloud-memcache/synth.py @@ -15,7 +15,7 @@ import synthtool as s import synthtool.gcp as gcp -import subprocess +import synthtool.languages.node as node import logging logging.basicConfig(level=logging.DEBUG) @@ -41,8 +41,4 @@ templates = common_templates.node_library(source_location='build/src') s.copy(templates, excludes=[]) -# Node.js specific cleanup -subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'fix']) -subprocess.run(['npx', 'compileProtos', 'src']) - +node.postprocess_gapic_library() From 962a69b264735ab2a860494bced0f61d699b0892 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 5 May 2020 18:35:23 -0700 Subject: [PATCH 017/152] feat: check status of long running operation by its name (#23) For each client method returning a long running operation, a separate method to check its status is added. Added methods: `checkApplyParametersProgress`, `checkCreateInstanceProgress`, `checkDeleteInstanceProgress`, `checkUpdateInstanceProgress`, `checkUpdateParametersProgress`. --- .../google-cloud-memcache/protos/protos.js | 398 +++++++++--------- .../src/v1beta2/cloud_memcache_client.ts | 182 +++++++- packages/google-cloud-memcache/synth.metadata | 14 +- .../test/gapic_cloud_memcache_v1beta2.ts | 259 ++++++++++-- 4 files changed, 602 insertions(+), 251 deletions(-) diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index 06d488af75d..2926bf774c3 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/protos/protos.js @@ -527,41 +527,41 @@ Instance.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + if (message.displayName != null && message.hasOwnProperty("displayName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + if (message.labels != null && message.hasOwnProperty("labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.authorizedNetwork != null && Object.hasOwnProperty.call(message, "authorizedNetwork")) + if (message.authorizedNetwork != null && message.hasOwnProperty("authorizedNetwork")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.authorizedNetwork); if (message.zones != null && message.zones.length) for (var i = 0; i < message.zones.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.zones[i]); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.nodeCount); - if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.memcacheVersion != null && Object.hasOwnProperty.call(message, "memcacheVersion")) + if (message.memcacheVersion != null && message.hasOwnProperty("memcacheVersion")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.memcacheVersion); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + if (message.parameters != null && message.hasOwnProperty("parameters")) $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.memcacheNodes != null && message.memcacheNodes.length) for (var i = 0; i < message.memcacheNodes.length; ++i) $root.google.cloud.memcache.v1beta2.Instance.Node.encode(message.memcacheNodes[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + if (message.createTime != null && message.hasOwnProperty("createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + if (message.updateTime != null && message.hasOwnProperty("updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) + if (message.state != null && message.hasOwnProperty("state")) writer.uint32(/* id 15, wireType 0 =*/120).int32(message.state); - if (message.memcacheFullVersion != null && Object.hasOwnProperty.call(message, "memcacheFullVersion")) + if (message.memcacheFullVersion != null && message.hasOwnProperty("memcacheFullVersion")) writer.uint32(/* id 18, wireType 2 =*/146).string(message.memcacheFullVersion); if (message.instanceMessages != null && message.instanceMessages.length) for (var i = 0; i < message.instanceMessages.length; ++i) $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.encode(message.instanceMessages[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.discoveryEndpoint != null && Object.hasOwnProperty.call(message, "discoveryEndpoint")) + if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) writer.uint32(/* id 20, wireType 2 =*/162).string(message.discoveryEndpoint); return writer; }; @@ -1055,9 +1055,9 @@ NodeConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); - if (message.memorySizeMb != null && Object.hasOwnProperty.call(message, "memorySizeMb")) + if (message.memorySizeMb != null && message.hasOwnProperty("memorySizeMb")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.memorySizeMb); return writer; }; @@ -1301,17 +1301,17 @@ Node.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.nodeId != null && Object.hasOwnProperty.call(message, "nodeId")) + if (message.nodeId != null && message.hasOwnProperty("nodeId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeId); - if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + if (message.zone != null && message.hasOwnProperty("zone")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) + if (message.state != null && message.hasOwnProperty("state")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); - if (message.host != null && Object.hasOwnProperty.call(message, "host")) + if (message.host != null && message.hasOwnProperty("host")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.host); - if (message.port != null && Object.hasOwnProperty.call(message, "port")) + if (message.port != null && message.hasOwnProperty("port")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.port); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + if (message.parameters != null && message.hasOwnProperty("parameters")) $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -1531,7 +1531,7 @@ /** * State enum. * @name google.cloud.memcache.v1beta2.Instance.Node.State - * @enum {number} + * @enum {string} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} CREATING=1 CREATING value * @property {number} READY=2 READY value @@ -1616,9 +1616,9 @@ InstanceMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) + if (message.code != null && message.hasOwnProperty("code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) + if (message.message != null && message.hasOwnProperty("message")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); return writer; }; @@ -1774,7 +1774,7 @@ /** * Code enum. * @name google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code - * @enum {number} + * @enum {string} * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value * @property {number} ZONE_DISTRIBUTION_UNBALANCED=1 ZONE_DISTRIBUTION_UNBALANCED value */ @@ -1791,7 +1791,7 @@ /** * State enum. * @name google.cloud.memcache.v1beta2.Instance.State - * @enum {number} + * @enum {string} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} CREATING=1 CREATING value * @property {number} READY=2 READY value @@ -1903,15 +1903,15 @@ ListInstancesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (message.filter != null && message.hasOwnProperty("filter")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + if (message.orderBy != null && message.hasOwnProperty("orderBy")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; @@ -2166,7 +2166,7 @@ if (message.resources != null && message.resources.length) for (var i = 0; i < message.resources.length; ++i) $root.google.cloud.memcache.v1beta2.Instance.encode(message.resources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (message.nextPageToken != null && message.hasOwnProperty("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) @@ -2413,7 +2413,7 @@ GetInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -2618,11 +2618,11 @@ CreateInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (message.parent != null && message.hasOwnProperty("parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + if (message.instanceId != null && message.hasOwnProperty("instanceId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + if (message.resource != null && message.hasOwnProperty("resource")) $root.google.cloud.memcache.v1beta2.Instance.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -2846,9 +2846,9 @@ UpdateInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + if (message.updateMask != null && message.hasOwnProperty("updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + if (message.resource != null && message.hasOwnProperty("resource")) $root.google.cloud.memcache.v1beta2.Instance.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -3057,7 +3057,7 @@ DeleteInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -3263,12 +3263,12 @@ ApplyParametersRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.nodeIds != null && message.nodeIds.length) for (var i = 0; i < message.nodeIds.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIds[i]); - if (message.applyAll != null && Object.hasOwnProperty.call(message, "applyAll")) + if (message.applyAll != null && message.hasOwnProperty("applyAll")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.applyAll); return writer; }; @@ -3511,11 +3511,11 @@ UpdateParametersRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + if (message.updateMask != null && message.hasOwnProperty("updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + if (message.parameters != null && message.hasOwnProperty("parameters")) $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -3745,9 +3745,9 @@ MemcacheParameters.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (message.id != null && message.hasOwnProperty("id")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) + if (message.params != null && message.hasOwnProperty("params")) for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); return writer; @@ -4020,19 +4020,19 @@ OperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + if (message.createTime != null && message.hasOwnProperty("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")) + if (message.endTime != null && message.hasOwnProperty("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")) + if (message.target != null && message.hasOwnProperty("target")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + if (message.verb != null && message.hasOwnProperty("verb")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusDetail != null && Object.hasOwnProperty.call(message, "statusDetail")) + if (message.statusDetail != null && message.hasOwnProperty("statusDetail")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusDetail); - if (message.cancelRequested != null && Object.hasOwnProperty.call(message, "cancelRequested")) + if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.cancelRequested); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); return writer; }; @@ -4243,7 +4243,7 @@ /** * MemcacheVersion enum. * @name google.cloud.memcache.v1beta2.MemcacheVersion - * @enum {number} + * @enum {string} * @property {number} MEMCACHE_VERSION_UNSPECIFIED=0 MEMCACHE_VERSION_UNSPECIFIED value * @property {number} MEMCACHE_1_5=1 MEMCACHE_1_5 value */ @@ -4311,7 +4311,7 @@ LocationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.availableZones != null && Object.hasOwnProperty.call(message, "availableZones")) + if (message.availableZones != null && message.hasOwnProperty("availableZones")) for (var keys = Object.keys(message.availableZones), i = 0; i < keys.length; ++i) { writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.memcache.v1beta2.ZoneMetadata.encode(message.availableZones[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); @@ -4716,7 +4716,7 @@ 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")) + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; @@ -5030,26 +5030,26 @@ HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + if (message.selector != null && message.hasOwnProperty("selector")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) + if (message.get != null && message.hasOwnProperty("get")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) + if (message.put != null && message.hasOwnProperty("put")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) + if (message.post != null && message.hasOwnProperty("post")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + if (message["delete"] != null && message.hasOwnProperty("delete")) writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + if (message.patch != null && message.hasOwnProperty("patch")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) + if (message.body != null && message.hasOwnProperty("body")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + if (message.custom != null && message.hasOwnProperty("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")) + if (message.responseBody != null && message.hasOwnProperty("responseBody")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; @@ -5406,9 +5406,9 @@ CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (message.kind != null && message.hasOwnProperty("kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) + if (message.path != null && message.hasOwnProperty("path")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; @@ -5554,7 +5554,7 @@ /** * FieldBehavior enum. * @name google.api.FieldBehavior - * @enum {number} + * @enum {string} * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value * @property {number} OPTIONAL=1 OPTIONAL value * @property {number} REQUIRED=2 REQUIRED value @@ -5675,18 +5675,18 @@ ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("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")) + if (message.nameField != null && message.hasOwnProperty("nameField")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) + if (message.history != null && message.hasOwnProperty("history")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + if (message.plural != null && message.hasOwnProperty("plural")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + if (message.singular != null && message.hasOwnProperty("singular")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; @@ -5906,7 +5906,7 @@ /** * History enum. * @name google.api.ResourceDescriptor.History - * @enum {number} + * @enum {string} * @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 @@ -5987,9 +5987,9 @@ ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + if (message.childType != null && message.hasOwnProperty("childType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; @@ -6514,9 +6514,9 @@ FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + if (message["package"] != null && message.hasOwnProperty("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) @@ -6533,9 +6533,9 @@ 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")) + if (message.options != null && message.hasOwnProperty("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")) + if (message.sourceCodeInfo != null && message.hasOwnProperty("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) @@ -6543,7 +6543,7 @@ 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")) + if (message.syntax != null && message.hasOwnProperty("syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; @@ -7081,7 +7081,7 @@ DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("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) @@ -7098,7 +7098,7 @@ 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")) + if (message.options != null && message.hasOwnProperty("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) @@ -7563,11 +7563,11 @@ ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (message.start != null && message.hasOwnProperty("start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (message.end != null && message.hasOwnProperty("end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) + if (message.options != null && message.hasOwnProperty("options")) $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -7791,9 +7791,9 @@ ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (message.start != null && message.hasOwnProperty("start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (message.end != null && message.hasOwnProperty("end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -8284,25 +8284,25 @@ FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + if (message.extendee != null && message.hasOwnProperty("extendee")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) + if (message.number != null && message.hasOwnProperty("number")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) + if (message.label != null && message.hasOwnProperty("label")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (message.type != null && message.hasOwnProperty("type")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + if (message.typeName != null && message.hasOwnProperty("typeName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) + if (message.options != null && message.hasOwnProperty("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")) + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + if (message.jsonName != null && message.hasOwnProperty("jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); return writer; }; @@ -8649,7 +8649,7 @@ /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} + * @enum {string} * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value * @property {number} TYPE_INT64=3 TYPE_INT64 value @@ -8695,7 +8695,7 @@ /** * Label enum. * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} + * @enum {string} * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value @@ -8776,9 +8776,9 @@ OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) + if (message.options != null && message.hasOwnProperty("options")) $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -9021,12 +9021,12 @@ EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("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")) + if (message.options != null && message.hasOwnProperty("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) @@ -9329,9 +9329,9 @@ EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (message.start != null && message.hasOwnProperty("start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (message.end != null && message.hasOwnProperty("end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -9551,11 +9551,11 @@ EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) + if (message.number != null && message.hasOwnProperty("number")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) + if (message.options != null && message.hasOwnProperty("options")) $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -9789,12 +9789,12 @@ ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("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")) + if (message.options != null && message.hasOwnProperty("options")) $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -10074,17 +10074,17 @@ MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + if (message.inputType != null && message.hasOwnProperty("inputType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + if (message.outputType != null && message.hasOwnProperty("outputType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) + if (message.options != null && message.hasOwnProperty("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")) + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; @@ -10523,45 +10523,45 @@ FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + if (message.goPackage != null && message.hasOwnProperty("goPackage")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + if (message.rubyPackage != null && message.hasOwnProperty("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) @@ -10988,7 +10988,7 @@ /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} + * @enum {string} * @property {number} SPEED=1 SPEED value * @property {number} CODE_SIZE=2 CODE_SIZE value * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value @@ -11106,18 +11106,18 @@ MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + if (message.mapEntry != null && message.hasOwnProperty("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")) + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -11459,17 +11459,17 @@ FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + if (message.ctype != null && message.hasOwnProperty("ctype")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + if (message.packed != null && message.hasOwnProperty("packed")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + if (message.lazy != null && message.hasOwnProperty("lazy")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + if (message.jstype != null && message.hasOwnProperty("jstype")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + if (message.weak != null && message.hasOwnProperty("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) @@ -11480,7 +11480,7 @@ writer.int32(message[".google.api.fieldBehavior"][i]); writer.ldelim(); } - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); return writer; }; @@ -11816,7 +11816,7 @@ /** * CType enum. * @name google.protobuf.FieldOptions.CType - * @enum {number} + * @enum {string} * @property {number} STRING=0 STRING value * @property {number} CORD=1 CORD value * @property {number} STRING_PIECE=2 STRING_PIECE value @@ -11832,7 +11832,7 @@ /** * JSType enum. * @name google.protobuf.FieldOptions.JSType - * @enum {number} + * @enum {string} * @property {number} JS_NORMAL=0 JS_NORMAL value * @property {number} JS_STRING=1 JS_STRING value * @property {number} JS_NUMBER=2 JS_NUMBER value @@ -12131,9 +12131,9 @@ EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("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) @@ -12376,7 +12376,7 @@ EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("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) @@ -12625,14 +12625,14 @@ ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("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")) + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".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")) + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); return writer; }; @@ -12920,19 +12920,19 @@ MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (message.deprecated != null && message.hasOwnProperty("deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + if (message.idempotencyLevel != null && message.hasOwnProperty("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")) + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".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")) + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); return writer; }; @@ -13182,7 +13182,7 @@ /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} + * @enum {string} * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value * @property {number} IDEMPOTENT=2 IDEMPOTENT value @@ -13312,17 +13312,17 @@ 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")) + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + if (message.stringValue != null && message.hasOwnProperty("stringValue")) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; @@ -14099,9 +14099,9 @@ writer.int32(message.span[i]); writer.ldelim(); } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + if (message.trailingComments != null && message.hasOwnProperty("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) @@ -14632,11 +14632,11 @@ writer.int32(message.path[i]); writer.ldelim(); } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + if (message.begin != null && message.hasOwnProperty("begin")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (message.end != null && message.hasOwnProperty("end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; @@ -14889,9 +14889,9 @@ Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + if (message.type_url != null && message.hasOwnProperty("type_url")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (message.value != null && message.hasOwnProperty("value")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; @@ -15108,9 +15108,9 @@ Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + if (message.seconds != null && message.hasOwnProperty("seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + if (message.nanos != null && message.hasOwnProperty("nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -15695,9 +15695,9 @@ Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + if (message.seconds != null && message.hasOwnProperty("seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + if (message.nanos != null && message.hasOwnProperty("nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -16172,15 +16172,15 @@ Operation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + if (message.metadata != null && message.hasOwnProperty("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")) + if (message.done != null && message.hasOwnProperty("done")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) + if (message.error != null && message.hasOwnProperty("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")) + if (message.response != null && message.hasOwnProperty("response")) $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -16440,7 +16440,7 @@ GetOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -16654,13 +16654,13 @@ ListOperationsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (message.filter != null && message.hasOwnProperty("filter")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (message.pageSize != null && message.hasOwnProperty("pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (message.pageToken != null && message.hasOwnProperty("pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); return writer; }; @@ -16894,7 +16894,7 @@ 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")) + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -17112,7 +17112,7 @@ CancelOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -17299,7 +17299,7 @@ DeleteOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -17495,9 +17495,9 @@ WaitOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + if (message.timeout != null && message.hasOwnProperty("timeout")) $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -17710,9 +17710,9 @@ OperationInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + if (message.responseType != null && message.hasOwnProperty("responseType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + if (message.metadataType != null && message.hasOwnProperty("metadataType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); return writer; }; @@ -17942,9 +17942,9 @@ Status.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) + if (message.code != null && message.hasOwnProperty("code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) + if (message.message != null && message.hasOwnProperty("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) diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index 412d7b7477a..59b3449de61 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -32,7 +32,7 @@ import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './cloud_memcache_client_config.json'; - +import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -600,6 +600,42 @@ export class CloudMemcacheClient { this.initialize(); return this.innerApiCalls.createInstance(request, options, callback); } + /** + * Check the status of the long running operation returned by the createInstance() method. + * @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. + * + * @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.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.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.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + >; + } updateInstance( request: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, options?: gax.CallOptions @@ -702,6 +738,42 @@ export class CloudMemcacheClient { this.initialize(); return this.innerApiCalls.updateInstance(request, options, callback); } + /** + * Check the status of the long running operation returned by the updateInstance() method. + * @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. + * + * @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.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.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.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + >; + } updateParameters( request: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, options?: gax.CallOptions @@ -807,6 +879,42 @@ export class CloudMemcacheClient { this.initialize(); return this.innerApiCalls.updateParameters(request, options, callback); } + /** + * Check the status of the long running operation returned by the updateParameters() method. + * @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. + * + * @example: + * const decodedOperation = await checkUpdateParametersProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkUpdateParametersProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.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.updateParameters, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + >; + } deleteInstance( request: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, options?: gax.CallOptions @@ -907,6 +1015,42 @@ export class CloudMemcacheClient { this.initialize(); return this.innerApiCalls.deleteInstance(request, options, callback); } + /** + * Check the status of the long running operation returned by the deleteInstance() method. + * @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. + * + * @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.memcache.v1beta2.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.memcache.v1beta2.OperationMetadata + >; + } applyParameters( request: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, options?: gax.CallOptions @@ -1013,6 +1157,42 @@ export class CloudMemcacheClient { this.initialize(); return this.innerApiCalls.applyParameters(request, options, callback); } + /** + * Check the status of the long running operation returned by the applyParameters() method. + * @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. + * + * @example: + * const decodedOperation = await checkApplyParametersProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkApplyParametersProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.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.applyParameters, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + >; + } listInstances( request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, options?: gax.CallOptions diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index d3cd149e329..832ae7bb6df 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "4f4e1a4ac5802418e1e518703e9a80809d0a86a6" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "42ee97c1b93a0e3759bbba3013da309f670a90ab", - "internalRef": "307114445" + "remote": "git@github.com:googleapis/nodejs-memcache.git", + "sha": "b94475604010e4f4b0eb2c5676c9fdb58290bbbd" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "f5e4c17dc78a966dbf29961dd01f9bbd63e20a04" + "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" } } ], diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts index 29fe1857783..c897d8ba17d 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts @@ -25,7 +25,7 @@ import * as cloudmemcacheModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation} from 'google-gax'; +import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { const filledObject = (instance.constructor as typeof protobuf.Message).toObject( @@ -331,9 +331,7 @@ describe('v1beta2.CloudMemcacheClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getInstance(request); - }, expectedError); + await assert.rejects(client.getInstance(request), expectedError); assert( (client.innerApiCalls.getInstance as SinonStub) .getCall(0) @@ -455,9 +453,7 @@ describe('v1beta2.CloudMemcacheClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createInstance(request); - }, expectedError); + await assert.rejects(client.createInstance(request), expectedError); assert( (client.innerApiCalls.createInstance as SinonStub) .getCall(0) @@ -490,15 +486,54 @@ describe('v1beta2.CloudMemcacheClient', () => { expectedError ); const [operation] = await client.createInstance(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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', () => { @@ -617,9 +652,7 @@ describe('v1beta2.CloudMemcacheClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateInstance(request); - }, expectedError); + await assert.rejects(client.updateInstance(request), expectedError); assert( (client.innerApiCalls.updateInstance as SinonStub) .getCall(0) @@ -653,15 +686,54 @@ describe('v1beta2.CloudMemcacheClient', () => { expectedError ); const [operation] = await client.updateInstance(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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('updateParameters', () => { @@ -777,9 +849,7 @@ describe('v1beta2.CloudMemcacheClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateParameters(request); - }, expectedError); + await assert.rejects(client.updateParameters(request), expectedError); assert( (client.innerApiCalls.updateParameters as SinonStub) .getCall(0) @@ -812,15 +882,54 @@ describe('v1beta2.CloudMemcacheClient', () => { expectedError ); const [operation] = await client.updateParameters(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.updateParameters as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes checkUpdateParametersProgress without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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.checkUpdateParametersProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateParametersProgress with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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.checkUpdateParametersProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); }); describe('deleteInstance', () => { @@ -936,9 +1045,7 @@ describe('v1beta2.CloudMemcacheClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.deleteInstance(request); - }, expectedError); + await assert.rejects(client.deleteInstance(request), expectedError); assert( (client.innerApiCalls.deleteInstance as SinonStub) .getCall(0) @@ -971,15 +1078,54 @@ describe('v1beta2.CloudMemcacheClient', () => { expectedError ); const [operation] = await client.deleteInstance(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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('applyParameters', () => { @@ -1095,9 +1241,7 @@ describe('v1beta2.CloudMemcacheClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.applyParameters(request); - }, expectedError); + await assert.rejects(client.applyParameters(request), expectedError); assert( (client.innerApiCalls.applyParameters as SinonStub) .getCall(0) @@ -1130,15 +1274,54 @@ describe('v1beta2.CloudMemcacheClient', () => { expectedError ); const [operation] = await client.applyParameters(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.applyParameters as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes checkApplyParametersProgress without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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.checkApplyParametersProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkApplyParametersProgress with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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.checkApplyParametersProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); }); describe('listInstances', () => { @@ -1260,9 +1443,7 @@ describe('v1beta2.CloudMemcacheClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listInstances(request); - }, expectedError); + await assert.rejects(client.listInstances(request), expectedError); assert( (client.innerApiCalls.listInstances as SinonStub) .getCall(0) @@ -1359,9 +1540,7 @@ describe('v1beta2.CloudMemcacheClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listInstances.createStream as SinonStub) .getCall(0) From caab0ff042f74d3940f54be6a08d45ff86a02229 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 6 May 2020 19:34:16 -0700 Subject: [PATCH 018/152] chore: linting rules (#25) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/d5e01c0b-0d2d-4da4-b495-86674ea6021f/targets --- .../google-cloud-memcache/protos/protos.js | 398 +++++++++--------- packages/google-cloud-memcache/synth.metadata | 12 +- 2 files changed, 209 insertions(+), 201 deletions(-) diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index 2926bf774c3..06d488af75d 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/protos/protos.js @@ -527,41 +527,41 @@ Instance.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.labels != null && message.hasOwnProperty("labels")) + 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 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.authorizedNetwork != null && message.hasOwnProperty("authorizedNetwork")) + if (message.authorizedNetwork != null && Object.hasOwnProperty.call(message, "authorizedNetwork")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.authorizedNetwork); if (message.zones != null && message.zones.length) for (var i = 0; i < message.zones.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.zones[i]); - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.nodeCount); - if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) + if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.memcacheVersion != null && message.hasOwnProperty("memcacheVersion")) + if (message.memcacheVersion != null && Object.hasOwnProperty.call(message, "memcacheVersion")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.memcacheVersion); - if (message.parameters != null && message.hasOwnProperty("parameters")) + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.memcacheNodes != null && message.memcacheNodes.length) for (var i = 0; i < message.memcacheNodes.length; ++i) $root.google.cloud.memcache.v1beta2.Instance.Node.encode(message.memcacheNodes[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 15, wireType 0 =*/120).int32(message.state); - if (message.memcacheFullVersion != null && message.hasOwnProperty("memcacheFullVersion")) + if (message.memcacheFullVersion != null && Object.hasOwnProperty.call(message, "memcacheFullVersion")) writer.uint32(/* id 18, wireType 2 =*/146).string(message.memcacheFullVersion); if (message.instanceMessages != null && message.instanceMessages.length) for (var i = 0; i < message.instanceMessages.length; ++i) $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.encode(message.instanceMessages[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) + if (message.discoveryEndpoint != null && Object.hasOwnProperty.call(message, "discoveryEndpoint")) writer.uint32(/* id 20, wireType 2 =*/162).string(message.discoveryEndpoint); return writer; }; @@ -1055,9 +1055,9 @@ NodeConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); - if (message.memorySizeMb != null && message.hasOwnProperty("memorySizeMb")) + if (message.memorySizeMb != null && Object.hasOwnProperty.call(message, "memorySizeMb")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.memorySizeMb); return writer; }; @@ -1301,17 +1301,17 @@ Node.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.nodeId != null && message.hasOwnProperty("nodeId")) + if (message.nodeId != null && Object.hasOwnProperty.call(message, "nodeId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeId); - if (message.zone != null && message.hasOwnProperty("zone")) + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); - if (message.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.host); - if (message.port != null && message.hasOwnProperty("port")) + if (message.port != null && Object.hasOwnProperty.call(message, "port")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.port); - if (message.parameters != null && message.hasOwnProperty("parameters")) + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -1531,7 +1531,7 @@ /** * State enum. * @name google.cloud.memcache.v1beta2.Instance.Node.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} CREATING=1 CREATING value * @property {number} READY=2 READY value @@ -1616,9 +1616,9 @@ InstanceMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && message.hasOwnProperty("message")) + if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); return writer; }; @@ -1774,7 +1774,7 @@ /** * Code enum. * @name google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code - * @enum {string} + * @enum {number} * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value * @property {number} ZONE_DISTRIBUTION_UNBALANCED=1 ZONE_DISTRIBUTION_UNBALANCED value */ @@ -1791,7 +1791,7 @@ /** * State enum. * @name google.cloud.memcache.v1beta2.Instance.State - * @enum {string} + * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} CREATING=1 CREATING value * @property {number} READY=2 READY value @@ -1903,15 +1903,15 @@ ListInstancesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; @@ -2166,7 +2166,7 @@ if (message.resources != null && message.resources.length) for (var i = 0; i < message.resources.length; ++i) $root.google.cloud.memcache.v1beta2.Instance.encode(message.resources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + 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) @@ -2413,7 +2413,7 @@ GetInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -2618,11 +2618,11 @@ CreateInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.google.cloud.memcache.v1beta2.Instance.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -2846,9 +2846,9 @@ UpdateInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + 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.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.google.cloud.memcache.v1beta2.Instance.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -3057,7 +3057,7 @@ DeleteInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -3263,12 +3263,12 @@ ApplyParametersRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.nodeIds != null && message.nodeIds.length) for (var i = 0; i < message.nodeIds.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIds[i]); - if (message.applyAll != null && message.hasOwnProperty("applyAll")) + if (message.applyAll != null && Object.hasOwnProperty.call(message, "applyAll")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.applyAll); return writer; }; @@ -3511,11 +3511,11 @@ UpdateParametersRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) + 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.parameters != null && message.hasOwnProperty("parameters")) + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -3745,9 +3745,9 @@ MemcacheParameters.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && message.hasOwnProperty("id")) + if (message.id != null && Object.hasOwnProperty.call(message, "id")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.params != null && message.hasOwnProperty("params")) + if (message.params != null && Object.hasOwnProperty.call(message, "params")) for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); return writer; @@ -4020,19 +4020,19 @@ OperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && message.hasOwnProperty("createTime")) + 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 && message.hasOwnProperty("endTime")) + 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 && message.hasOwnProperty("target")) + if (message.target != null && Object.hasOwnProperty.call(message, "target")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && message.hasOwnProperty("verb")) + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusDetail != null && message.hasOwnProperty("statusDetail")) + if (message.statusDetail != null && Object.hasOwnProperty.call(message, "statusDetail")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusDetail); - if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) + if (message.cancelRequested != null && Object.hasOwnProperty.call(message, "cancelRequested")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.cancelRequested); - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); return writer; }; @@ -4243,7 +4243,7 @@ /** * MemcacheVersion enum. * @name google.cloud.memcache.v1beta2.MemcacheVersion - * @enum {string} + * @enum {number} * @property {number} MEMCACHE_VERSION_UNSPECIFIED=0 MEMCACHE_VERSION_UNSPECIFIED value * @property {number} MEMCACHE_1_5=1 MEMCACHE_1_5 value */ @@ -4311,7 +4311,7 @@ LocationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.availableZones != null && message.hasOwnProperty("availableZones")) + if (message.availableZones != null && Object.hasOwnProperty.call(message, "availableZones")) for (var keys = Object.keys(message.availableZones), i = 0; i < keys.length; ++i) { writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.memcache.v1beta2.ZoneMetadata.encode(message.availableZones[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); @@ -4716,7 +4716,7 @@ 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 && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; @@ -5030,26 +5030,26 @@ HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) + if (message.get != null && Object.hasOwnProperty.call(message, "get")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) + if (message.put != null && Object.hasOwnProperty.call(message, "put")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) + if (message.post != null && Object.hasOwnProperty.call(message, "post")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) + if (message.body != null && Object.hasOwnProperty.call(message, "body")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("custom")) + 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 && message.hasOwnProperty("responseBody")) + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; @@ -5406,9 +5406,9 @@ CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) + if (message.path != null && Object.hasOwnProperty.call(message, "path")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; @@ -5554,7 +5554,7 @@ /** * FieldBehavior enum. * @name google.api.FieldBehavior - * @enum {string} + * @enum {number} * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value * @property {number} OPTIONAL=1 OPTIONAL value * @property {number} REQUIRED=2 REQUIRED value @@ -5675,18 +5675,18 @@ ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) + 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 && message.hasOwnProperty("nameField")) + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) + if (message.history != null && Object.hasOwnProperty.call(message, "history")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; @@ -5906,7 +5906,7 @@ /** * History enum. * @name google.api.ResourceDescriptor.History - * @enum {string} + * @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 @@ -5987,9 +5987,9 @@ ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; @@ -6514,9 +6514,9 @@ FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && message.hasOwnProperty("package")) + 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) @@ -6533,9 +6533,9 @@ 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 && message.hasOwnProperty("options")) + 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 && message.hasOwnProperty("sourceCodeInfo")) + 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) @@ -6543,7 +6543,7 @@ 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 && message.hasOwnProperty("syntax")) + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; @@ -7081,7 +7081,7 @@ DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + 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) @@ -7098,7 +7098,7 @@ 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 && message.hasOwnProperty("options")) + 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) @@ -7563,11 +7563,11 @@ ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && message.hasOwnProperty("options")) + 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; }; @@ -7791,9 +7791,9 @@ ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -8284,25 +8284,25 @@ FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && message.hasOwnProperty("extendee")) + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && message.hasOwnProperty("label")) + if (message.label != null && Object.hasOwnProperty.call(message, "label")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && message.hasOwnProperty("typeName")) + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && message.hasOwnProperty("options")) + 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 && message.hasOwnProperty("oneofIndex")) + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); return writer; }; @@ -8649,7 +8649,7 @@ /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type - * @enum {string} + * @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 @@ -8695,7 +8695,7 @@ /** * Label enum. * @name google.protobuf.FieldDescriptorProto.Label - * @enum {string} + * @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 @@ -8776,9 +8776,9 @@ OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && message.hasOwnProperty("options")) + 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; }; @@ -9021,12 +9021,12 @@ EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + 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 && message.hasOwnProperty("options")) + 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) @@ -9329,9 +9329,9 @@ EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -9551,11 +9551,11 @@ EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && message.hasOwnProperty("options")) + 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; }; @@ -9789,12 +9789,12 @@ ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + 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 && message.hasOwnProperty("options")) + 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; }; @@ -10074,17 +10074,17 @@ MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && message.hasOwnProperty("inputType")) + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && message.hasOwnProperty("outputType")) + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && message.hasOwnProperty("options")) + 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 && message.hasOwnProperty("clientStreaming")) + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; @@ -10523,45 +10523,45 @@ FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + 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) @@ -10988,7 +10988,7 @@ /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode - * @enum {string} + * @enum {number} * @property {number} SPEED=1 SPEED value * @property {number} CODE_SIZE=2 CODE_SIZE value * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value @@ -11106,18 +11106,18 @@ MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + 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 && message.hasOwnProperty(".google.api.resource")) + 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; }; @@ -11459,17 +11459,17 @@ FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ctype != null && message.hasOwnProperty("ctype")) + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && message.hasOwnProperty("packed")) + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && message.hasOwnProperty("lazy")) + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && message.hasOwnProperty("jstype")) + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && message.hasOwnProperty("weak")) + 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) @@ -11480,7 +11480,7 @@ writer.int32(message[".google.api.fieldBehavior"][i]); writer.ldelim(); } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + 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; }; @@ -11816,7 +11816,7 @@ /** * CType enum. * @name google.protobuf.FieldOptions.CType - * @enum {string} + * @enum {number} * @property {number} STRING=0 STRING value * @property {number} CORD=1 CORD value * @property {number} STRING_PIECE=2 STRING_PIECE value @@ -11832,7 +11832,7 @@ /** * JSType enum. * @name google.protobuf.FieldOptions.JSType - * @enum {string} + * @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 @@ -12131,9 +12131,9 @@ EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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) @@ -12376,7 +12376,7 @@ EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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) @@ -12625,14 +12625,14 @@ ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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 && message.hasOwnProperty(".google.api.defaultHost")) + 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 && message.hasOwnProperty(".google.api.oauthScopes")) + 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; }; @@ -12920,19 +12920,19 @@ MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + 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 && message.hasOwnProperty(".google.longrunning.operationInfo")) + 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 && message.hasOwnProperty(".google.api.http")) + 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; }; @@ -13182,7 +13182,7 @@ /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {string} + * @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 @@ -13312,17 +13312,17 @@ 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 && message.hasOwnProperty("identifierValue")) + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; @@ -14099,9 +14099,9 @@ writer.int32(message.span[i]); writer.ldelim(); } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + 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) @@ -14632,11 +14632,11 @@ writer.int32(message.path[i]); writer.ldelim(); } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && message.hasOwnProperty("begin")) + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; @@ -14889,9 +14889,9 @@ Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type_url != null && message.hasOwnProperty("type_url")) + 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 && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; @@ -15108,9 +15108,9 @@ Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -15695,9 +15695,9 @@ Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -16172,15 +16172,15 @@ Operation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && message.hasOwnProperty("metadata")) + 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 && message.hasOwnProperty("done")) + if (message.done != null && Object.hasOwnProperty.call(message, "done")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && message.hasOwnProperty("error")) + 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 && message.hasOwnProperty("response")) + 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; }; @@ -16440,7 +16440,7 @@ GetOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -16654,13 +16654,13 @@ ListOperationsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); return writer; }; @@ -16894,7 +16894,7 @@ 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 && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -17112,7 +17112,7 @@ CancelOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -17299,7 +17299,7 @@ DeleteOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -17495,9 +17495,9 @@ WaitOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && message.hasOwnProperty("timeout")) + 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; }; @@ -17710,9 +17710,9 @@ OperationInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.responseType != null && message.hasOwnProperty("responseType")) + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); return writer; }; @@ -17942,9 +17942,9 @@ Status.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && message.hasOwnProperty("message")) + 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) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 832ae7bb6df..b93cfab07d2 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -3,8 +3,16 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-memcache.git", - "sha": "b94475604010e4f4b0eb2c5676c9fdb58290bbbd" + "remote": "https://github.com/googleapis/nodejs-memcache.git", + "sha": "22562276b0f53e338b3fc925d8830879261f8209" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "a3a0bf0f6291d69f2ff3df7fcd63d28ee20ac727", + "internalRef": "310060413" } }, { From 90888daf50f8a6b0cd91e56a4e03212cbcf45c32 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 8 May 2020 11:27:38 -0700 Subject: [PATCH 019/152] build: do not fail builds on codecov errors (#528) (#26) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/2f68300a-9812-4342-86c6-33ab267ece4f/targets Source-Link: https://github.com/googleapis/synthtool/commit/be74d3e532faa47eb59f1a0eaebde0860d1d8ab4 --- packages/google-cloud-memcache/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index b93cfab07d2..b0cca51ccd1 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "22562276b0f53e338b3fc925d8830879261f8209" + "sha": "be4a1ac254a42d9a91bf64adb8ab7d71cf9ccb34" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" + "sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4" } } ], From 7e85b0161430b4f88ffe09a1b8177178f1c10976 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Jun 2020 17:42:44 -0700 Subject: [PATCH 020/152] build: update protos.js (#27) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/041f5df7-f5d3-4b2a-9ede-0752bf41c185/targets --- .../google-cloud-memcache/protos/protos.d.ts | 6 +++++ .../google-cloud-memcache/protos/protos.js | 26 +++++++++++++++++-- .../google-cloud-memcache/protos/protos.json | 6 ++++- packages/google-cloud-memcache/synth.metadata | 2 +- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-memcache/protos/protos.d.ts b/packages/google-cloud-memcache/protos/protos.d.ts index 16656f5152a..1fff6ab59f4 100644 --- a/packages/google-cloud-memcache/protos/protos.d.ts +++ b/packages/google-cloud-memcache/protos/protos.d.ts @@ -3220,6 +3220,9 @@ export namespace google { /** FieldDescriptorProto options */ options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); } /** Represents a FieldDescriptorProto. */ @@ -3261,6 +3264,9 @@ export namespace google { /** 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 diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index 06d488af75d..4096078d10e 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/protos/protos.js @@ -8163,6 +8163,7 @@ * @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 */ /** @@ -8260,6 +8261,14 @@ */ 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 @@ -8304,6 +8313,8 @@ 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; }; @@ -8368,6 +8379,9 @@ 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; @@ -8462,6 +8476,9 @@ if (error) return "options." + error; } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; return null; }; @@ -8584,6 +8601,8 @@ 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; }; @@ -8611,6 +8630,7 @@ object.options = null; object.oneofIndex = 0; object.jsonName = ""; + object.proto3Optional = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -8632,6 +8652,8 @@ 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; }; @@ -10425,7 +10447,7 @@ * @memberof google.protobuf.FileOptions * @instance */ - FileOptions.prototype.ccEnableArenas = false; + FileOptions.prototype.ccEnableArenas = true; /** * FileOptions objcClassPrefix. @@ -10911,7 +10933,7 @@ object.javaGenerateEqualsAndHash = false; object.deprecated = false; object.javaStringCheckUtf8 = false; - object.ccEnableArenas = false; + object.ccEnableArenas = true; object.objcClassPrefix = ""; object.csharpNamespace = ""; object.swiftPrefix = ""; diff --git a/packages/google-cloud-memcache/protos/protos.json b/packages/google-cloud-memcache/protos/protos.json index 525b6cf1c5d..221849330d7 100644 --- a/packages/google-cloud-memcache/protos/protos.json +++ b/packages/google-cloud-memcache/protos/protos.json @@ -947,6 +947,10 @@ "options": { "type": "FieldOptions", "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 } }, "nested": { @@ -1182,7 +1186,7 @@ "type": "bool", "id": 31, "options": { - "default": false + "default": true } }, "objcClassPrefix": { diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index b0cca51ccd1..1627df2548d 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "be4a1ac254a42d9a91bf64adb8ab7d71cf9ccb34" + "sha": "2254747f6de3ff6ac5f1db2e091e501ce7140c39" } }, { From 55c6bf82d929e12b3618390a5eea6d240cfd5e1b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2020 10:35:33 -0700 Subject: [PATCH 021/152] chore: release 1.1.0 (#24) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-memcache/CHANGELOG.md | 12 ++++++++++++ packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index 1187950d3f0..b492541453e 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.1.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.0.0...v1.1.0) (2020-06-04) + + +### Features + +* check status of long running operation by its name ([#23](https://www.github.com/googleapis/nodejs-memcache/issues/23)) ([2256227](https://www.github.com/googleapis/nodejs-memcache/commit/22562276b0f53e338b3fc925d8830879261f8209)) + + +### Bug Fixes + +* remove eslint, update gax, fix generated protos, run the generator ([#13](https://www.github.com/googleapis/nodejs-memcache/issues/13)) ([93da9fb](https://www.github.com/googleapis/nodejs-memcache/commit/93da9fbf2da01ba4ba8caf6d3403cc08093dd5aa)) + ## 1.0.0 (2020-04-03) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 704e02cdeb6..eef04efa7e3 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "1.0.0", + "version": "1.1.0", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index e7948f57517..75249f870e3 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^1.0.0" + "@google-cloud/memcache": "^1.1.0" }, "devDependencies": { "c8": "^7.0.0", From c61ba62bb422f924f316f053823f0e043adfd4da Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 9 Jun 2020 17:41:17 -0700 Subject: [PATCH 022/152] feat: move ts target to es2018 from es2016 (#30) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/9b55eba7-85ee-48d5-a737-8b677439db4d/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/1c92077459db3dc50741e878f98b08c6261181e0 --- packages/google-cloud-memcache/protos/protos.js | 2 +- .../src/v1beta2/cloud_memcache_client.ts | 7 +++++++ packages/google-cloud-memcache/synth.metadata | 4 ++-- packages/google-cloud-memcache/tsconfig.json | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index 4096078d10e..534cc57f67f 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots._google_cloud_memcache_1_0_0_protos || ($protobuf.roots._google_cloud_memcache_1_0_0_protos = {}); + var $root = $protobuf.roots._google_cloud_memcache_protos || ($protobuf.roots._google_cloud_memcache_protos = {}); $root.google = (function() { diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index 59b3449de61..20cc94bebfc 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -115,6 +115,13 @@ export class CloudMemcacheClient { } opts.servicePath = opts.servicePath || servicePath; opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; const isBrowser = typeof window !== 'undefined'; diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 1627df2548d..4fd0eeb269c 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "2254747f6de3ff6ac5f1db2e091e501ce7140c39" + "sha": "d3356b50e0a6c1805cef20dc449bfcc229d1748e" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4" + "sha": "1c92077459db3dc50741e878f98b08c6261181e0" } } ], diff --git a/packages/google-cloud-memcache/tsconfig.json b/packages/google-cloud-memcache/tsconfig.json index 613d35597b5..c78f1c884ef 100644 --- a/packages/google-cloud-memcache/tsconfig.json +++ b/packages/google-cloud-memcache/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "build", "resolveJsonModule": true, "lib": [ - "es2016", + "es2018", "dom" ] }, From 64542ec380393df12c4d238b532f03d9d4dadd5c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 11 Jun 2020 17:47:10 +0200 Subject: [PATCH 023/152] chore(deps): update dependency mocha to v8 (#32) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [mocha](https://mochajs.org/) ([source](https://togithub.com/mochajs/mocha)) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/mocha/7.2.0/8.0.1) | --- ### Release Notes
mochajs/mocha ### [`v8.0.1`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​801--2020-06-10) [Compare Source](https://togithub.com/mochajs/mocha/compare/v8.0.0...v8.0.1) The obligatory patch after a major. #### :bug: Fixes - [#​4328](https://togithub.com/mochajs/mocha/issues/4328): Fix `--parallel` when combined with `--watch` ([**@​boneskull**](https://togithub.com/boneskull)) ### [`v8.0.0`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​800--2020-06-10) [Compare Source](https://togithub.com/mochajs/mocha/compare/v7.2.0...v8.0.0) In this major release, Mocha adds the ability to _run tests in parallel_. Better late than never! Please note the **breaking changes** detailed below. Let's welcome [**@​giltayar**](https://togithub.com/giltayar) and [**@​nicojs**](https://togithub.com/nicojs) to the maintenance team! #### :boom: Breaking Changes - [#​4164](https://togithub.com/mochajs/mocha/issues/4164): **Mocha v8.0.0 now requires Node.js v10.0.0 or newer.** Mocha no longer supports the Node.js v8.x line ("Carbon"), which entered End-of-Life at the end of 2019 ([**@​UlisesGascon**](https://togithub.com/UlisesGascon)) - [#​4175](https://togithub.com/mochajs/mocha/issues/4175): Having been deprecated with a warning since v7.0.0, **`mocha.opts` is no longer supported** ([**@​juergba**](https://togithub.com/juergba)) :sparkles: **WORKAROUND:** Replace `mocha.opts` with a [configuration file](https://mochajs.org/#configuring-mocha-nodejs). - [#​4260](https://togithub.com/mochajs/mocha/issues/4260): Remove `enableTimeout()` (`this.enableTimeout()`) from the context object ([**@​craigtaub**](https://togithub.com/craigtaub)) :sparkles: **WORKAROUND:** Replace usage of `this.enableTimeout(false)` in your tests with `this.timeout(0)`. - [#​4315](https://togithub.com/mochajs/mocha/issues/4315): The `spec` option no longer supports a comma-delimited list of files ([**@​juergba**](https://togithub.com/juergba)) :sparkles: **WORKAROUND**: Use an array instead (e.g., `"spec": "foo.js,bar.js"` becomes `"spec": ["foo.js", "bar.js"]`). - [#​4309](https://togithub.com/mochajs/mocha/issues/4309): Drop support for Node.js v13.x line, which is now End-of-Life ([**@​juergba**](https://togithub.com/juergba)) - [#​4282](https://togithub.com/mochajs/mocha/issues/4282): `--forbid-only` will throw an error even if exclusive tests are avoided via `--grep` or other means ([**@​arvidOtt**](https://togithub.com/arvidOtt)) - [#​4223](https://togithub.com/mochajs/mocha/issues/4223): The context object's `skip()` (`this.skip()`) in a "before all" (`before()`) hook will no longer execute subsequent sibling hooks, in addition to hooks in child suites ([**@​juergba**](https://togithub.com/juergba)) - [#​4178](https://togithub.com/mochajs/mocha/issues/4178): Remove previously soft-deprecated APIs ([**@​wnghdcjfe**](https://togithub.com/wnghdcjfe)): - `Mocha.prototype.ignoreLeaks()` - `Mocha.prototype.useColors()` - `Mocha.prototype.useInlineDiffs()` - `Mocha.prototype.hideDiff()` #### :tada: Enhancements - [#​4245](https://togithub.com/mochajs/mocha/issues/4245): Add ability to run tests in parallel for Node.js (see [docs](https://mochajs.org/#parallel-tests)) ([**@​boneskull**](https://togithub.com/boneskull)) :exclamation: See also [#​4244](https://togithub.com/mochajs/mocha/issues/4244); [Root Hook Plugins (docs)](https://mochajs.org/#root-hook-plugins) -- _root hooks must be defined via Root Hook Plugins to work in parallel mode_ - [#​4304](https://togithub.com/mochajs/mocha/issues/4304): `--require` now works with ES modules ([**@​JacobLey**](https://togithub.com/JacobLey)) - [#​4299](https://togithub.com/mochajs/mocha/issues/4299): In some circumstances, Mocha can run ES modules under Node.js v10 -- _use at your own risk!_ ([**@​giltayar**](https://togithub.com/giltayar)) #### :book: Documentation - [#​4246](https://togithub.com/mochajs/mocha/issues/4246): Add documentation for parallel mode and Root Hook plugins ([**@​boneskull**](https://togithub.com/boneskull)) #### :bug: Fixes (All bug fixes in Mocha v8.0.0 are also breaking changes, and are listed above)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-memcache). --- packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index eef04efa7e3..9d56806e3de 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -39,7 +39,7 @@ "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.0.4", - "mocha": "^7.0.0", + "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index 75249f870e3..deb78369b07 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -18,6 +18,6 @@ "devDependencies": { "c8": "^7.0.0", "chai": "^4.2.0", - "mocha": "^7.0.0" + "mocha": "^8.0.0" } } From aefd365c52198f4017dd2e0b26b0e1a3f1b72f85 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 11 Jun 2020 09:59:53 -0700 Subject: [PATCH 024/152] chore(nodejs_templates): add script logging to node_library populate-secrets.sh (#34) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/e306327b-605f-4c07-9420-c106e40c47d5/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/e7034945fbdc0e79d3c57f6e299e5c90b0f11469 --- packages/google-cloud-memcache/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 4fd0eeb269c..14b34ada90b 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "d3356b50e0a6c1805cef20dc449bfcc229d1748e" + "sha": "086b37f5d49f26c137bcc0941d6ec80f7ceb17fb" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1c92077459db3dc50741e878f98b08c6261181e0" + "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469" } } ], From a62ce4e3f3c3737b8262df758b34ab15fffca92b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 15 Jun 2020 11:21:13 -0700 Subject: [PATCH 025/152] fix: proper fallback option handling autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. --- .../src/v1beta2/cloud_memcache_client.ts | 13 +++++-------- packages/google-cloud-memcache/synth.metadata | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index 20cc94bebfc..8164faf1b4d 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -124,14 +124,11 @@ export class CloudMemcacheClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the CloudMemcacheClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 14b34ada90b..58f1ffbc86b 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "086b37f5d49f26c137bcc0941d6ec80f7ceb17fb" + "sha": "158ab54df0c271522791b5540a2b0ed16536b6fc" } }, { From 3261143618ce6dc1525e13f2c557b1f70d746b90 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 18 Jun 2020 07:49:07 -0700 Subject: [PATCH 026/152] chore: update node issue template (#36) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/37f383f8-7560-459e-b66c-def10ff830cb/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/b10590a4a1568548dd13cfcea9aa11d40898144b --- packages/google-cloud-memcache/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 58f1ffbc86b..5e610cdb23e 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "158ab54df0c271522791b5540a2b0ed16536b6fc" + "sha": "7515a7e680ee87f63e344eab63a74522f4cf1720" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469" + "sha": "b10590a4a1568548dd13cfcea9aa11d40898144b" } } ], From 129721e7683938f0424fb1f6e83e6b8a83acf94b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 27 Jun 2020 17:46:32 -0700 Subject: [PATCH 027/152] build: add config .gitattributes (#37) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/2a81bca4-7abd-4108-ac1f-21340f858709/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/dc9caca650c77b7039e2bbc3339ffb34ae78e5b7 --- packages/google-cloud-memcache/.gitattributes | 3 +++ packages/google-cloud-memcache/synth.metadata | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-memcache/.gitattributes diff --git a/packages/google-cloud-memcache/.gitattributes b/packages/google-cloud-memcache/.gitattributes new file mode 100644 index 00000000000..2e63216ae9c --- /dev/null +++ b/packages/google-cloud-memcache/.gitattributes @@ -0,0 +1,3 @@ +*.ts text eol=lf +*.js test eol=lf +protos/* linguist-generated diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 5e610cdb23e..599442c8e98 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "7515a7e680ee87f63e344eab63a74522f4cf1720" + "sha": "52a6c3b00514ed87e1e09cc04f12682be96eae07" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "b10590a4a1568548dd13cfcea9aa11d40898144b" + "sha": "dc9caca650c77b7039e2bbc3339ffb34ae78e5b7" } } ], From 3f95cbe4cce0b4cc01c66b2460fe312078b12a8a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2020 15:05:28 -0700 Subject: [PATCH 028/152] chore: release 1.2.0 (#31) --- packages/google-cloud-memcache/CHANGELOG.md | 12 ++++++++++++ packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index b492541453e..add7ac744fd 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.2.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.1.0...v1.2.0) (2020-06-28) + + +### Features + +* move ts target to es2018 from es2016 ([#30](https://www.github.com/googleapis/nodejs-memcache/issues/30)) ([086b37f](https://www.github.com/googleapis/nodejs-memcache/commit/086b37f5d49f26c137bcc0941d6ec80f7ceb17fb)) + + +### Bug Fixes + +* proper fallback option handling ([7515a7e](https://www.github.com/googleapis/nodejs-memcache/commit/7515a7e680ee87f63e344eab63a74522f4cf1720)) + ## [1.1.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.0.0...v1.1.0) (2020-06-04) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 9d56806e3de..ae154378acb 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "1.1.0", + "version": "1.2.0", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index deb78369b07..e925ec3f5d3 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^1.1.0" + "@google-cloud/memcache": "^1.2.0" }, "devDependencies": { "c8": "^7.0.0", From 80bd9b4d0ad885a998392143b8c0304f769602d0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 30 Jun 2020 21:20:51 -0700 Subject: [PATCH 029/152] docs: Change relative URLs to absolute URLs to fix broken links. (#33) PiperOrigin-RevId: 315786558 Source-Author: Google APIs Source-Date: Wed Jun 10 15:57:14 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 81226871ce438cdeec241dd81f33f796e37e1c03 Source-Link: https://github.com/googleapis/googleapis/commit/81226871ce438cdeec241dd81f33f796e37e1c03 Co-authored-by: Justin Beckwith --- .../protos/google/cloud/memcache/v1beta2/cloud_memcache.proto | 2 +- packages/google-cloud-memcache/synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto b/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto index 5d75ae49eda..56bd2ef78c5 100644 --- a/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto +++ b/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto @@ -244,7 +244,7 @@ message Instance { map labels = 3; // Optional. The full name of the Google Compute Engine - // [network](/compute/docs/networks-and-firewalls#networks) to which the + // [network](https://cloud.google.com/vpc/docs/vpc) to which the // instance is connected. If left unspecified, the `default` network // will be used. string authorized_network = 4; diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 599442c8e98..54f07ceb72f 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -11,8 +11,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a3a0bf0f6291d69f2ff3df7fcd63d28ee20ac727", - "internalRef": "310060413" + "sha": "81226871ce438cdeec241dd81f33f796e37e1c03", + "internalRef": "315786558" } }, { From fc3d45dc3c2b56fd0d86a2d44876eef1eba3800b Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 6 Jul 2020 10:16:50 -0700 Subject: [PATCH 030/152] build: use bazel build (#38) --- packages/google-cloud-memcache/synth.metadata | 18 +++++------------- packages/google-cloud-memcache/synth.py | 12 ++---------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 54f07ceb72f..ed37796e69b 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "52a6c3b00514ed87e1e09cc04f12682be96eae07" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "81226871ce438cdeec241dd81f33f796e37e1c03", - "internalRef": "315786558" + "remote": "git@github.com:googleapis/nodejs-memcache.git", + "sha": "b3018cec72d504a55febe6edfe48cf76a514f11f" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "dc9caca650c77b7039e2bbc3339ffb34ae78e5b7" + "sha": "303271797a360f8a439203413f13a160f2f5b3b4" } } ], @@ -29,8 +21,8 @@ "source": "googleapis", "apiName": "memcache", "apiVersion": "v1beta2", - "language": "typescript", - "generator": "gapic-generator-typescript" + "language": "nodejs", + "generator": "bazel" } } ] diff --git a/packages/google-cloud-memcache/synth.py b/packages/google-cloud-memcache/synth.py index 591d61d4e46..790d1e95f40 100644 --- a/packages/google-cloud-memcache/synth.py +++ b/packages/google-cloud-memcache/synth.py @@ -21,19 +21,11 @@ logging.basicConfig(level=logging.DEBUG) # run the gapic generator -gapic = gcp.GAPICMicrogenerator() +gapic = gcp.GAPICBazel() versions = ['v1beta2'] name = 'memcache' for version in versions: - library = gapic.typescript_library( - name, - generator_args={ - "grpc-service-config": f"google/cloud/{name}/{version}/{name}_grpc_service_config.json", - 'package-name': '@google-cloud/memcache', - }, - extra_proto_files=['google/cloud/common_resources.proto'], - proto_path=f'/google/cloud/{name}/{version}', - version=version) + library = gapic.node_library(name, version) s.copy(library, excludes=['package.json', 'README.md']) # Copy common templates From 3eb025afdf11de3fddda31025e6f2bb8455fbcc0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 9 Jul 2020 23:26:15 -0700 Subject: [PATCH 031/152] build: typeo in nodejs .gitattribute (#41) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/cc99acfa-05b8-434b-9500-2f6faf2eaa02/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b --- packages/google-cloud-memcache/.gitattributes | 2 +- packages/google-cloud-memcache/synth.metadata | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-memcache/.gitattributes b/packages/google-cloud-memcache/.gitattributes index 2e63216ae9c..d4f4169b28b 100644 --- a/packages/google-cloud-memcache/.gitattributes +++ b/packages/google-cloud-memcache/.gitattributes @@ -1,3 +1,3 @@ *.ts text eol=lf -*.js test eol=lf +*.js text eol=lf protos/* linguist-generated diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index ed37796e69b..dcd83c9ba33 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -3,15 +3,23 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-memcache.git", - "sha": "b3018cec72d504a55febe6edfe48cf76a514f11f" + "remote": "https://github.com/googleapis/nodejs-memcache.git", + "sha": "97b9345a4bb2ae1ac26edbc80ba19d927c2d331c" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "4f4aa3a03e470f1390758b9d89eb1aa88837a5be", + "internalRef": "320300472" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "303271797a360f8a439203413f13a160f2f5b3b4" + "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" } } ], From 5c2d46ea88da64c31fb098229e5b299495d538ce Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jul 2020 18:51:08 +0200 Subject: [PATCH 032/152] chore(deps): update dependency ts-loader to v8 (#40) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/ts-loader/7.0.5/8.0.0) | --- ### Release Notes
TypeStrong/ts-loader ### [`v8.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v800) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v7.0.5...v8.0.0) - [Support for symlinks in project references](https://togithub.com/TypeStrong/ts-loader/pull/1136) - thanks [@​sheetalkamat](https://togithub.com/sheetalkamat)! - `ts-loader` now supports TypeScript 3.6 and greater **BREAKING CHANGE**
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index ae154378acb..e265cfed484 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -43,7 +43,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", - "ts-loader": "^7.0.0", + "ts-loader": "^8.0.0", "typescript": "~3.8.3", "webpack": "^4.42.1", "webpack-cli": "^3.3.11" From e4f32e92a629d1b8ce78a9bb8441992960cfb863 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 12 Jul 2020 18:47:05 +0200 Subject: [PATCH 033/152] chore(deps): update dependency @types/mocha to v8 (#42) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/mocha](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/@types%2fmocha/7.0.2/8.0.0) | --- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index e265cfed484..66348f2f8f7 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -30,7 +30,7 @@ "google-gax": "^2.1.0" }, "devDependencies": { - "@types/mocha": "^7.0.0", + "@types/mocha": "^8.0.0", "@types/node": "^12.12.34", "@types/sinon": "^9.0.0", "c8": "^7.1.0", From 087fee8e7eec371cec880766855c4134ddf0d56e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 15 Jul 2020 16:21:17 -0700 Subject: [PATCH 034/152] build: fix typo in publish script (#45) * changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * build: missing closing paren in publish script Source-Author: Benjamin E. Coe Source-Date: Mon Jul 13 09:56:30 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: d82deccf657a66e31bd5da9efdb96c6fa322fc7e Source-Link: https://github.com/googleapis/synthtool/commit/d82deccf657a66e31bd5da9efdb96c6fa322fc7e * chore: delete template for Node 8 tests Source-Author: F. Hinkelmann Source-Date: Tue Jul 14 19:56:02 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 388e10f5ae302d3e8de1fac99f3a95d1ab8f824a Source-Link: https://github.com/googleapis/synthtool/commit/388e10f5ae302d3e8de1fac99f3a95d1ab8f824a --- .../google-cloud-memcache/protos/protos.js | 72 +++++++++++++++---- packages/google-cloud-memcache/synth.metadata | 4 +- 2 files changed, 59 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index 534cc57f67f..b0da97bd3c3 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/protos/protos.js @@ -593,7 +593,7 @@ 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.memcache.v1beta2.Instance(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.Instance(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -604,12 +604,26 @@ message.displayName = reader.string(); break; case 3: - reader.skip().pos++; if (message.labels === $util.emptyObject) message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); + 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 4: message.authorizedNetwork = reader.string(); @@ -3780,7 +3794,7 @@ MemcacheParameters.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.MemcacheParameters(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.MemcacheParameters(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3788,12 +3802,26 @@ message.id = reader.string(); break; case 3: - reader.skip().pos++; if (message.params === $util.emptyObject) message.params = {}; - key = reader.string(); - reader.pos++; - message.params[key] = reader.string(); + 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.params[key] = value; break; default: reader.skipType(tag & 7); @@ -4346,17 +4374,31 @@ LocationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.LocationMetadata(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.LocationMetadata(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - reader.skip().pos++; if (message.availableZones === $util.emptyObject) message.availableZones = {}; - key = reader.string(); - reader.pos++; - message.availableZones[key] = $root.google.cloud.memcache.v1beta2.ZoneMetadata.decode(reader, reader.uint32()); + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.memcache.v1beta2.ZoneMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.availableZones[key] = value; break; default: reader.skipType(tag & 7); diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index dcd83c9ba33..6fb003a8c59 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "97b9345a4bb2ae1ac26edbc80ba19d927c2d331c" + "sha": "baa848e3012e46073f2d7a669b6b01e23eaf8966" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" + "sha": "388e10f5ae302d3e8de1fac99f3a95d1ab8f824a" } } ], From 4db574f8566db803fe1e74d708d53e748318885d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 17 Jul 2020 15:17:53 -0700 Subject: [PATCH 035/152] chore: add config files for cloud-rad for node.js (#46) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/5e903fff-57bb-4395-bb94-8b4d1909dbf6/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/21f1470ecd01424dc91c70f1a7c798e4e87d1eec --- .../google-cloud-memcache/api-extractor.json | 369 ++++++++++++++++++ packages/google-cloud-memcache/synth.metadata | 4 +- 2 files changed, 371 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-memcache/api-extractor.json diff --git a/packages/google-cloud-memcache/api-extractor.json b/packages/google-cloud-memcache/api-extractor.json new file mode 100644 index 00000000000..de228294b23 --- /dev/null +++ b/packages/google-cloud-memcache/api-extractor.json @@ -0,0 +1,369 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "extends": "./shared/api-extractor-base.json" + // "extends": "my-package/include/api-extractor-base.json" + + /** + * Determines the "" token that can be used with other config file settings. The project folder + * typically contains the tsconfig.json and package.json config files, but the path is user-defined. + * + * The path is resolved relative to the folder of the config file that contains the setting. + * + * The default value for "projectFolder" is the token "", which means the folder is determined by traversing + * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder + * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error + * will be reported. + * + * SUPPORTED TOKENS: + * DEFAULT VALUE: "" + */ + // "projectFolder": "..", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "/protos/protos.d.ts", + + /** + * A list of NPM package names whose exports should be treated as part of this package. + * + * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", + * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part + * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly + * imports library2. To avoid this, we can specify: + * + * "bundledPackages": [ "library2" ], + * + * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been + * local files for library1. + */ + "bundledPackages": [ ], + + /** + * Determines how the TypeScript compiler engine will be invoked by API Extractor. + */ + "compiler": { + /** + * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * Note: This setting will be ignored if "overrideTsconfig" is used. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/tsconfig.json" + */ + // "tsconfigFilePath": "/tsconfig.json", + + /** + * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. + * The object must conform to the TypeScript tsconfig schema: + * + * http://json.schemastore.org/tsconfig + * + * If omitted, then the tsconfig.json file will be read from the "projectFolder". + * + * DEFAULT VALUE: no overrideTsconfig section + */ + // "overrideTsconfig": { + // . . . + // } + + /** + * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended + * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when + * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses + * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. + * + * DEFAULT VALUE: false + */ + // "skipLibCheck": true, + }, + + /** + * Configures how the API report file (*.api.md) will be generated. + */ + "apiReport": { + /** + * (REQUIRED) Whether to generate an API report. + */ + "enabled": true, + + /** + * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce + * a full file path. + * + * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". + * + * SUPPORTED TOKENS: , + * DEFAULT VALUE: ".api.md" + */ + // "reportFileName": ".api.md", + + /** + * Specifies the folder where the API report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, + * e.g. for an API review. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/etc/" + */ + // "reportFolder": "/etc/", + + /** + * Specifies the folder where the temporary report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * After the temporary file is written to disk, it is compared with the file in the "reportFolder". + * If they are different, a production build will fail. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + // "reportTempFolder": "/temp/" + }, + + /** + * Configures how the doc model file (*.api.json) will be generated. + */ + "docModel": { + /** + * (REQUIRED) Whether to generate a doc model file. + */ + "enabled": true, + + /** + * The output path for the doc model file. The file extension should be ".api.json". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/.api.json" + */ + // "apiJsonFilePath": "/temp/.api.json" + }, + + /** + * Configures how the .d.ts rollup file will be generated. + */ + "dtsRollup": { + /** + * (REQUIRED) Whether to generate the .d.ts rollup file. + */ + "enabled": true, + + /** + * Specifies the output path for a .d.ts rollup file to be generated without any trimming. + * This file will include all declarations that are exported by the main entry point. + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/dist/.d.ts" + */ + // "untrimmedFilePath": "/dist/.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. + * This file will include only declarations that are marked as "@public" or "@beta". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "betaTrimmedFilePath": "/dist/-beta.d.ts", + + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. + * This file will include only declarations that are marked as "@public". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "publicTrimmedFilePath": "/dist/-public.d.ts", + + /** + * When a declaration is trimmed, by default it will be replaced by a code comment such as + * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the + * declaration completely. + * + * DEFAULT VALUE: false + */ + // "omitTrimmingComments": true + }, + + /** + * Configures how the tsdoc-metadata.json file will be generated. + */ + "tsdocMetadata": { + /** + * Whether to generate the tsdoc-metadata.json file. + * + * DEFAULT VALUE: true + */ + // "enabled": true, + + /** + * Specifies where the TSDoc metadata file should be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", + * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup + * falls back to "tsdoc-metadata.json" in the package folder. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + }, + + /** + * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files + * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. + * To use the OS's default newline kind, specify "os". + * + * DEFAULT VALUE: "crlf" + */ + // "newlineKind": "crlf", + + /** + * Configures how API Extractor reports error and warning messages produced during analysis. + * + * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. + */ + "messages": { + /** + * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing + * the input .d.ts files. + * + * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "compilerMessageReporting": { + /** + * Configures the default routing for messages that don't match an explicit rule in this table. + */ + "default": { + /** + * Specifies whether the message should be written to the the tool's output log. Note that + * the "addToApiReportFile" property may supersede this option. + * + * Possible values: "error", "warning", "none" + * + * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail + * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes + * the "--local" option), the warning is displayed but the build will not fail. + * + * DEFAULT VALUE: "warning" + */ + "logLevel": "warning", + + /** + * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), + * then the message will be written inside that file; otherwise, the message is instead logged according to + * the "logLevel" option. + * + * DEFAULT VALUE: false + */ + // "addToApiReportFile": false + }, + + // "TS2551": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by API Extractor during its analysis. + * + * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" + * + * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings + */ + "extractorMessageReporting": { + "default": { + "logLevel": "warning", + // "addToApiReportFile": false + }, + + // "ae-extra-release-tag": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by the TSDoc parser when analyzing code comments. + * + * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "tsdocMessageReporting": { + "default": { + "logLevel": "warning", + // "addToApiReportFile": false + } + + // "tsdoc-link-tag-unescaped-text": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + } + } + +} diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 6fb003a8c59..1f11d02194b 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "baa848e3012e46073f2d7a669b6b01e23eaf8966" + "sha": "9e783c2578b4fa8883df13036ef0b9ae22451ccd" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "388e10f5ae302d3e8de1fac99f3a95d1ab8f824a" + "sha": "21f1470ecd01424dc91c70f1a7c798e4e87d1eec" } } ], From cf8a25157d7503544b5115b2cb1163fd3e9cb7d3 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Tue, 21 Jul 2020 14:44:35 -0400 Subject: [PATCH 036/152] chore: add dev dependencies for cloud-rad ref docs (#47) --- packages/google-cloud-memcache/package.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 66348f2f8f7..0381fc84ceb 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -24,7 +24,9 @@ "system-test": "c8 mocha build/system-test", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "test": "c8 mocha build/test", - "precompile": "gts clean" + "precompile": "gts clean", + "api-extractor": "api-extractor run --local", + "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { "google-gax": "^2.1.0" @@ -46,7 +48,9 @@ "ts-loader": "^8.0.0", "typescript": "~3.8.3", "webpack": "^4.42.1", - "webpack-cli": "^3.3.11" + "webpack-cli": "^3.3.11", + "@microsoft/api-documenter": "^7.8.10", + "@microsoft/api-extractor": "^7.8.10" }, "engines": { "node": ">=10.0.0" From d8c29b4f48b37cf99b225de9323b0864950a755f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 22 Jul 2020 17:22:04 -0700 Subject: [PATCH 037/152] build: rename _toc to toc (#48) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/ebeac31c-a4b0-40a0-8aaf-cbd1303779c1/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/99c93fe09f8c1dca09dfc0301c8668e3a70dd796 --- packages/google-cloud-memcache/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 1f11d02194b..622d909427d 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "9e783c2578b4fa8883df13036ef0b9ae22451ccd" + "sha": "ec9fd10e64e0c99ad208ec6232c76f73ee08d7b0" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "21f1470ecd01424dc91c70f1a7c798e4e87d1eec" + "sha": "99c93fe09f8c1dca09dfc0301c8668e3a70dd796" } } ], From 9e7f3038162d3d4f430b60076d6e80614f4e64d2 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 24 Jul 2020 13:36:18 -0700 Subject: [PATCH 038/152] chore: move gitattributes files to node templates (#49) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/d43b90cc-a087-4c57-864c-1e4f93292dc6/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3 --- packages/google-cloud-memcache/.gitattributes | 1 + packages/google-cloud-memcache/synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/.gitattributes b/packages/google-cloud-memcache/.gitattributes index d4f4169b28b..33739cb74e4 100644 --- a/packages/google-cloud-memcache/.gitattributes +++ b/packages/google-cloud-memcache/.gitattributes @@ -1,3 +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-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 622d909427d..75d9f507bb6 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "ec9fd10e64e0c99ad208ec6232c76f73ee08d7b0" + "sha": "c4af9a4cb12fc1f7fae50427ae99cfbcf45e2d7a" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "99c93fe09f8c1dca09dfc0301c8668e3a70dd796" + "sha": "3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3" } } ], From 09d875afe77ca3fcb44685f69d1045ff568d3e80 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 29 Jul 2020 16:36:17 -0700 Subject: [PATCH 039/152] chore(node): fix kokoro build path for cloud-rad (#50) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/4bdc1826-2f69-49f1-a63b-94f99cceb5ee/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa --- packages/google-cloud-memcache/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 75d9f507bb6..a107640cc84 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "c4af9a4cb12fc1f7fae50427ae99cfbcf45e2d7a" + "sha": "fd34fe7655eb82fd5fb3372dc1fd35e53a8a1827" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3" + "sha": "89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa" } } ], From 68eb0665be745a7dd395f4aa972546b63735ef67 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 30 Jul 2020 19:10:14 -0700 Subject: [PATCH 040/152] build: update protos (#51) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/b205fd33-200c-4298-88b8-18b0d1c79a3e/targets - [ ] To automatically regenerate this PR, check this box. --- packages/google-cloud-memcache/protos/protos.d.ts | 2 +- packages/google-cloud-memcache/protos/protos.js | 2 +- packages/google-cloud-memcache/synth.metadata | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-memcache/protos/protos.d.ts b/packages/google-cloud-memcache/protos/protos.d.ts index 1fff6ab59f4..6b807f4925a 100644 --- a/packages/google-cloud-memcache/protos/protos.d.ts +++ b/packages/google-cloud-memcache/protos/protos.d.ts @@ -13,7 +13,7 @@ // limitations under the License. import * as Long from "long"; -import * as $protobuf from "protobufjs"; +import {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index b0da97bd3c3..e4dee8edd60 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/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("protobufjs/minimal")); + module.exports = factory(require("google-gax").protobufMinimal); })(this, function($protobuf) { "use strict"; diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index a107640cc84..66865d6e2b6 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "fd34fe7655eb82fd5fb3372dc1fd35e53a8a1827" + "sha": "76ee3d12e8531f433ac8f8f83c8aca91372646a8" } }, { From c683124c3cba7592be21747782fe340bf295f3c1 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 2 Aug 2020 21:44:03 -0700 Subject: [PATCH 041/152] docs: add links to the CHANGELOG from the README.md for Java and Node (#52) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/7b446397-88f3-4463-9e7d-d2ce7069989d/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5936421202fb53ed4641bcb824017dd393a3dbcc --- packages/google-cloud-memcache/README.md | 3 +++ packages/google-cloud-memcache/synth.metadata | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md index 35cde352334..8af720a5d82 100644 --- a/packages/google-cloud-memcache/README.md +++ b/packages/google-cloud-memcache/README.md @@ -14,6 +14,9 @@ Memcache client for Node.js +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-memcache/blob/master/CHANGELOG.md). + * [Memorystore for Memcached Node.js Client API Reference][client-docs] * [Memorystore for Memcached Documentation][product-docs] * [github.com/googleapis/nodejs-memcache](https://github.com/googleapis/nodejs-memcache) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 66865d6e2b6..8b574364f8b 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "76ee3d12e8531f433ac8f8f83c8aca91372646a8" + "sha": "d7cbe93174bf955d0d7752330b83d5ea5d4e2421" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa" + "sha": "5936421202fb53ed4641bcb824017dd393a3dbcc" } } ], From cb1206366d2d90fddd3e4117cfcec2f34597b813 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 10 Aug 2020 10:56:33 -0700 Subject: [PATCH 042/152] build: --credential-file-override is no longer required (#54) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/4de22315-84b1-493d-8da2-dfa7688128f5/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/94421c47802f56a44c320257b2b4c190dc7d6b68 --- packages/google-cloud-memcache/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 8b574364f8b..a42ff119bfc 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "d7cbe93174bf955d0d7752330b83d5ea5d4e2421" + "sha": "3fb23ac0504badefe1b2d2b2cb88ae9c0f0e526f" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5936421202fb53ed4641bcb824017dd393a3dbcc" + "sha": "94421c47802f56a44c320257b2b4c190dc7d6b68" } } ], From f50a6105301cd63f576aecfe62f3e9e9a7324aaa Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 12 Aug 2020 09:38:08 -0700 Subject: [PATCH 043/152] chore: update cloud rad kokoro build job (#56) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/b742586e-df31-4aac-8092-78288e9ea8e7/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/bd0deaa1113b588d70449535ab9cbf0f2bd0e72f --- packages/google-cloud-memcache/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index a42ff119bfc..5b6e65e6598 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "3fb23ac0504badefe1b2d2b2cb88ae9c0f0e526f" + "sha": "9c1cda62ecc035d9b7b1e43557508f94ea2178bd" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "94421c47802f56a44c320257b2b4c190dc7d6b68" + "sha": "bd0deaa1113b588d70449535ab9cbf0f2bd0e72f" } } ], From 6912ececff81c1963491737081755333aa39aec2 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 12 Aug 2020 12:58:09 -0700 Subject: [PATCH 044/152] build: use gapic-generator-typescript v1.0.7. (#55) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/b742586e-df31-4aac-8092-78288e9ea8e7/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 325949033 Source-Link: https://github.com/googleapis/googleapis/commit/94006b3cb8d2fb44703cf535da15608eed6bf7db --- .../src/v1beta2/cloud_memcache_client.ts | 8 +++++--- packages/google-cloud-memcache/synth.metadata | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index 8164faf1b4d..b88913f0f99 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -338,12 +338,14 @@ export class CloudMemcacheClient { } ); + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 5b6e65e6598..28f92e367a3 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -11,8 +11,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4f4aa3a03e470f1390758b9d89eb1aa88837a5be", - "internalRef": "320300472" + "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", + "internalRef": "325949033" } }, { From 3d7d4666aee5eff4d76188d666883730e691593d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 13 Aug 2020 12:40:06 -0700 Subject: [PATCH 045/152] build: perform publish using Node 12 (#57) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/c36c6dbc-ab79-4f17-b70b-523b420b2a70/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5747555f7620113d9a2078a48f4c047a99d31b3e --- packages/google-cloud-memcache/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 28f92e367a3..17e774f4e73 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "9c1cda62ecc035d9b7b1e43557508f94ea2178bd" + "sha": "4ba5b7ab278fd042faff0ad167352193ca9336ae" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "bd0deaa1113b588d70449535ab9cbf0f2bd0e72f" + "sha": "5747555f7620113d9a2078a48f4c047a99d31b3e" } } ], From 9eff711355eccc15fd08ceb43503f800871ecaf8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 19 Aug 2020 09:43:03 -0700 Subject: [PATCH 046/152] chore: start tracking obsolete files (#58) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/7a1b0b96-8ddb-4836-a1a2-d2f73b7e6ffe/targets - [ ] To automatically regenerate this PR, check this box. --- packages/google-cloud-memcache/synth.metadata | 80 ++++++++++++++++++- 1 file changed, 76 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 17e774f4e73..ef56bac4b92 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "4ba5b7ab278fd042faff0ad167352193ca9336ae" + "sha": "f0009bd46ae596f07122691c0af4bff551105dad" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", - "internalRef": "325949033" + "sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb", + "internalRef": "327369997" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5747555f7620113d9a2078a48f4c047a99d31b3e" + "sha": "1a60ff2a3975c2f5054431588bd95db9c3b862ba" } } ], @@ -33,5 +33,77 @@ "generator": "bazel" } } + ], + "generatedFiles": [ + ".eslintignore", + ".eslintrc.json", + ".gitattributes", + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/ISSUE_TEMPLATE/support_request.md", + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/publish.yml", + ".github/release-please.yml", + ".github/workflows/ci.yaml", + ".gitignore", + ".jsdoc.js", + ".kokoro/.gitattributes", + ".kokoro/common.cfg", + ".kokoro/continuous/node10/common.cfg", + ".kokoro/continuous/node10/docs.cfg", + ".kokoro/continuous/node10/lint.cfg", + ".kokoro/continuous/node10/samples-test.cfg", + ".kokoro/continuous/node10/system-test.cfg", + ".kokoro/continuous/node10/test.cfg", + ".kokoro/continuous/node12/common.cfg", + ".kokoro/continuous/node12/test.cfg", + ".kokoro/docs.sh", + ".kokoro/lint.sh", + ".kokoro/populate-secrets.sh", + ".kokoro/presubmit/node10/common.cfg", + ".kokoro/presubmit/node10/samples-test.cfg", + ".kokoro/presubmit/node10/system-test.cfg", + ".kokoro/presubmit/node12/common.cfg", + ".kokoro/presubmit/node12/test.cfg", + ".kokoro/publish.sh", + ".kokoro/release/docs-devsite.cfg", + ".kokoro/release/docs-devsite.sh", + ".kokoro/release/docs.cfg", + ".kokoro/release/docs.sh", + ".kokoro/release/publish.cfg", + ".kokoro/samples-test.sh", + ".kokoro/system-test.sh", + ".kokoro/test.bat", + ".kokoro/test.sh", + ".kokoro/trampoline.sh", + ".mocharc.js", + ".nycrc", + ".prettierignore", + ".prettierrc.js", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "README.md", + "api-extractor.json", + "linkinator.config.json", + "package-lock.json.1593036559", + "protos/google/cloud/memcache/v1beta2/cloud_memcache.proto", + "protos/protos.d.ts", + "protos/protos.js", + "protos/protos.json", + "renovate.json", + "samples/README.md", + "samples/package-lock.json.1494703579", + "src/index.ts", + "src/v1beta2/cloud_memcache_client.ts", + "src/v1beta2/cloud_memcache_client_config.json", + "src/v1beta2/cloud_memcache_proto_list.json", + "src/v1beta2/index.ts", + "system-test/fixtures/sample/src/index.js", + "system-test/fixtures/sample/src/index.ts", + "system-test/install.ts", + "test/gapic_cloud_memcache_v1beta2.ts", + "tsconfig.json", + "webpack.config.js" ] } \ No newline at end of file From b2fd5c1428a617a682555182b614f262e20548b3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 21 Aug 2020 11:12:08 -0700 Subject: [PATCH 047/152] build: move system and samples test from Node 10 to Node 12 (#59) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/ba2d388f-b3b2-4ad7-a163-0c6b4d86894f/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/05de3e1e14a0b07eab8b474e669164dbd31f81fb --- packages/google-cloud-memcache/synth.metadata | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index ef56bac4b92..4a76c1883d2 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "f0009bd46ae596f07122691c0af4bff551105dad" + "sha": "e01b68fcc55a327deb0e08feb68f41f262b9819c" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1a60ff2a3975c2f5054431588bd95db9c3b862ba" + "sha": "05de3e1e14a0b07eab8b474e669164dbd31f81fb" } } ], @@ -51,19 +51,19 @@ ".kokoro/common.cfg", ".kokoro/continuous/node10/common.cfg", ".kokoro/continuous/node10/docs.cfg", - ".kokoro/continuous/node10/lint.cfg", - ".kokoro/continuous/node10/samples-test.cfg", - ".kokoro/continuous/node10/system-test.cfg", ".kokoro/continuous/node10/test.cfg", ".kokoro/continuous/node12/common.cfg", + ".kokoro/continuous/node12/lint.cfg", + ".kokoro/continuous/node12/samples-test.cfg", + ".kokoro/continuous/node12/system-test.cfg", ".kokoro/continuous/node12/test.cfg", ".kokoro/docs.sh", ".kokoro/lint.sh", ".kokoro/populate-secrets.sh", ".kokoro/presubmit/node10/common.cfg", - ".kokoro/presubmit/node10/samples-test.cfg", - ".kokoro/presubmit/node10/system-test.cfg", ".kokoro/presubmit/node12/common.cfg", + ".kokoro/presubmit/node12/samples-test.cfg", + ".kokoro/presubmit/node12/system-test.cfg", ".kokoro/presubmit/node12/test.cfg", ".kokoro/publish.sh", ".kokoro/release/docs-devsite.cfg", @@ -86,14 +86,12 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.1593036559", "protos/google/cloud/memcache/v1beta2/cloud_memcache.proto", "protos/protos.d.ts", "protos/protos.js", "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.1494703579", "src/index.ts", "src/v1beta2/cloud_memcache_client.ts", "src/v1beta2/cloud_memcache_client_config.json", From 76638f409a247023a598866d6007d908b972505f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 28 Aug 2020 10:02:28 -0700 Subject: [PATCH 048/152] build: track flaky tests for "nightly", add new secrets for tagging (#60) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/a8c1e885-336c-4636-8e00-e4134524f8ee/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/8cf6d2834ad14318e64429c3b94f6443ae83daf9 --- packages/google-cloud-memcache/synth.metadata | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 4a76c1883d2..3e01d5ce7d5 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "e01b68fcc55a327deb0e08feb68f41f262b9819c" + "sha": "12bc7d5f5979f502bdab5cd09366fbc4066b2fd4" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "05de3e1e14a0b07eab8b474e669164dbd31f81fb" + "sha": "8cf6d2834ad14318e64429c3b94f6443ae83daf9" } } ], @@ -42,7 +42,6 @@ ".github/ISSUE_TEMPLATE/feature_request.md", ".github/ISSUE_TEMPLATE/support_request.md", ".github/PULL_REQUEST_TEMPLATE.md", - ".github/publish.yml", ".github/release-please.yml", ".github/workflows/ci.yaml", ".gitignore", From cfaddbd4a48d3912bbf6507b96a46cf6c358201e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 12 Sep 2020 11:20:10 -0700 Subject: [PATCH 049/152] build(test): recursively find test files; fail on unsupported dependency versions (#63) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/0832b96d-f20d-428a-9244-9373d24004a9/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/fdd03c161003ab97657cc0218f25c82c89ddf4b6 --- packages/google-cloud-memcache/.mocharc.js | 3 ++- packages/google-cloud-memcache/synth.metadata | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-memcache/.mocharc.js b/packages/google-cloud-memcache/.mocharc.js index ff7b34fa5d1..0b600509bed 100644 --- a/packages/google-cloud-memcache/.mocharc.js +++ b/packages/google-cloud-memcache/.mocharc.js @@ -14,7 +14,8 @@ const config = { "enable-source-maps": true, "throw-deprecation": true, - "timeout": 10000 + "timeout": 10000, + "recursive": true } if (process.env.MOCHA_THROW_DEPRECATION === 'false') { delete config['throw-deprecation']; diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 3e01d5ce7d5..25ddfcc82c0 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "12bc7d5f5979f502bdab5cd09366fbc4066b2fd4" + "sha": "0e7eb7302a92900bc41450fcf1800dcbcc7f0ca0" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8cf6d2834ad14318e64429c3b94f6443ae83daf9" + "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" } } ], From ebfb47a8c14eb453508a211149c13cf7f6adc81b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 2 Oct 2020 08:10:03 -0700 Subject: [PATCH 050/152] chore: update bucket for cloud-rad (#64) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/abddcc47-cb76-4fc4-b8c1-feafeaf13e14/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/079dcce498117f9570cebe6e6cff254b38ba3860 --- packages/google-cloud-memcache/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 25ddfcc82c0..aa839d0199b 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "0e7eb7302a92900bc41450fcf1800dcbcc7f0ca0" + "sha": "5627715581320a6a106b078bd03187435a9504e8" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" + "sha": "079dcce498117f9570cebe6e6cff254b38ba3860" } } ], From eeb1cdbc824bbb60b4da4c78fd68ee500cc72a79 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 5 Oct 2020 10:42:54 -0700 Subject: [PATCH 051/152] build(node_library): migrate to Trampoline V2 (#65) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/1e3d0729-fe1f-4f75-babe-29f5584e5b6a/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9 --- packages/google-cloud-memcache/synth.metadata | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index aa839d0199b..a52301edb68 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "5627715581320a6a106b078bd03187435a9504e8" + "sha": "13c6e820fd8e7889ddaccceb8bff739ff5e4c4a0" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "079dcce498117f9570cebe6e6cff254b38ba3860" + "sha": "0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9" } } ], @@ -75,10 +75,12 @@ ".kokoro/test.bat", ".kokoro/test.sh", ".kokoro/trampoline.sh", + ".kokoro/trampoline_v2.sh", ".mocharc.js", ".nycrc", ".prettierignore", ".prettierrc.js", + ".trampolinerc", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "LICENSE", From 72537d0e6fc48e34eaff350133e837435e69cb76 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 12 Oct 2020 21:54:26 +0200 Subject: [PATCH 052/152] chore(deps): update dependency webpack-cli to v4 (#68) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [webpack-cli](https://togithub.com/webpack/webpack-cli) | devDependencies | major | [`^3.3.11` -> `^4.0.0`](https://renovatebot.com/diffs/npm/webpack-cli/3.3.12/4.0.0) | --- ### Release Notes
webpack/webpack-cli ### [`v4.0.0`](https://togithub.com/webpack/webpack-cli/blob/master/CHANGELOG.md#​400-httpsgithubcomwebpackwebpack-clicomparewebpack-cli400-rc1webpack-cli400-2020-10-10) [Compare Source](https://togithub.com/webpack/webpack-cli/compare/v3.3.12...webpack-cli@4.0.0) ##### Bug Fixes - add compilation lifecycle in watch instance ([#​1903](https://togithub.com/webpack/webpack-cli/issues/1903)) ([02b6d21](https://togithub.com/webpack/webpack-cli/commit/02b6d21eaa20166a7ed37816de716b8fc22b756a)) - cleanup `package-utils` package ([#​1822](https://togithub.com/webpack/webpack-cli/issues/1822)) ([fd5b92b](https://togithub.com/webpack/webpack-cli/commit/fd5b92b3cd40361daec5bf4486e455a41f4c9738)) - cli-executer supplies args further up ([#​1904](https://togithub.com/webpack/webpack-cli/issues/1904)) ([097564a](https://togithub.com/webpack/webpack-cli/commit/097564a851b36b63e0a6bf88144997ef65aa057a)) - exit code for validation errors ([59f6303](https://togithub.com/webpack/webpack-cli/commit/59f63037fcbdbb8934b578b9adf5725bc4ae1235)) - exit process in case of schema errors ([71e89b4](https://togithub.com/webpack/webpack-cli/commit/71e89b4092d953ea587cc4f606451ab78cbcdb93)) ##### Features - assign config paths in build dependencies in cache config ([#​1900](https://togithub.com/webpack/webpack-cli/issues/1900)) ([7e90f11](https://togithub.com/webpack/webpack-cli/commit/7e90f110b119f36ef9def4f66cf4e17ccf1438cd))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 0381fc84ceb..fb5050bcb63 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -48,7 +48,7 @@ "ts-loader": "^8.0.0", "typescript": "~3.8.3", "webpack": "^4.42.1", - "webpack-cli": "^3.3.11", + "webpack-cli": "^4.0.0", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" }, From 38cdd84c49aa46686dd9e9495e15fa850754d8b2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Oct 2020 23:02:32 +0200 Subject: [PATCH 053/152] chore(deps): update dependency webpack to v5 (#67) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [webpack](https://togithub.com/webpack/webpack) | devDependencies | major | [`^4.42.1` -> `^5.0.0`](https://renovatebot.com/diffs/npm/webpack/4.44.2/5.1.0) | --- ### Release Notes
webpack/webpack ### [`v5.1.0`](https://togithub.com/webpack/webpack/releases/v5.1.0) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.0.0...v5.1.0) ### Features - expose `webpack` property from `Compiler` - expose `cleverMerge`, `EntryOptionPlugin`, `DynamicEntryPlugin` ### Bugfixes - missing `require("..").xxx` in try-catch produces a warning instead of an error now - handle reexports in concatenated modules correctly when they are side-effect-free - fix incorrect deprecation message for ModuleTemplate.hooks.hash ### [`v5.0.0`](https://togithub.com/webpack/webpack/releases/v5.0.0) [Compare Source](https://togithub.com/webpack/webpack/compare/v4.44.2...v5.0.0) [Announcement and changelog](https://webpack.js.org/blog/2020-10-10-webpack-5-release/)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index fb5050bcb63..2199c72f5bf 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -47,7 +47,7 @@ "sinon": "^9.0.1", "ts-loader": "^8.0.0", "typescript": "~3.8.3", - "webpack": "^4.42.1", + "webpack": "^5.0.0", "webpack-cli": "^4.0.0", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" From 3c8b589c21c16cbd79697a9741ea4c710cb6a156 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 16 Oct 2020 10:08:43 -0700 Subject: [PATCH 054/152] build: only check --engine-strict for production deps (#69) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/05b05b53-a254-4e87-acf9-e9bae7f17a4e/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5451633881133e5573cc271a18e73b18caca8b1b --- packages/google-cloud-memcache/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index a52301edb68..28b5a6ed1d4 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "13c6e820fd8e7889ddaccceb8bff739ff5e4c4a0" + "sha": "5a598ddcec4ef8c6568cb69b408044f2f9abae48" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9" + "sha": "5451633881133e5573cc271a18e73b18caca8b1b" } } ], From f42e0b64a8296832c2411fe3e1bf06afd45ad24a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 21 Oct 2020 11:23:12 -0700 Subject: [PATCH 055/152] chore: clean up Node.js TOC for cloud-rad (#70) * chore: clean up Node.js TOC for cloud-rad Source-Author: F. Hinkelmann Source-Date: Wed Oct 21 09:26:04 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: f96d3b455fe27c3dc7bc37c3c9cd27b1c6d269c8 Source-Link: https://github.com/googleapis/synthtool/commit/f96d3b455fe27c3dc7bc37c3c9cd27b1c6d269c8 * chore: fix Node.js TOC for cloud-rad Source-Author: F. Hinkelmann Source-Date: Wed Oct 21 12:01:24 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 901ddd44e9ef7887ee681b9183bbdea99437fdcc Source-Link: https://github.com/googleapis/synthtool/commit/901ddd44e9ef7887ee681b9183bbdea99437fdcc --- packages/google-cloud-memcache/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 28b5a6ed1d4..aec417775b2 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "5a598ddcec4ef8c6568cb69b408044f2f9abae48" + "sha": "4c07122b56806835e94555f1e6c86c5302e01dc2" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5451633881133e5573cc271a18e73b18caca8b1b" + "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" } } ], From db1cdf8cdde2ace51ee5d600445699cd00dd0ece Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 27 Oct 2020 08:38:46 -0700 Subject: [PATCH 056/152] docs: updated code of conduct (includes update to actions) (#74) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/8603a334-7a64-49dc-bf6d-29ff55473bfe/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/89c849ba5013e45e8fb688b138f33c2ec6083dc5 Source-Link: https://github.com/googleapis/synthtool/commit/a783321fd55f010709294455584a553f4b24b944 Source-Link: https://github.com/googleapis/synthtool/commit/b7413d38b763827c72c0360f0a3d286c84656eeb Source-Link: https://github.com/googleapis/synthtool/commit/5f6ef0ec5501d33c4667885b37a7685a30d41a76 --- .../google-cloud-memcache/CODE_OF_CONDUCT.md | 123 +++++++++++++----- packages/google-cloud-memcache/synth.metadata | 4 +- 2 files changed, 89 insertions(+), 38 deletions(-) diff --git a/packages/google-cloud-memcache/CODE_OF_CONDUCT.md b/packages/google-cloud-memcache/CODE_OF_CONDUCT.md index 46b2a08ea6d..2add2547a81 100644 --- a/packages/google-cloud-memcache/CODE_OF_CONDUCT.md +++ b/packages/google-cloud-memcache/CODE_OF_CONDUCT.md @@ -1,43 +1,94 @@ -# Contributor Code of Conduct + +# Code of Conduct -As contributors and maintainers of this project, -and in the interest of fostering an open and welcoming community, -we pledge to respect all people who contribute through reporting issues, -posting feature requests, updating documentation, -submitting pull requests or patches, and other activities. +## Our Pledge -We are committed to making participation in this project -a harassment-free experience for everyone, -regardless of level of experience, gender, gender identity and expression, -sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. +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 -* Personal attacks -* Trolling or insulting/derogatory comments -* Public or private harassment -* Publishing other's private information, -such as physical or electronic -addresses, without explicit permission -* Other unethical or unprofessional conduct. +* 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. -By adopting this Code of Conduct, -project maintainers commit themselves to fairly and consistently -applying these principles to every aspect of managing this project. -Project maintainers who do not follow or enforce the Code of Conduct -may be permanently removed from the project team. - -This code of conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. - -Instances of abusive, harassing, or otherwise unacceptable behavior -may be reported by opening an issue -or contacting one or more of the project maintainers. - -This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, -available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) +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-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index aec417775b2..36c9a0bd7c3 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "4c07122b56806835e94555f1e6c86c5302e01dc2" + "sha": "ffee7c0a44ac304bfcc5ecfe76a6e99b408b1915" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" + "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" } } ], From 2bc0022e97db9d141f52930d3edcc520ae66497f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 2 Nov 2020 15:58:57 -0800 Subject: [PATCH 057/152] build(node): add KOKORO_BUILD_ARTIFACTS_SUBDIR to env (#75) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/2b12f6c9-10d8-4a5e-b86e-af5827858559/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/ba9918cd22874245b55734f57470c719b577e591 --- packages/google-cloud-memcache/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 36c9a0bd7c3..6adbdd671ae 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "ffee7c0a44ac304bfcc5ecfe76a6e99b408b1915" + "sha": "60a2bd9c7d7c7537659fa2c7d6012e8019f5ff57" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" + "sha": "ba9918cd22874245b55734f57470c719b577e591" } } ], From 3230db6eadb2e214e129b59693f955f4e768aaf1 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 6 Nov 2020 15:42:16 -0800 Subject: [PATCH 058/152] fix: do not modify options object, use defaultScopes (#76) Regenerated the library using [gapic-generator-typescript](https://github.com/googleapis/gapic-generator-typescript) v1.2.1. --- packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/src/index.ts | 1 + .../src/v1beta2/cloud_memcache_client.ts | 269 ++++++++++-------- packages/google-cloud-memcache/synth.metadata | 16 +- .../system-test/fixtures/sample/src/index.ts | 9 +- .../system-test/install.ts | 18 +- 6 files changed, 182 insertions(+), 133 deletions(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 2199c72f5bf..75fd0f506ad 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -29,7 +29,7 @@ "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { - "google-gax": "^2.1.0" + "google-gax": "^2.9.2" }, "devDependencies": { "@types/mocha": "^8.0.0", diff --git a/packages/google-cloud-memcache/src/index.ts b/packages/google-cloud-memcache/src/index.ts index 3e4d6b8fca0..f911867a262 100644 --- a/packages/google-cloud-memcache/src/index.ts +++ b/packages/google-cloud-memcache/src/index.ts @@ -18,6 +18,7 @@ import * as v1beta2 from './v1beta2'; const CloudMemcacheClient = v1beta2.CloudMemcacheClient; +type CloudMemcacheClient = v1beta2.CloudMemcacheClient; export {v1beta2, CloudMemcacheClient}; export default {v1beta2, CloudMemcacheClient}; import * as protos from '../protos/protos'; diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index b88913f0f99..7cd36ee107d 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -76,8 +76,10 @@ export class CloudMemcacheClient { /** * Construct an instance of CloudMemcacheClient. * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. + * @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] @@ -97,42 +99,33 @@ export class CloudMemcacheClient { * 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. + * TODO(@alexander-fenster): link to gax documentation. + * @param {boolean} 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 the service address and port. + // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof CloudMemcacheClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? typeof window !== 'undefined'; + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - if (!opts) { - opts = {servicePath, port}; + // 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; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the CloudMemcacheClient constructor. + // 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. - opts.scopes = (this.constructor as typeof CloudMemcacheClient).scopes; + // 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. @@ -141,6 +134,11 @@ export class CloudMemcacheClient { // 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) { @@ -356,6 +354,7 @@ export class CloudMemcacheClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'memcache.googleapis.com'; @@ -364,6 +363,7 @@ export class CloudMemcacheClient { /** * 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 'memcache.googleapis.com'; @@ -371,6 +371,7 @@ export class CloudMemcacheClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -379,6 +380,7 @@ export class CloudMemcacheClient { /** * 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']; @@ -388,8 +390,7 @@ export class CloudMemcacheClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -448,7 +449,11 @@ export class CloudMemcacheClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.memcache.v1beta2.Instance}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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.memcache.v1beta2.IGetInstanceRequest, @@ -554,8 +559,15 @@ export class CloudMemcacheClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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.memcache.v1beta2.ICreateInstanceRequest, @@ -607,18 +619,19 @@ export class CloudMemcacheClient { return this.innerApiCalls.createInstance(request, options, callback); } /** - * Check the status of the long running operation returned by the createInstance() method. + * 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. - * - * @example: - * const decodedOperation = await checkCreateInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * 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 @@ -692,8 +705,15 @@ export class CloudMemcacheClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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.memcache.v1beta2.IUpdateInstanceRequest, @@ -745,18 +765,19 @@ export class CloudMemcacheClient { return this.innerApiCalls.updateInstance(request, options, callback); } /** - * Check the status of the long running operation returned by the updateInstance() method. + * 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. - * - * @example: - * const decodedOperation = await checkUpdateInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * 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 @@ -833,8 +854,15 @@ export class CloudMemcacheClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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.updateParameters(request); + * const [response] = await operation.promise(); */ updateParameters( request: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, @@ -886,18 +914,19 @@ export class CloudMemcacheClient { return this.innerApiCalls.updateParameters(request, options, callback); } /** - * Check the status of the long running operation returned by the updateParameters() method. + * Check the status of the long running operation returned by `updateParameters()`. * @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. - * - * @example: - * const decodedOperation = await checkUpdateParametersProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * 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 checkUpdateParametersProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkUpdateParametersProgress( name: string @@ -969,8 +998,15 @@ export class CloudMemcacheClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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.memcache.v1beta2.IDeleteInstanceRequest, @@ -1022,18 +1058,19 @@ export class CloudMemcacheClient { return this.innerApiCalls.deleteInstance(request, options, callback); } /** - * Check the status of the long running operation returned by the deleteInstance() method. + * 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. - * - * @example: - * const decodedOperation = await checkDeleteInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * 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 @@ -1111,8 +1148,15 @@ export class CloudMemcacheClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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.applyParameters(request); + * const [response] = await operation.promise(); */ applyParameters( request: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, @@ -1164,18 +1208,19 @@ export class CloudMemcacheClient { return this.innerApiCalls.applyParameters(request, options, callback); } /** - * Check the status of the long running operation returned by the applyParameters() method. + * Check the status of the long running operation returned by `applyParameters()`. * @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. - * - * @example: - * const decodedOperation = await checkApplyParametersProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * 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 checkApplyParametersProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkApplyParametersProgress( name: string @@ -1259,19 +1304,14 @@ export class CloudMemcacheClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.memcache.v1beta2.Instance}. - * The client library support auto-pagination by default: it will call the API as many + * 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. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Instance]{@link google.cloud.memcache.v1beta2.Instance} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListInstancesRequest]{@link google.cloud.memcache.v1beta2.ListInstancesRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListInstancesResponse]{@link google.cloud.memcache.v1beta2.ListInstancesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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.memcache.v1beta2.IListInstancesRequest, @@ -1319,18 +1359,7 @@ export class CloudMemcacheClient { } /** - * Equivalent to {@link listInstances}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listInstances} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * 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 @@ -1357,6 +1386,13 @@ export class CloudMemcacheClient { * 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.memcache.v1beta2.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.memcache.v1beta2.IListInstancesRequest, @@ -1381,10 +1417,9 @@ export class CloudMemcacheClient { } /** - * Equivalent to {@link listInstances}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * 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 @@ -1410,7 +1445,18 @@ export class CloudMemcacheClient { * @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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * 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.memcache.v1beta2.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.memcache.v1beta2.IListInstancesRequest, @@ -1524,9 +1570,10 @@ export class CloudMemcacheClient { } /** - * Terminate the GRPC channel and close the client. + * 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(); diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 6adbdd671ae..fc78f8cf26e 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "60a2bd9c7d7c7537659fa2c7d6012e8019f5ff57" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb", - "internalRef": "327369997" + "remote": "git@github.com:googleapis/nodejs-memcache.git", + "sha": "5b738ad1e42cb45dd2906720b5689dad412d3adf" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ba9918cd22874245b55734f57470c719b577e591" + "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" } } ], @@ -87,12 +79,14 @@ "README.md", "api-extractor.json", "linkinator.config.json", + "package-lock.json.918313730", "protos/google/cloud/memcache/v1beta2/cloud_memcache.proto", "protos/protos.d.ts", "protos/protos.js", "protos/protos.json", "renovate.json", "samples/README.md", + "samples/package-lock.json.3145114051", "src/index.ts", "src/v1beta2/cloud_memcache_client.ts", "src/v1beta2/cloud_memcache_client_config.json", diff --git a/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts index acc2234db08..4c939635097 100644 --- a/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts @@ -18,8 +18,15 @@ import {CloudMemcacheClient} from '@google-cloud/memcache'; +// check that the client class type name can be used +function doStuffWithCloudMemcacheClient(client: CloudMemcacheClient) { + client.close(); +} + function main() { - new CloudMemcacheClient(); + // check that the client instance can be created + const cloudMemcacheClient = new CloudMemcacheClient(); + doStuffWithCloudMemcacheClient(cloudMemcacheClient); } main(); diff --git a/packages/google-cloud-memcache/system-test/install.ts b/packages/google-cloud-memcache/system-test/install.ts index 4c1ba3eb79a..39d90f771de 100644 --- a/packages/google-cloud-memcache/system-test/install.ts +++ b/packages/google-cloud-memcache/system-test/install.ts @@ -20,32 +20,32 @@ import {packNTest} from 'pack-n-play'; import {readFileSync} from 'fs'; import {describe, it} from 'mocha'; -describe('typescript consumer tests', () => { - it('should have correct type signature for typescript users', async function () { +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), sample: { - description: 'typescript based user can use the type definitions', + description: 'TypeScript user can use the type definitions', ts: readFileSync( './system-test/fixtures/sample/src/index.ts' ).toString(), }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); }); - it('should have correct type signature for javascript users', async function () { + it('JavaScript code', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), sample: { - description: 'typescript based user can use the type definitions', + description: 'JavaScript user can use the library', ts: readFileSync( './system-test/fixtures/sample/src/index.js' ).toString(), }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); }); }); From affd04dedbc1dc6144c14527d46bf91e0170e2d7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 23 Nov 2020 12:40:33 -0800 Subject: [PATCH 059/152] fix(browser): check for fetch on window --- .../google-cloud-memcache/protos/protos.json | 167 ++++++++++++++++-- .../src/v1beta2/cloud_memcache_client.ts | 90 +++++----- packages/google-cloud-memcache/synth.metadata | 14 +- 3 files changed, 215 insertions(+), 56 deletions(-) diff --git a/packages/google-cloud-memcache/protos/protos.json b/packages/google-cloud-memcache/protos/protos.json index 221849330d7..75794be27b2 100644 --- a/packages/google-cloud-memcache/protos/protos.json +++ b/packages/google-cloud-memcache/protos/protos.json @@ -26,7 +26,17 @@ "options": { "(google.api.http).get": "/v1beta2/{parent=projects/*/locations/*}/instances", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta2/{parent=projects/*/locations/*}/instances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "GetInstance": { "requestType": "GetInstanceRequest", @@ -34,7 +44,17 @@ "options": { "(google.api.http).get": "/v1beta2/{name=projects/*/locations/*/instances/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta2/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "CreateInstance": { "requestType": "CreateInstanceRequest", @@ -45,7 +65,24 @@ "(google.api.method_signature)": "parent,instance_id,resource", "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1beta2.Instance", "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/{parent=projects/*/locations/*}/instances", + "body": "resource" + } + }, + { + "(google.api.method_signature)": "parent,instance_id,resource" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1beta2.Instance", + "metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + } + ] }, "UpdateInstance": { "requestType": "UpdateInstanceRequest", @@ -56,7 +93,24 @@ "(google.api.method_signature)": "update_mask,resource", "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1beta2.Instance", "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta2/{resource.name=projects/*/locations/*/instances/*}", + "body": "resource" + } + }, + { + "(google.api.method_signature)": "update_mask,resource" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1beta2.Instance", + "metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + } + ] }, "UpdateParameters": { "requestType": "UpdateParametersRequest", @@ -67,7 +121,24 @@ "(google.api.method_signature)": "name,update_mask,parameters", "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1beta2.Instance", "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta2/{name=projects/*/locations/*/instances/*}:updateParameters", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,update_mask,parameters" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1beta2.Instance", + "metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + } + ] }, "DeleteInstance": { "requestType": "DeleteInstanceRequest", @@ -77,7 +148,23 @@ "(google.api.method_signature)": "name", "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta2/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + } + ] }, "ApplyParameters": { "requestType": "ApplyParametersRequest", @@ -88,7 +175,24 @@ "(google.api.method_signature)": "name,node_ids,apply_all", "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1beta2.Instance", "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/{name=projects/*/locations/*/instances/*}:applyParameters", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,node_ids,apply_all" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1beta2.Instance", + "metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + } + ] } } }, @@ -1696,7 +1800,17 @@ "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", @@ -1704,7 +1818,17 @@ "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", @@ -1712,7 +1836,17 @@ "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", @@ -1721,7 +1855,18 @@ "(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", diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index 7cd36ee107d..a6ad753f318 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -16,6 +16,7 @@ // ** 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, @@ -31,6 +32,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1beta2/cloud_memcache_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './cloud_memcache_client_config.json'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -99,9 +105,9 @@ export class CloudMemcacheClient { * 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. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @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` @@ -114,7 +120,9 @@ export class CloudMemcacheClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + 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. @@ -407,7 +415,7 @@ export class CloudMemcacheClient { // ------------------- getInstance( request: protos.google.cloud.memcache.v1beta2.IGetInstanceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.memcache.v1beta2.IInstance, @@ -417,7 +425,7 @@ export class CloudMemcacheClient { >; getInstance( request: protos.google.cloud.memcache.v1beta2.IGetInstanceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.memcache.v1beta2.IInstance, | protos.google.cloud.memcache.v1beta2.IGetInstanceRequest @@ -458,7 +466,7 @@ export class CloudMemcacheClient { getInstance( request: protos.google.cloud.memcache.v1beta2.IGetInstanceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.memcache.v1beta2.IInstance, | protos.google.cloud.memcache.v1beta2.IGetInstanceRequest @@ -481,12 +489,12 @@ export class CloudMemcacheClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -502,7 +510,7 @@ export class CloudMemcacheClient { createInstance( request: protos.google.cloud.memcache.v1beta2.ICreateInstanceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -515,7 +523,7 @@ export class CloudMemcacheClient { >; createInstance( request: protos.google.cloud.memcache.v1beta2.ICreateInstanceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.memcache.v1beta2.IInstance, @@ -572,7 +580,7 @@ export class CloudMemcacheClient { createInstance( request: protos.google.cloud.memcache.v1beta2.ICreateInstanceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.memcache.v1beta2.IInstance, @@ -600,12 +608,12 @@ export class CloudMemcacheClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -657,7 +665,7 @@ export class CloudMemcacheClient { } updateInstance( request: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -670,7 +678,7 @@ export class CloudMemcacheClient { >; updateInstance( request: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.memcache.v1beta2.IInstance, @@ -718,7 +726,7 @@ export class CloudMemcacheClient { updateInstance( request: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.memcache.v1beta2.IInstance, @@ -746,12 +754,12 @@ export class CloudMemcacheClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -803,7 +811,7 @@ export class CloudMemcacheClient { } updateParameters( request: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -816,7 +824,7 @@ export class CloudMemcacheClient { >; updateParameters( request: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.memcache.v1beta2.IInstance, @@ -867,7 +875,7 @@ export class CloudMemcacheClient { updateParameters( request: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.memcache.v1beta2.IInstance, @@ -895,12 +903,12 @@ export class CloudMemcacheClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -952,7 +960,7 @@ export class CloudMemcacheClient { } deleteInstance( request: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -965,7 +973,7 @@ export class CloudMemcacheClient { >; deleteInstance( request: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.protobuf.IEmpty, @@ -1011,7 +1019,7 @@ export class CloudMemcacheClient { deleteInstance( request: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.protobuf.IEmpty, @@ -1039,12 +1047,12 @@ export class CloudMemcacheClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1096,7 +1104,7 @@ export class CloudMemcacheClient { } applyParameters( request: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -1109,7 +1117,7 @@ export class CloudMemcacheClient { >; applyParameters( request: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.memcache.v1beta2.IInstance, @@ -1161,7 +1169,7 @@ export class CloudMemcacheClient { applyParameters( request: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.memcache.v1beta2.IInstance, @@ -1189,12 +1197,12 @@ export class CloudMemcacheClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1246,7 +1254,7 @@ export class CloudMemcacheClient { } listInstances( request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.memcache.v1beta2.IInstance[], @@ -1256,7 +1264,7 @@ export class CloudMemcacheClient { >; listInstances( request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.memcache.v1beta2.IListInstancesRequest, | protos.google.cloud.memcache.v1beta2.IListInstancesResponse @@ -1316,7 +1324,7 @@ export class CloudMemcacheClient { listInstances( request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.memcache.v1beta2.IListInstancesRequest, | protos.google.cloud.memcache.v1beta2.IListInstancesResponse @@ -1339,12 +1347,12 @@ export class CloudMemcacheClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1396,7 +1404,7 @@ export class CloudMemcacheClient { */ listInstancesStream( request?: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1460,7 +1468,7 @@ export class CloudMemcacheClient { */ listInstancesAsync( request?: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index fc78f8cf26e..fe2474b0a5f 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -3,8 +3,16 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-memcache.git", - "sha": "5b738ad1e42cb45dd2906720b5689dad412d3adf" + "remote": "https://github.com/googleapis/nodejs-memcache.git", + "sha": "b48f1efd8df276d542cead808f5b602fabdc047b" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "2f019bf70bfe06f1e2af1b04011b0a2405190e43", + "internalRef": "343202295" } }, { @@ -79,14 +87,12 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.918313730", "protos/google/cloud/memcache/v1beta2/cloud_memcache.proto", "protos/protos.d.ts", "protos/protos.js", "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.3145114051", "src/index.ts", "src/v1beta2/cloud_memcache_client.ts", "src/v1beta2/cloud_memcache_client_config.json", From c026f51ef60b595520e813f1e3f56ca5029bab64 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Nov 2020 08:34:31 -0800 Subject: [PATCH 060/152] docs: spelling correction for "targetting" (#80) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/0d9476f5-156e-4a9b-9f97-94473eb544b9/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/15013eff642a7e7e855aed5a29e6e83c39beba2a --- packages/google-cloud-memcache/README.md | 2 +- packages/google-cloud-memcache/synth.metadata | 75 +------------------ 2 files changed, 3 insertions(+), 74 deletions(-) diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md index 8af720a5d82..66cd64e66da 100644 --- a/packages/google-cloud-memcache/README.md +++ b/packages/google-cloud-memcache/README.md @@ -90,7 +90,7 @@ Our client libraries follow the [Node.js release schedule](https://nodejs.org/en Libraries are compatible with all current _active_ and _maintenance_ versions of Node.js. -Client libraries targetting some end-of-life versions of Node.js are available, and +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)`. diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index fe2474b0a5f..a5cf5987ac4 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "b48f1efd8df276d542cead808f5b602fabdc047b" + "sha": "8d54934fcd7d4ef97f6adbbff383414bd0c23c58" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" + "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" } } ], @@ -33,76 +33,5 @@ "generator": "bazel" } } - ], - "generatedFiles": [ - ".eslintignore", - ".eslintrc.json", - ".gitattributes", - ".github/ISSUE_TEMPLATE/bug_report.md", - ".github/ISSUE_TEMPLATE/feature_request.md", - ".github/ISSUE_TEMPLATE/support_request.md", - ".github/PULL_REQUEST_TEMPLATE.md", - ".github/release-please.yml", - ".github/workflows/ci.yaml", - ".gitignore", - ".jsdoc.js", - ".kokoro/.gitattributes", - ".kokoro/common.cfg", - ".kokoro/continuous/node10/common.cfg", - ".kokoro/continuous/node10/docs.cfg", - ".kokoro/continuous/node10/test.cfg", - ".kokoro/continuous/node12/common.cfg", - ".kokoro/continuous/node12/lint.cfg", - ".kokoro/continuous/node12/samples-test.cfg", - ".kokoro/continuous/node12/system-test.cfg", - ".kokoro/continuous/node12/test.cfg", - ".kokoro/docs.sh", - ".kokoro/lint.sh", - ".kokoro/populate-secrets.sh", - ".kokoro/presubmit/node10/common.cfg", - ".kokoro/presubmit/node12/common.cfg", - ".kokoro/presubmit/node12/samples-test.cfg", - ".kokoro/presubmit/node12/system-test.cfg", - ".kokoro/presubmit/node12/test.cfg", - ".kokoro/publish.sh", - ".kokoro/release/docs-devsite.cfg", - ".kokoro/release/docs-devsite.sh", - ".kokoro/release/docs.cfg", - ".kokoro/release/docs.sh", - ".kokoro/release/publish.cfg", - ".kokoro/samples-test.sh", - ".kokoro/system-test.sh", - ".kokoro/test.bat", - ".kokoro/test.sh", - ".kokoro/trampoline.sh", - ".kokoro/trampoline_v2.sh", - ".mocharc.js", - ".nycrc", - ".prettierignore", - ".prettierrc.js", - ".trampolinerc", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "README.md", - "api-extractor.json", - "linkinator.config.json", - "protos/google/cloud/memcache/v1beta2/cloud_memcache.proto", - "protos/protos.d.ts", - "protos/protos.js", - "protos/protos.json", - "renovate.json", - "samples/README.md", - "src/index.ts", - "src/v1beta2/cloud_memcache_client.ts", - "src/v1beta2/cloud_memcache_client_config.json", - "src/v1beta2/cloud_memcache_proto_list.json", - "src/v1beta2/index.ts", - "system-test/fixtures/sample/src/index.js", - "system-test/fixtures/sample/src/index.ts", - "system-test/install.ts", - "test/gapic_cloud_memcache_v1beta2.ts", - "tsconfig.json", - "webpack.config.js" ] } \ No newline at end of file From 4a1063fb633030dac8300aa6c2b678e636144069 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2020 10:45:18 -0800 Subject: [PATCH 061/152] chore: release 1.2.1 (#79) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-memcache/CHANGELOG.md | 8 ++++++++ packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index add7ac744fd..fef333b4676 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [1.2.1](https://www.github.com/googleapis/nodejs-memcache/compare/v1.2.0...v1.2.1) (2020-11-25) + + +### Bug Fixes + +* **browser:** check for fetch on window ([8d54934](https://www.github.com/googleapis/nodejs-memcache/commit/8d54934fcd7d4ef97f6adbbff383414bd0c23c58)) +* do not modify options object, use defaultScopes ([#76](https://www.github.com/googleapis/nodejs-memcache/issues/76)) ([b48f1ef](https://www.github.com/googleapis/nodejs-memcache/commit/b48f1efd8df276d542cead808f5b602fabdc047b)) + ## [1.2.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.1.0...v1.2.0) (2020-06-28) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 75fd0f506ad..db921c8a5c2 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "1.2.0", + "version": "1.2.1", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index e925ec3f5d3..e437bf2e209 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^1.2.0" + "@google-cloud/memcache": "^1.2.1" }, "devDependencies": { "c8": "^7.0.0", From 21deff34067fa0c73a3c76680397cac77c5cb635 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 4 Dec 2020 08:58:20 -0800 Subject: [PATCH 062/152] chore: generate GAPIC metadata JSON file (#81) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/86075bca-3db9-4047-98b6-39dbe4174275/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 345596855 Source-Link: https://github.com/googleapis/googleapis/commit/d189e871205fea665a9648f7c4676f027495ccaf --- .../src/v1beta2/gapic_metadata.json | 97 +++++++++++++++++++ packages/google-cloud-memcache/synth.metadata | 6 +- 2 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 packages/google-cloud-memcache/src/v1beta2/gapic_metadata.json diff --git a/packages/google-cloud-memcache/src/v1beta2/gapic_metadata.json b/packages/google-cloud-memcache/src/v1beta2/gapic_metadata.json new file mode 100644 index 00000000000..2eba47bb86d --- /dev/null +++ b/packages/google-cloud-memcache/src/v1beta2/gapic_metadata.json @@ -0,0 +1,97 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.memcache.v1beta2", + "libraryPackage": "@google-cloud/memcache", + "services": { + "CloudMemcache": { + "clients": { + "grpc": { + "libraryClient": "CloudMemcacheClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "UpdateParameters": { + "methods": [ + "updateParameters" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "ApplyParameters": { + "methods": [ + "applyParameters" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CloudMemcacheClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "UpdateParameters": { + "methods": [ + "updateParameters" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "ApplyParameters": { + "methods": [ + "applyParameters" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index a5cf5987ac4..b50bde63aa7 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "8d54934fcd7d4ef97f6adbbff383414bd0c23c58" + "sha": "b647fe4776d15c7f9bd9e7a9f70a87c3a9e1dd50" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "2f019bf70bfe06f1e2af1b04011b0a2405190e43", - "internalRef": "343202295" + "sha": "d189e871205fea665a9648f7c4676f027495ccaf", + "internalRef": "345596855" } }, { From bd43a1afa319efc47b28b253ec62e4eceb18ec4a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 22 Dec 2020 11:42:28 -0800 Subject: [PATCH 063/152] docs: add instructions for authenticating for system tests (#82) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/28ef5920-505e-44eb-bad6-0e53fa99adef/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/363fe305e9ce34a6cd53951c6ee5f997094b54ee --- packages/google-cloud-memcache/CONTRIBUTING.md | 15 +++++++++++++-- packages/google-cloud-memcache/README.md | 3 +-- packages/google-cloud-memcache/synth.metadata | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-memcache/CONTRIBUTING.md b/packages/google-cloud-memcache/CONTRIBUTING.md index f6c4cf010e3..ede158bdba2 100644 --- a/packages/google-cloud-memcache/CONTRIBUTING.md +++ b/packages/google-cloud-memcache/CONTRIBUTING.md @@ -37,6 +37,15 @@ accept your pull requests. 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 Memorystore for Memcached 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]. @@ -51,11 +60,9 @@ accept your pull requests. npm test # Run sample integration tests. - gcloud auth application-default login npm run samples-test # Run all system tests. - gcloud auth application-default login npm run system-test 1. Lint (and maybe fix) any changes: @@ -63,3 +70,7 @@ accept your pull requests. 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=memcache.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md index 66cd64e66da..67c5f35f1fa 100644 --- a/packages/google-cloud-memcache/README.md +++ b/packages/google-cloud-memcache/README.md @@ -72,8 +72,7 @@ console.info(cmc); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-memcache/tree/master/samples) directory. The samples' `README.md` -has instructions for running the samples. +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-memcache/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index b50bde63aa7..b3b37c7e0e8 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "b647fe4776d15c7f9bd9e7a9f70a87c3a9e1dd50" + "sha": "6ab24d5d5a01d5369bf6c37527a46377b61aac81" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" + "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" } } ], From dab14fe416399d3c94ee1f9b013b2ba00aa23f90 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 7 Jan 2021 11:33:16 -0800 Subject: [PATCH 064/152] docs: update dates (#84) --- packages/google-cloud-memcache/.jsdoc.js | 4 ++-- packages/google-cloud-memcache/protos/protos.d.ts | 2 +- packages/google-cloud-memcache/protos/protos.js | 2 +- packages/google-cloud-memcache/src/index.ts | 2 +- .../src/v1beta2/cloud_memcache_client.ts | 2 +- packages/google-cloud-memcache/src/v1beta2/index.ts | 2 +- packages/google-cloud-memcache/synth.metadata | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- packages/google-cloud-memcache/system-test/install.ts | 2 +- .../test/gapic_cloud_memcache_v1beta2.ts | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-memcache/.jsdoc.js b/packages/google-cloud-memcache/.jsdoc.js index 3aa0e5e8fd4..a17e386df11 100644 --- a/packages/google-cloud-memcache/.jsdoc.js +++ b/packages/google-cloud-memcache/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2020 Google LLC', + copyright: 'Copyright 2021 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/memcache', diff --git a/packages/google-cloud-memcache/protos/protos.d.ts b/packages/google-cloud-memcache/protos/protos.d.ts index 6b807f4925a..f9e692693ce 100644 --- a/packages/google-cloud-memcache/protos/protos.d.ts +++ b/packages/google-cloud-memcache/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index e4dee8edd60..d8a79036e5a 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-memcache/src/index.ts b/packages/google-cloud-memcache/src/index.ts index f911867a262..9195188dcf7 100644 --- a/packages/google-cloud-memcache/src/index.ts +++ b/packages/google-cloud-memcache/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index a6ad753f318..0549f6b480a 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-memcache/src/v1beta2/index.ts b/packages/google-cloud-memcache/src/v1beta2/index.ts index e5270cf8d53..369d196c3a1 100644 --- a/packages/google-cloud-memcache/src/v1beta2/index.ts +++ b/packages/google-cloud-memcache/src/v1beta2/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index b3b37c7e0e8..8550a7b98df 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "6ab24d5d5a01d5369bf6c37527a46377b61aac81" + "sha": "fcaf9d14598d1ed5e3bccc2cdbbf5120d277709f" } }, { diff --git a/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.js b/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.js index 961aabfe1b2..f438f083f50 100644 --- a/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts index 4c939635097..b1a36b7591b 100644 --- a/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-memcache/system-test/install.ts b/packages/google-cloud-memcache/system-test/install.ts index 39d90f771de..d2d61c0396f 100644 --- a/packages/google-cloud-memcache/system-test/install.ts +++ b/packages/google-cloud-memcache/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts index c897d8ba17d..a027e69e0b7 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. From 8d0a38401e30366248d75f3d9868a01f29ae04c6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 8 Jan 2021 18:40:30 -0800 Subject: [PATCH 065/152] feat: adds style enumeration (#85) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/8b7e3986-c966-4325-9ced-bdd850176095/targets - [ ] To automatically regenerate this PR, check this box. --- .../google-cloud-memcache/protos/protos.d.ts | 12 +++ .../google-cloud-memcache/protos/protos.js | 78 ++++++++++++++++++- .../google-cloud-memcache/protos/protos.json | 13 +++- packages/google-cloud-memcache/synth.metadata | 2 +- 4 files changed, 102 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-memcache/protos/protos.d.ts b/packages/google-cloud-memcache/protos/protos.d.ts index f9e692693ce..b262be6ce92 100644 --- a/packages/google-cloud-memcache/protos/protos.d.ts +++ b/packages/google-cloud-memcache/protos/protos.d.ts @@ -2297,6 +2297,9 @@ export namespace google { /** ResourceDescriptor singular */ singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); } /** Represents a ResourceDescriptor. */ @@ -2326,6 +2329,9 @@ export namespace google { /** 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 @@ -2405,6 +2411,12 @@ export namespace google { ORIGINALLY_SINGLE_PATTERN = 1, FUTURE_MULTI_PATTERN = 2 } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } } /** Properties of a ResourceReference. */ diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index d8a79036e5a..f61c4abdec6 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/protos/protos.js @@ -5627,6 +5627,7 @@ * @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 */ /** @@ -5639,6 +5640,7 @@ */ 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) @@ -5693,6 +5695,14 @@ */ 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 @@ -5730,6 +5740,12 @@ 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; }; @@ -5784,6 +5800,16 @@ 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; @@ -5847,6 +5873,18 @@ 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; }; @@ -5891,6 +5929,23 @@ 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; }; @@ -5907,8 +5962,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.pattern = []; + object.style = []; + } if (options.defaults) { object.type = ""; object.nameField = ""; @@ -5931,6 +5988,11 @@ 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; }; @@ -5961,6 +6023,20 @@ 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; })(); diff --git a/packages/google-cloud-memcache/protos/protos.json b/packages/google-cloud-memcache/protos/protos.json index 75794be27b2..ba2a6ffbf26 100644 --- a/packages/google-cloud-memcache/protos/protos.json +++ b/packages/google-cloud-memcache/protos/protos.json @@ -802,6 +802,11 @@ "singular": { "type": "string", "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 } }, "nested": { @@ -811,6 +816,12 @@ "ORIGINALLY_SINGLE_PATTERN": 1, "FUTURE_MULTI_PATTERN": 2 } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } } } }, @@ -830,7 +841,7 @@ }, "protobuf": { "options": { - "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "go_package": "google.golang.org/protobuf/types/descriptorpb", "java_package": "com.google.protobuf", "java_outer_classname": "DescriptorProtos", "csharp_namespace": "Google.Protobuf.Reflection", diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 8550a7b98df..f014d3fb538 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "fcaf9d14598d1ed5e3bccc2cdbbf5120d277709f" + "sha": "eff497bd516e12aaa922abbad41d270791ee3419" } }, { From 4eb145f87586d743b9e82a27ca8668f7db4e3f07 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 12 Jan 2021 18:36:43 +0000 Subject: [PATCH 066/152] chore: release 1.3.0 (#86) :robot: I have created a release \*beep\* \*boop\* --- ## [1.3.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.2.1...v1.3.0) (2021-01-09) ### Features * adds style enumeration ([#85](https://www.github.com/googleapis/nodejs-memcache/issues/85)) ([07e4454](https://www.github.com/googleapis/nodejs-memcache/commit/07e44541b9056d83a9505b72913c2b52ecd6e859)) --- 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-memcache/CHANGELOG.md | 7 +++++++ packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index fef333b4676..455076c1a40 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.3.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.2.1...v1.3.0) (2021-01-09) + + +### Features + +* adds style enumeration ([#85](https://www.github.com/googleapis/nodejs-memcache/issues/85)) ([07e4454](https://www.github.com/googleapis/nodejs-memcache/commit/07e44541b9056d83a9505b72913c2b52ecd6e859)) + ### [1.2.1](https://www.github.com/googleapis/nodejs-memcache/compare/v1.2.0...v1.2.1) (2020-11-25) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index db921c8a5c2..18c2b57a41d 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "1.2.1", + "version": "1.3.0", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index e437bf2e209..47c301e40bd 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^1.2.1" + "@google-cloud/memcache": "^1.3.0" }, "devDependencies": { "c8": "^7.0.0", From 5a8ef0f8822bf15aee8b21d386cc7458da9f91aa Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 27 Jan 2021 08:46:04 -0800 Subject: [PATCH 067/152] refactor(nodejs): move build cop to flakybot (#87) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/79ba0372-ded2-4df4-829f-0c53e04a7c6d/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/57c23fa5705499a4181095ced81f0ee0933b64f6 --- packages/google-cloud-memcache/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index f014d3fb538..b791c98f760 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "eff497bd516e12aaa922abbad41d270791ee3419" + "sha": "13da6e2d140a537e5ee33fa0dc3efe926597bc86" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" + "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" } } ], From 291a713d5ff87d19a20e1ea525de08197ca73915 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Fri, 29 Jan 2021 09:02:00 -0800 Subject: [PATCH 068/152] feat: add v1 version (#88) --- .../cloud/memcache/v1/cloud_memcache.proto | 495 ++ .../google-cloud-memcache/protos/protos.d.ts | 1726 +++++++ .../google-cloud-memcache/protos/protos.js | 4228 +++++++++++++++++ .../google-cloud-memcache/protos/protos.json | 631 +++ packages/google-cloud-memcache/src/index.ts | 10 +- .../src/v1/cloud_memcache_client.ts | 1586 +++++++ .../src/v1/cloud_memcache_client_config.json | 61 + .../src/v1/cloud_memcache_proto_list.json | 3 + .../src/v1/gapic_metadata.json | 97 + .../google-cloud-memcache/src/v1/index.ts | 19 + packages/google-cloud-memcache/synth.metadata | 17 +- packages/google-cloud-memcache/synth.py | 2 +- ..._v1beta2.ts => gapic_cloud_memcache_v1.ts} | 294 +- 13 files changed, 8999 insertions(+), 170 deletions(-) create mode 100644 packages/google-cloud-memcache/protos/google/cloud/memcache/v1/cloud_memcache.proto create mode 100644 packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts create mode 100644 packages/google-cloud-memcache/src/v1/cloud_memcache_client_config.json create mode 100644 packages/google-cloud-memcache/src/v1/cloud_memcache_proto_list.json create mode 100644 packages/google-cloud-memcache/src/v1/gapic_metadata.json create mode 100644 packages/google-cloud-memcache/src/v1/index.ts rename packages/google-cloud-memcache/test/{gapic_cloud_memcache_v1beta2.ts => gapic_cloud_memcache_v1.ts} (83%) diff --git a/packages/google-cloud-memcache/protos/google/cloud/memcache/v1/cloud_memcache.proto b/packages/google-cloud-memcache/protos/google/cloud/memcache/v1/cloud_memcache.proto new file mode 100644 index 00000000000..308f0582009 --- /dev/null +++ b/packages/google-cloud-memcache/protos/google/cloud/memcache/v1/cloud_memcache.proto @@ -0,0 +1,495 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.memcache.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/memcache/v1;memcache"; +option java_multiple_files = true; +option java_outer_classname = "CloudMemcacheProto"; +option java_package = "com.google.cloud.memcache.v1"; + +// Configures and manages Cloud Memorystore for Memcached instances. +// +// +// The `memcache.googleapis.com` service implements the Google Cloud Memorystore +// for Memcached API and defines the following resource model for managing +// Memorystore Memcached (also called Memcached below) 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 Memcached instances, named: +// `/instances/*` +// * As such, Memcached instances are resources of the form: +// `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` +// +// Note that location_id must be a GCP `region`; for example: +// * `projects/my-memcached-project/locations/us-central1/instances/my-memcached` +service CloudMemcache { + option (google.api.default_host) = "memcache.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Instances in a given location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Instance in a given location. + rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1.Instance" + metadata_type: "google.cloud.memcache.v1.OperationMetadata" + }; + } + + // Updates an existing Instance in a given project and location. + 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: "google.cloud.memcache.v1.Instance" + metadata_type: "google.cloud.memcache.v1.OperationMetadata" + }; + } + + // Updates the defined Memcached Parameters for an existing Instance. + // This method only stages the parameters, it must be followed by + // ApplyParameters to apply the parameters to nodes of the Memcached Instance. + rpc UpdateParameters(UpdateParametersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/instances/*}:updateParameters" + body: "*" + }; + option (google.api.method_signature) = "name,update_mask,parameters"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1.Instance" + metadata_type: "google.cloud.memcache.v1.OperationMetadata" + }; + } + + // Deletes a single 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.memcache.v1.OperationMetadata" + }; + } + + // ApplyParameters will restart the set of specified nodes in order to update + // them to the current set of parameters for the Memcached Instance. + rpc ApplyParameters(ApplyParametersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/instances/*}:applyParameters" + body: "*" + }; + option (google.api.method_signature) = "name,node_ids,apply_all"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1.Instance" + metadata_type: "google.cloud.memcache.v1.OperationMetadata" + }; + } +} + +message Instance { + option (google.api.resource) = { + type: "memcache.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + }; + + // Configuration for a Memcached Node. + message NodeConfig { + // Required. Number of cpus per Memcached node. + int32 cpu_count = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Memory size in MiB for each Memcached node. + int32 memory_size_mb = 2 [(google.api.field_behavior) = REQUIRED]; + } + + message Node { + // Different states of a Memcached node. + enum State { + // Node state is not set. + STATE_UNSPECIFIED = 0; + + // Node is being created. + CREATING = 1; + + // Node has been created and ready to be used. + READY = 2; + + // Node is being deleted. + DELETING = 3; + + // Node is being updated. + UPDATING = 4; + } + + // Output only. Identifier of the Memcached node. The node id does not + // include project or location like the Memcached instance name. + string node_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Location (GCP Zone) for the Memcached node. + string zone = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the Memcached node. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Hostname or IP address of the Memcached node used by the + // clients to connect to the Memcached server on this node. + string host = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The port number of the Memcached server on this node. + int32 port = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User defined parameters currently applied to the node. + MemcacheParameters parameters = 6; + } + + message InstanceMessage { + enum Code { + // Message Code not set. + CODE_UNSPECIFIED = 0; + + // Memcached nodes are distributed unevenly. + ZONE_DISTRIBUTION_UNBALANCED = 1; + } + + // A code that correspond to one type of user-facing message. + Code code = 1; + + // Message on memcached instance which will be exposed to users. + string message = 2; + } + + // Different states of a Memcached instance. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // Memcached instance is being created. + CREATING = 1; + + // Memcached instance has been created and ready to be used. + READY = 2; + + // Memcached instance is being deleted. + DELETING = 4; + + // Memcached instance is going through maintenance, e.g. data plane rollout. + PERFORMING_MAINTENANCE = 5; + } + + // Required. Unique name of the resource in this scope including project and + // location using the form: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // + // Note: Memcached instances are managed and addressed at regional level so + // location_id here refers to a GCP region; however, users may choose which + // zones Memcached nodes within an instances should be provisioned in. + // Refer to [zones] field for more details. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // User provided name for the instance only used for display + // purposes. Cannot be more than 80 characters. + string display_name = 2; + + // Resource labels to represent user-provided metadata. + // Refer to cloud documentation on labels for more details. + // https://cloud.google.com/compute/docs/labeling-resources + map labels = 3; + + // The full name of the Google Compute Engine + // [network](/compute/docs/networks-and-firewalls#networks) to which the + // instance is connected. If left unspecified, the `default` network + // will be used. + string authorized_network = 4; + + // Zones where Memcached nodes should be provisioned in. + // Memcached nodes will be equally distributed across these zones. If not + // provided, the service will by default create nodes in all zones in the + // region for the instance. + repeated string zones = 5; + + // Required. Number of nodes in the Memcached instance. + int32 node_count = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. Configuration for Memcached nodes. + NodeConfig node_config = 7 [(google.api.field_behavior) = REQUIRED]; + + // The major version of Memcached software. + // If not provided, latest supported version will be used. Currently the + // latest supported major version is MEMCACHE_1_5. + // The minor version will be automatically determined by our system based on + // the latest supported minor version. + MemcacheVersion memcache_version = 9; + + // Optional: User defined parameters to apply to the memcached process + // on each node. + MemcacheParameters parameters = 11; + + // Output only. List of Memcached nodes. + // Refer to [Node] message for more details. + repeated Node memcache_nodes = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the instance was created. + google.protobuf.Timestamp create_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the instance was updated. + google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of this Memcached instance. + State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The full version of memcached server running on this instance. + // System automatically determines the full memcached version for an instance + // based on the input MemcacheVersion. + // The full version format will be "memcached-1.5.16". + string memcache_full_version = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // List of messages that describe current statuses of memcached instance. + repeated InstanceMessage instance_messages = 19; + + // Output only. Endpoint for Discovery API + string discovery_endpoint = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request for [ListInstances][google.cloud.memcache.v1.CloudMemcache.ListInstances]. +message ListInstancesRequest { + // Required. The resource name of the instance location using the form: + // `projects/{project_id}/locations/{location_id}` + // where `location_id` refers to a GCP region + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of items to return. + // + // If not specified, a default value of 1000 will be used by the service. + // Regardless of the page_size value, the response may include a partial list + // and a caller should only rely on response's + // [next_page_token][CloudMemcache.ListInstancesResponse.next_page_token] + // to determine if there are more instances left to be queried. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, + // if any. + string page_token = 3; + + // List filter. For example, exclude all Memcached instances with name as + // my-instance by specifying "name != my-instance". + string filter = 4; + + // Sort results. Supported values are "name", "name desc" or "" (unsorted). + string order_by = 5; +} + +// Response for [ListInstances][google.cloud.memcache.v1.CloudMemcache.ListInstances]. +message ListInstancesResponse { + // A list of Memcached instances in the project in the specified location, + // or across all locations. + // + // If the `location_id` in the parent field of the request is "-", all regions + // available to the project are queried, and the results aggregated. + repeated Instance instances = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for [GetInstance][google.cloud.memcache.v1.CloudMemcache.GetInstance]. +message GetInstanceRequest { + // Required. Memcached instance resource name in the format: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // where `location_id` refers to a GCP region + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; +} + +// Request for [CreateInstance][google.cloud.memcache.v1.CloudMemcache.CreateInstance]. +message CreateInstanceRequest { + // Required. The resource name of the instance location using the form: + // `projects/{project_id}/locations/{location_id}` + // where `location_id` refers to a GCP region + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The logical name of the Memcached instance in the user + // project with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-40 characters. + // * Must end with a number or a letter. + // * Must be unique within the user project / location + // + // If any of the above are not met, will raise an invalid argument error. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A Memcached Instance + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for [UpdateInstance][google.cloud.memcache.v1.CloudMemcache.UpdateInstance]. +message UpdateInstanceRequest { + // Required. Mask of fields to update. + // * `displayName` + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A Memcached Instance. + // Only fields specified in update_mask are updated. + Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for [DeleteInstance][google.cloud.memcache.v1.CloudMemcache.DeleteInstance]. +message DeleteInstanceRequest { + // Required. Memcached instance resource name in the format: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // where `location_id` refers to a GCP region + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; +} + +// Request for [ApplyParameters][google.cloud.memcache.v1.CloudMemcache.ApplyParameters]. +message ApplyParametersRequest { + // Required. Resource name of the Memcached instance for which parameter group updates + // should be applied. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; + + // Nodes to which we should apply the instance-level parameter group. + repeated string node_ids = 2; + + // Whether to apply instance-level parameter group to all nodes. If set to + // true, will explicitly restrict users from specifying any nodes, and apply + // parameter group updates to all nodes within the instance. + bool apply_all = 3; +} + +// Request for [UpdateParameters][google.cloud.memcache.v1.CloudMemcache.UpdateParameters]. +message UpdateParametersRequest { + // Required. Resource name of the Memcached instance for which the parameters should be + // updated. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; + + // Required. Mask of fields to update. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + + // The parameters to apply to the instance. + MemcacheParameters parameters = 3; +} + +message MemcacheParameters { + // Output only. The unique ID associated with this set of parameters. Users + // can use this id to determine if the parameters associated with the instance + // differ from the parameters associated with the nodes and any action needs + // to be taken to apply parameters on nodes. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User defined set of parameters to use in the memcached process. + map params = 3; +} + +// Represents the metadata of a long-running operation. +message OperationMetadata { + // Output only. Time when the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when 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][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]; +} + +// Memcached versions supported by our service. +enum MemcacheVersion { + MEMCACHE_VERSION_UNSPECIFIED = 0; + + // Memcached 1.5 version. + MEMCACHE_1_5 = 1; +} diff --git a/packages/google-cloud-memcache/protos/protos.d.ts b/packages/google-cloud-memcache/protos/protos.d.ts index b262be6ce92..8f5e9736d6d 100644 --- a/packages/google-cloud-memcache/protos/protos.d.ts +++ b/packages/google-cloud-memcache/protos/protos.d.ts @@ -23,6 +23,1732 @@ export namespace google { /** Namespace memcache. */ namespace memcache { + /** Namespace v1. */ + namespace v1 { + + /** Represents a CloudMemcache */ + class CloudMemcache extends $protobuf.rpc.Service { + + /** + * Constructs a new CloudMemcache 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 CloudMemcache 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): CloudMemcache; + + /** + * 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.memcache.v1.IListInstancesRequest, callback: google.cloud.memcache.v1.CloudMemcache.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.memcache.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.memcache.v1.IGetInstanceRequest, callback: google.cloud.memcache.v1.CloudMemcache.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.memcache.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.memcache.v1.ICreateInstanceRequest, callback: google.cloud.memcache.v1.CloudMemcache.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.memcache.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.memcache.v1.IUpdateInstanceRequest, callback: google.cloud.memcache.v1.CloudMemcache.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public updateInstance(request: google.cloud.memcache.v1.IUpdateInstanceRequest): Promise; + + /** + * Calls UpdateParameters. + * @param request UpdateParametersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateParameters(request: google.cloud.memcache.v1.IUpdateParametersRequest, callback: google.cloud.memcache.v1.CloudMemcache.UpdateParametersCallback): void; + + /** + * Calls UpdateParameters. + * @param request UpdateParametersRequest message or plain object + * @returns Promise + */ + public updateParameters(request: google.cloud.memcache.v1.IUpdateParametersRequest): 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.memcache.v1.IDeleteInstanceRequest, callback: google.cloud.memcache.v1.CloudMemcache.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.memcache.v1.IDeleteInstanceRequest): Promise; + + /** + * Calls ApplyParameters. + * @param request ApplyParametersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public applyParameters(request: google.cloud.memcache.v1.IApplyParametersRequest, callback: google.cloud.memcache.v1.CloudMemcache.ApplyParametersCallback): void; + + /** + * Calls ApplyParameters. + * @param request ApplyParametersRequest message or plain object + * @returns Promise + */ + public applyParameters(request: google.cloud.memcache.v1.IApplyParametersRequest): Promise; + } + + namespace CloudMemcache { + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.memcache.v1.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.memcache.v1.Instance) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#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.memcache.v1.CloudMemcache#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.memcache.v1.CloudMemcache#updateParameters}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateParametersCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#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.memcache.v1.CloudMemcache#applyParameters}. + * @param error Error, if any + * @param [response] Operation + */ + type ApplyParametersCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance displayName */ + displayName?: (string|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance authorizedNetwork */ + authorizedNetwork?: (string|null); + + /** Instance zones */ + zones?: (string[]|null); + + /** Instance nodeCount */ + nodeCount?: (number|null); + + /** Instance nodeConfig */ + nodeConfig?: (google.cloud.memcache.v1.Instance.INodeConfig|null); + + /** Instance memcacheVersion */ + memcacheVersion?: (google.cloud.memcache.v1.MemcacheVersion|keyof typeof google.cloud.memcache.v1.MemcacheVersion|null); + + /** Instance parameters */ + parameters?: (google.cloud.memcache.v1.IMemcacheParameters|null); + + /** Instance memcacheNodes */ + memcacheNodes?: (google.cloud.memcache.v1.Instance.INode[]|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance state */ + state?: (google.cloud.memcache.v1.Instance.State|keyof typeof google.cloud.memcache.v1.Instance.State|null); + + /** Instance memcacheFullVersion */ + memcacheFullVersion?: (string|null); + + /** Instance instanceMessages */ + instanceMessages?: (google.cloud.memcache.v1.Instance.IInstanceMessage[]|null); + + /** Instance discoveryEndpoint */ + discoveryEndpoint?: (string|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance displayName. */ + public displayName: string; + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance authorizedNetwork. */ + public authorizedNetwork: string; + + /** Instance zones. */ + public zones: string[]; + + /** Instance nodeCount. */ + public nodeCount: number; + + /** Instance nodeConfig. */ + public nodeConfig?: (google.cloud.memcache.v1.Instance.INodeConfig|null); + + /** Instance memcacheVersion. */ + public memcacheVersion: (google.cloud.memcache.v1.MemcacheVersion|keyof typeof google.cloud.memcache.v1.MemcacheVersion); + + /** Instance parameters. */ + public parameters?: (google.cloud.memcache.v1.IMemcacheParameters|null); + + /** Instance memcacheNodes. */ + public memcacheNodes: google.cloud.memcache.v1.Instance.INode[]; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance state. */ + public state: (google.cloud.memcache.v1.Instance.State|keyof typeof google.cloud.memcache.v1.Instance.State); + + /** Instance memcacheFullVersion. */ + public memcacheFullVersion: string; + + /** Instance instanceMessages. */ + public instanceMessages: google.cloud.memcache.v1.Instance.IInstanceMessage[]; + + /** Instance discoveryEndpoint. */ + public discoveryEndpoint: string; + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.memcache.v1.IInstance): google.cloud.memcache.v1.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.memcache.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.memcache.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.memcache.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.memcache.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.memcache.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.memcache.v1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Instance { + + /** Properties of a NodeConfig. */ + interface INodeConfig { + + /** NodeConfig cpuCount */ + cpuCount?: (number|null); + + /** NodeConfig memorySizeMb */ + memorySizeMb?: (number|null); + } + + /** Represents a NodeConfig. */ + class NodeConfig implements INodeConfig { + + /** + * Constructs a new NodeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.Instance.INodeConfig); + + /** NodeConfig cpuCount. */ + public cpuCount: number; + + /** NodeConfig memorySizeMb. */ + public memorySizeMb: number; + + /** + * Creates a new NodeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeConfig instance + */ + public static create(properties?: google.cloud.memcache.v1.Instance.INodeConfig): google.cloud.memcache.v1.Instance.NodeConfig; + + /** + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.memcache.v1.Instance.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.Instance.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.Instance.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.Instance.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.Instance.NodeConfig; + + /** + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.Instance.NodeConfig; + + /** + * Verifies a NodeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.Instance.NodeConfig; + + /** + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @param message NodeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.Instance.NodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Node. */ + interface INode { + + /** Node nodeId */ + nodeId?: (string|null); + + /** Node zone */ + zone?: (string|null); + + /** Node state */ + state?: (google.cloud.memcache.v1.Instance.Node.State|keyof typeof google.cloud.memcache.v1.Instance.Node.State|null); + + /** Node host */ + host?: (string|null); + + /** Node port */ + port?: (number|null); + + /** Node parameters */ + parameters?: (google.cloud.memcache.v1.IMemcacheParameters|null); + } + + /** Represents a Node. */ + class Node implements INode { + + /** + * Constructs a new Node. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.Instance.INode); + + /** Node nodeId. */ + public nodeId: string; + + /** Node zone. */ + public zone: string; + + /** Node state. */ + public state: (google.cloud.memcache.v1.Instance.Node.State|keyof typeof google.cloud.memcache.v1.Instance.Node.State); + + /** Node host. */ + public host: string; + + /** Node port. */ + public port: number; + + /** Node parameters. */ + public parameters?: (google.cloud.memcache.v1.IMemcacheParameters|null); + + /** + * Creates a new Node instance using the specified properties. + * @param [properties] Properties to set + * @returns Node instance + */ + public static create(properties?: google.cloud.memcache.v1.Instance.INode): google.cloud.memcache.v1.Instance.Node; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.memcache.v1.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Node message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.Instance.Node; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.Instance.Node; + + /** + * Verifies a Node message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Node + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.Instance.Node; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @param message Node + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.Instance.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Node to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Node { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + DELETING = 3, + UPDATING = 4 + } + } + + /** Properties of an InstanceMessage. */ + interface IInstanceMessage { + + /** InstanceMessage code */ + code?: (google.cloud.memcache.v1.Instance.InstanceMessage.Code|keyof typeof google.cloud.memcache.v1.Instance.InstanceMessage.Code|null); + + /** InstanceMessage message */ + message?: (string|null); + } + + /** Represents an InstanceMessage. */ + class InstanceMessage implements IInstanceMessage { + + /** + * Constructs a new InstanceMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.Instance.IInstanceMessage); + + /** InstanceMessage code. */ + public code: (google.cloud.memcache.v1.Instance.InstanceMessage.Code|keyof typeof google.cloud.memcache.v1.Instance.InstanceMessage.Code); + + /** InstanceMessage message. */ + public message: string; + + /** + * Creates a new InstanceMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceMessage instance + */ + public static create(properties?: google.cloud.memcache.v1.Instance.IInstanceMessage): google.cloud.memcache.v1.Instance.InstanceMessage; + + /** + * Encodes the specified InstanceMessage message. Does not implicitly {@link google.cloud.memcache.v1.Instance.InstanceMessage.verify|verify} messages. + * @param message InstanceMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.Instance.IInstanceMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceMessage message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.Instance.InstanceMessage.verify|verify} messages. + * @param message InstanceMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.Instance.IInstanceMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.Instance.InstanceMessage; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.Instance.InstanceMessage; + + /** + * Verifies an InstanceMessage message. + * @param message Plain 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 InstanceMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.Instance.InstanceMessage; + + /** + * Creates a plain object from an InstanceMessage message. Also converts values to other types if specified. + * @param message InstanceMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.Instance.InstanceMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InstanceMessage { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + ZONE_DISTRIBUTION_UNBALANCED = 1 + } + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + DELETING = 4, + PERFORMING_MAINTENANCE = 5 + } + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + + /** ListInstancesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** ListInstancesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.memcache.v1.IListInstancesRequest): google.cloud.memcache.v1.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.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.memcache.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.memcache.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.memcache.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.memcache.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.memcache.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.memcache.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.memcache.v1.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.memcache.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.memcache.v1.IListInstancesResponse): google.cloud.memcache.v1.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.memcache.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.memcache.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.memcache.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.memcache.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.memcache.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.memcache.v1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse 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.memcache.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.memcache.v1.IGetInstanceRequest): google.cloud.memcache.v1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.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.memcache.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.memcache.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.memcache.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.memcache.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.memcache.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.cloud.memcache.v1.IInstance|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.memcache.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.memcache.v1.ICreateInstanceRequest): google.cloud.memcache.v1.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.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.memcache.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.memcache.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.memcache.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.memcache.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.memcache.v1.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest 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.memcache.v1.IInstance|null); + } + + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { + + /** + * Constructs a new UpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IUpdateInstanceRequest); + + /** UpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance. */ + public instance?: (google.cloud.memcache.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.memcache.v1.IUpdateInstanceRequest): google.cloud.memcache.v1.UpdateInstanceRequest; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.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.memcache.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.memcache.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.memcache.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.memcache.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.memcache.v1.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceRequest 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.memcache.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.memcache.v1.IDeleteInstanceRequest): google.cloud.memcache.v1.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.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.memcache.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.memcache.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.memcache.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.memcache.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.memcache.v1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ApplyParametersRequest. */ + interface IApplyParametersRequest { + + /** ApplyParametersRequest name */ + name?: (string|null); + + /** ApplyParametersRequest nodeIds */ + nodeIds?: (string[]|null); + + /** ApplyParametersRequest applyAll */ + applyAll?: (boolean|null); + } + + /** Represents an ApplyParametersRequest. */ + class ApplyParametersRequest implements IApplyParametersRequest { + + /** + * Constructs a new ApplyParametersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IApplyParametersRequest); + + /** ApplyParametersRequest name. */ + public name: string; + + /** ApplyParametersRequest nodeIds. */ + public nodeIds: string[]; + + /** ApplyParametersRequest applyAll. */ + public applyAll: boolean; + + /** + * Creates a new ApplyParametersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplyParametersRequest instance + */ + public static create(properties?: google.cloud.memcache.v1.IApplyParametersRequest): google.cloud.memcache.v1.ApplyParametersRequest; + + /** + * Encodes the specified ApplyParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1.ApplyParametersRequest.verify|verify} messages. + * @param message ApplyParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.IApplyParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplyParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ApplyParametersRequest.verify|verify} messages. + * @param message ApplyParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.IApplyParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplyParametersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.ApplyParametersRequest; + + /** + * Decodes an ApplyParametersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.ApplyParametersRequest; + + /** + * Verifies an ApplyParametersRequest message. + * @param message Plain 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 ApplyParametersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplyParametersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.ApplyParametersRequest; + + /** + * Creates a plain object from an ApplyParametersRequest message. Also converts values to other types if specified. + * @param message ApplyParametersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.ApplyParametersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplyParametersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateParametersRequest. */ + interface IUpdateParametersRequest { + + /** UpdateParametersRequest name */ + name?: (string|null); + + /** UpdateParametersRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateParametersRequest parameters */ + parameters?: (google.cloud.memcache.v1.IMemcacheParameters|null); + } + + /** Represents an UpdateParametersRequest. */ + class UpdateParametersRequest implements IUpdateParametersRequest { + + /** + * Constructs a new UpdateParametersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IUpdateParametersRequest); + + /** UpdateParametersRequest name. */ + public name: string; + + /** UpdateParametersRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateParametersRequest parameters. */ + public parameters?: (google.cloud.memcache.v1.IMemcacheParameters|null); + + /** + * Creates a new UpdateParametersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateParametersRequest instance + */ + public static create(properties?: google.cloud.memcache.v1.IUpdateParametersRequest): google.cloud.memcache.v1.UpdateParametersRequest; + + /** + * Encodes the specified UpdateParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1.UpdateParametersRequest.verify|verify} messages. + * @param message UpdateParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.IUpdateParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.UpdateParametersRequest.verify|verify} messages. + * @param message UpdateParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.IUpdateParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateParametersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.UpdateParametersRequest; + + /** + * Decodes an UpdateParametersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.UpdateParametersRequest; + + /** + * Verifies an UpdateParametersRequest message. + * @param message Plain 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 UpdateParametersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateParametersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.UpdateParametersRequest; + + /** + * Creates a plain object from an UpdateParametersRequest message. Also converts values to other types if specified. + * @param message UpdateParametersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.UpdateParametersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateParametersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MemcacheParameters. */ + interface IMemcacheParameters { + + /** MemcacheParameters id */ + id?: (string|null); + + /** MemcacheParameters params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a MemcacheParameters. */ + class MemcacheParameters implements IMemcacheParameters { + + /** + * Constructs a new MemcacheParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IMemcacheParameters); + + /** MemcacheParameters id. */ + public id: string; + + /** MemcacheParameters params. */ + public params: { [k: string]: string }; + + /** + * Creates a new MemcacheParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns MemcacheParameters instance + */ + public static create(properties?: google.cloud.memcache.v1.IMemcacheParameters): google.cloud.memcache.v1.MemcacheParameters; + + /** + * Encodes the specified MemcacheParameters message. Does not implicitly {@link google.cloud.memcache.v1.MemcacheParameters.verify|verify} messages. + * @param message MemcacheParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.IMemcacheParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MemcacheParameters message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.MemcacheParameters.verify|verify} messages. + * @param message MemcacheParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.IMemcacheParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MemcacheParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MemcacheParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.MemcacheParameters; + + /** + * Decodes a MemcacheParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MemcacheParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.MemcacheParameters; + + /** + * Verifies a MemcacheParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MemcacheParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MemcacheParameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.MemcacheParameters; + + /** + * Creates a plain object from a MemcacheParameters message. Also converts values to other types if specified. + * @param message MemcacheParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.MemcacheParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MemcacheParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusDetail */ + statusDetail?: (string|null); + + /** OperationMetadata 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.memcache.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusDetail. */ + public statusDetail: string; + + /** OperationMetadata 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.memcache.v1.IOperationMetadata): google.cloud.memcache.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.memcache.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** MemcacheVersion enum. */ + enum MemcacheVersion { + MEMCACHE_VERSION_UNSPECIFIED = 0, + MEMCACHE_1_5 = 1 + } + } + /** Namespace v1beta2. */ namespace v1beta2 { diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index f61c4abdec6..b8fe91e85e3 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/protos/protos.js @@ -57,6 +57,4234 @@ */ var memcache = {}; + memcache.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.memcache + * @namespace + */ + var v1 = {}; + + v1.CloudMemcache = (function() { + + /** + * Constructs a new CloudMemcache service. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents a CloudMemcache + * @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 CloudMemcache(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CloudMemcache.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudMemcache; + + /** + * Creates new CloudMemcache service using the specified rpc implementation. + * @function create + * @memberof google.cloud.memcache.v1.CloudMemcache + * @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 {CloudMemcache} RPC service. Useful where requests and/or responses are streamed. + */ + CloudMemcache.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#listInstances}. + * @memberof google.cloud.memcache.v1.CloudMemcache + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.memcache.v1.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.memcache.v1.CloudMemcache.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.memcache.v1.ListInstancesRequest, $root.google.cloud.memcache.v1.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#getInstance}. + * @memberof google.cloud.memcache.v1.CloudMemcache + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.memcache.v1.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.memcache.v1.CloudMemcache.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.memcache.v1.GetInstanceRequest, $root.google.cloud.memcache.v1.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#createInstance}. + * @memberof google.cloud.memcache.v1.CloudMemcache + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.memcache.v1.CloudMemcache.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.memcache.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#updateInstance}. + * @memberof google.cloud.memcache.v1.CloudMemcache + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.memcache.v1.CloudMemcache.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.cloud.memcache.v1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#updateParameters}. + * @memberof google.cloud.memcache.v1.CloudMemcache + * @typedef UpdateParametersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateParameters. + * @function updateParameters + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IUpdateParametersRequest} request UpdateParametersRequest message or plain object + * @param {google.cloud.memcache.v1.CloudMemcache.UpdateParametersCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.updateParameters = function updateParameters(request, callback) { + return this.rpcCall(updateParameters, $root.google.cloud.memcache.v1.UpdateParametersRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateParameters" }); + + /** + * Calls UpdateParameters. + * @function updateParameters + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IUpdateParametersRequest} request UpdateParametersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#deleteInstance}. + * @memberof google.cloud.memcache.v1.CloudMemcache + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.memcache.v1.CloudMemcache.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.memcache.v1.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#applyParameters}. + * @memberof google.cloud.memcache.v1.CloudMemcache + * @typedef ApplyParametersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ApplyParameters. + * @function applyParameters + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IApplyParametersRequest} request ApplyParametersRequest message or plain object + * @param {google.cloud.memcache.v1.CloudMemcache.ApplyParametersCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.applyParameters = function applyParameters(request, callback) { + return this.rpcCall(applyParameters, $root.google.cloud.memcache.v1.ApplyParametersRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ApplyParameters" }); + + /** + * Calls ApplyParameters. + * @function applyParameters + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IApplyParametersRequest} request ApplyParametersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CloudMemcache; + })(); + + v1.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.memcache.v1 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [displayName] Instance displayName + * @property {Object.|null} [labels] Instance labels + * @property {string|null} [authorizedNetwork] Instance authorizedNetwork + * @property {Array.|null} [zones] Instance zones + * @property {number|null} [nodeCount] Instance nodeCount + * @property {google.cloud.memcache.v1.Instance.INodeConfig|null} [nodeConfig] Instance nodeConfig + * @property {google.cloud.memcache.v1.MemcacheVersion|null} [memcacheVersion] Instance memcacheVersion + * @property {google.cloud.memcache.v1.IMemcacheParameters|null} [parameters] Instance parameters + * @property {Array.|null} [memcacheNodes] Instance memcacheNodes + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.cloud.memcache.v1.Instance.State|null} [state] Instance state + * @property {string|null} [memcacheFullVersion] Instance memcacheFullVersion + * @property {Array.|null} [instanceMessages] Instance instanceMessages + * @property {string|null} [discoveryEndpoint] Instance discoveryEndpoint + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.memcache.v1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.zones = []; + this.memcacheNodes = []; + this.instanceMessages = []; + if (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.memcache.v1.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.displayName = ""; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance authorizedNetwork. + * @member {string} authorizedNetwork + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.authorizedNetwork = ""; + + /** + * Instance zones. + * @member {Array.} zones + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.zones = $util.emptyArray; + + /** + * Instance nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.nodeCount = 0; + + /** + * Instance nodeConfig. + * @member {google.cloud.memcache.v1.Instance.INodeConfig|null|undefined} nodeConfig + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.nodeConfig = null; + + /** + * Instance memcacheVersion. + * @member {google.cloud.memcache.v1.MemcacheVersion} memcacheVersion + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.memcacheVersion = 0; + + /** + * Instance parameters. + * @member {google.cloud.memcache.v1.IMemcacheParameters|null|undefined} parameters + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.parameters = null; + + /** + * Instance memcacheNodes. + * @member {Array.} memcacheNodes + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.memcacheNodes = $util.emptyArray; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance state. + * @member {google.cloud.memcache.v1.Instance.State} state + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance memcacheFullVersion. + * @member {string} memcacheFullVersion + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.memcacheFullVersion = ""; + + /** + * Instance instanceMessages. + * @member {Array.} instanceMessages + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.instanceMessages = $util.emptyArray; + + /** + * Instance discoveryEndpoint. + * @member {string} discoveryEndpoint + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.discoveryEndpoint = ""; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.Instance + * @static + * @param {google.cloud.memcache.v1.IInstance=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.memcache.v1.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.Instance + * @static + * @param {google.cloud.memcache.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + 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 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.authorizedNetwork != null && Object.hasOwnProperty.call(message, "authorizedNetwork")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.authorizedNetwork); + if (message.zones != null && message.zones.length) + for (var i = 0; i < message.zones.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.zones[i]); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.nodeCount); + if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) + $root.google.cloud.memcache.v1.Instance.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.memcacheVersion != null && Object.hasOwnProperty.call(message, "memcacheVersion")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.memcacheVersion); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.memcache.v1.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.memcacheNodes != null && message.memcacheNodes.length) + for (var i = 0; i < message.memcacheNodes.length; ++i) + $root.google.cloud.memcache.v1.Instance.Node.encode(message.memcacheNodes[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.state); + if (message.memcacheFullVersion != null && Object.hasOwnProperty.call(message, "memcacheFullVersion")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.memcacheFullVersion); + if (message.instanceMessages != null && message.instanceMessages.length) + for (var i = 0; i < message.instanceMessages.length; ++i) + $root.google.cloud.memcache.v1.Instance.InstanceMessage.encode(message.instanceMessages[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.discoveryEndpoint != null && Object.hasOwnProperty.call(message, "discoveryEndpoint")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.discoveryEndpoint); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.Instance + * @static + * @param {google.cloud.memcache.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.memcache.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.memcache.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.memcache.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.displayName = reader.string(); + break; + case 3: + 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 4: + message.authorizedNetwork = reader.string(); + break; + case 5: + if (!(message.zones && message.zones.length)) + message.zones = []; + message.zones.push(reader.string()); + break; + case 6: + message.nodeCount = reader.int32(); + break; + case 7: + message.nodeConfig = $root.google.cloud.memcache.v1.Instance.NodeConfig.decode(reader, reader.uint32()); + break; + case 9: + message.memcacheVersion = reader.int32(); + break; + case 11: + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.decode(reader, reader.uint32()); + break; + case 12: + if (!(message.memcacheNodes && message.memcacheNodes.length)) + message.memcacheNodes = []; + message.memcacheNodes.push($root.google.cloud.memcache.v1.Instance.Node.decode(reader, reader.uint32())); + break; + case 13: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 14: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 15: + message.state = reader.int32(); + break; + case 18: + message.memcacheFullVersion = reader.string(); + break; + case 19: + if (!(message.instanceMessages && message.instanceMessages.length)) + message.instanceMessages = []; + message.instanceMessages.push($root.google.cloud.memcache.v1.Instance.InstanceMessage.decode(reader, reader.uint32())); + break; + case 20: + message.discoveryEndpoint = reader.string(); + 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.memcache.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.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.memcache.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.authorizedNetwork != null && message.hasOwnProperty("authorizedNetwork")) + if (!$util.isString(message.authorizedNetwork)) + return "authorizedNetwork: string expected"; + if (message.zones != null && message.hasOwnProperty("zones")) { + if (!Array.isArray(message.zones)) + return "zones: array expected"; + for (var i = 0; i < message.zones.length; ++i) + if (!$util.isString(message.zones[i])) + return "zones: string[] expected"; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) { + var error = $root.google.cloud.memcache.v1.Instance.NodeConfig.verify(message.nodeConfig); + if (error) + return "nodeConfig." + error; + } + if (message.memcacheVersion != null && message.hasOwnProperty("memcacheVersion")) + switch (message.memcacheVersion) { + default: + return "memcacheVersion: enum value expected"; + case 0: + case 1: + break; + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.memcache.v1.MemcacheParameters.verify(message.parameters); + if (error) + return "parameters." + error; + } + if (message.memcacheNodes != null && message.hasOwnProperty("memcacheNodes")) { + if (!Array.isArray(message.memcacheNodes)) + return "memcacheNodes: array expected"; + for (var i = 0; i < message.memcacheNodes.length; ++i) { + var error = $root.google.cloud.memcache.v1.Instance.Node.verify(message.memcacheNodes[i]); + if (error) + return "memcacheNodes." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + break; + } + if (message.memcacheFullVersion != null && message.hasOwnProperty("memcacheFullVersion")) + if (!$util.isString(message.memcacheFullVersion)) + return "memcacheFullVersion: string expected"; + if (message.instanceMessages != null && message.hasOwnProperty("instanceMessages")) { + if (!Array.isArray(message.instanceMessages)) + return "instanceMessages: array expected"; + for (var i = 0; i < message.instanceMessages.length; ++i) { + var error = $root.google.cloud.memcache.v1.Instance.InstanceMessage.verify(message.instanceMessages[i]); + if (error) + return "instanceMessages." + error; + } + } + if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) + if (!$util.isString(message.discoveryEndpoint)) + return "discoveryEndpoint: string expected"; + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.Instance) + return object; + var message = new $root.google.cloud.memcache.v1.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.memcache.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.authorizedNetwork != null) + message.authorizedNetwork = String(object.authorizedNetwork); + if (object.zones) { + if (!Array.isArray(object.zones)) + throw TypeError(".google.cloud.memcache.v1.Instance.zones: array expected"); + message.zones = []; + for (var i = 0; i < object.zones.length; ++i) + message.zones[i] = String(object.zones[i]); + } + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.nodeConfig != null) { + if (typeof object.nodeConfig !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.nodeConfig: object expected"); + message.nodeConfig = $root.google.cloud.memcache.v1.Instance.NodeConfig.fromObject(object.nodeConfig); + } + switch (object.memcacheVersion) { + case "MEMCACHE_VERSION_UNSPECIFIED": + case 0: + message.memcacheVersion = 0; + break; + case "MEMCACHE_1_5": + case 1: + message.memcacheVersion = 1; + break; + } + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.parameters: object expected"); + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.fromObject(object.parameters); + } + if (object.memcacheNodes) { + if (!Array.isArray(object.memcacheNodes)) + throw TypeError(".google.cloud.memcache.v1.Instance.memcacheNodes: array expected"); + message.memcacheNodes = []; + for (var i = 0; i < object.memcacheNodes.length; ++i) { + if (typeof object.memcacheNodes[i] !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.memcacheNodes: object expected"); + message.memcacheNodes[i] = $root.google.cloud.memcache.v1.Instance.Node.fromObject(object.memcacheNodes[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "PERFORMING_MAINTENANCE": + case 5: + message.state = 5; + break; + } + if (object.memcacheFullVersion != null) + message.memcacheFullVersion = String(object.memcacheFullVersion); + if (object.instanceMessages) { + if (!Array.isArray(object.instanceMessages)) + throw TypeError(".google.cloud.memcache.v1.Instance.instanceMessages: array expected"); + message.instanceMessages = []; + for (var i = 0; i < object.instanceMessages.length; ++i) { + if (typeof object.instanceMessages[i] !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.instanceMessages: object expected"); + message.instanceMessages[i] = $root.google.cloud.memcache.v1.Instance.InstanceMessage.fromObject(object.instanceMessages[i]); + } + } + if (object.discoveryEndpoint != null) + message.discoveryEndpoint = String(object.discoveryEndpoint); + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.Instance + * @static + * @param {google.cloud.memcache.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.zones = []; + object.memcacheNodes = []; + object.instanceMessages = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.authorizedNetwork = ""; + object.nodeCount = 0; + object.nodeConfig = null; + object.memcacheVersion = options.enums === String ? "MEMCACHE_VERSION_UNSPECIFIED" : 0; + object.parameters = null; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.memcacheFullVersion = ""; + object.discoveryEndpoint = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + 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.authorizedNetwork != null && message.hasOwnProperty("authorizedNetwork")) + object.authorizedNetwork = message.authorizedNetwork; + if (message.zones && message.zones.length) { + object.zones = []; + for (var j = 0; j < message.zones.length; ++j) + object.zones[j] = message.zones[j]; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) + object.nodeConfig = $root.google.cloud.memcache.v1.Instance.NodeConfig.toObject(message.nodeConfig, options); + if (message.memcacheVersion != null && message.hasOwnProperty("memcacheVersion")) + object.memcacheVersion = options.enums === String ? $root.google.cloud.memcache.v1.MemcacheVersion[message.memcacheVersion] : message.memcacheVersion; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.toObject(message.parameters, options); + if (message.memcacheNodes && message.memcacheNodes.length) { + object.memcacheNodes = []; + for (var j = 0; j < message.memcacheNodes.length; ++j) + object.memcacheNodes[j] = $root.google.cloud.memcache.v1.Instance.Node.toObject(message.memcacheNodes[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.memcache.v1.Instance.State[message.state] : message.state; + if (message.memcacheFullVersion != null && message.hasOwnProperty("memcacheFullVersion")) + object.memcacheFullVersion = message.memcacheFullVersion; + if (message.instanceMessages && message.instanceMessages.length) { + object.instanceMessages = []; + for (var j = 0; j < message.instanceMessages.length; ++j) + object.instanceMessages[j] = $root.google.cloud.memcache.v1.Instance.InstanceMessage.toObject(message.instanceMessages[j], options); + } + if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) + object.discoveryEndpoint = message.discoveryEndpoint; + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Instance.NodeConfig = (function() { + + /** + * Properties of a NodeConfig. + * @memberof google.cloud.memcache.v1.Instance + * @interface INodeConfig + * @property {number|null} [cpuCount] NodeConfig cpuCount + * @property {number|null} [memorySizeMb] NodeConfig memorySizeMb + */ + + /** + * Constructs a new NodeConfig. + * @memberof google.cloud.memcache.v1.Instance + * @classdesc Represents a NodeConfig. + * @implements INodeConfig + * @constructor + * @param {google.cloud.memcache.v1.Instance.INodeConfig=} [properties] Properties to set + */ + function NodeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeConfig cpuCount. + * @member {number} cpuCount + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @instance + */ + NodeConfig.prototype.cpuCount = 0; + + /** + * NodeConfig memorySizeMb. + * @member {number} memorySizeMb + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @instance + */ + NodeConfig.prototype.memorySizeMb = 0; + + /** + * Creates a new NodeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1.Instance.INodeConfig=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.Instance.NodeConfig} NodeConfig instance + */ + NodeConfig.create = function create(properties) { + return new NodeConfig(properties); + }; + + /** + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.memcache.v1.Instance.NodeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1.Instance.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); + if (message.memorySizeMb != null && Object.hasOwnProperty.call(message, "memorySizeMb")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.memorySizeMb); + return writer; + }; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.Instance.NodeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1.Instance.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.Instance.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.Instance.NodeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cpuCount = reader.int32(); + break; + case 2: + message.memorySizeMb = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.Instance.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeConfig message. + * @function verify + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + if (!$util.isInteger(message.cpuCount)) + return "cpuCount: integer expected"; + if (message.memorySizeMb != null && message.hasOwnProperty("memorySizeMb")) + if (!$util.isInteger(message.memorySizeMb)) + return "memorySizeMb: integer expected"; + return null; + }; + + /** + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.Instance.NodeConfig} NodeConfig + */ + NodeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.Instance.NodeConfig) + return object; + var message = new $root.google.cloud.memcache.v1.Instance.NodeConfig(); + if (object.cpuCount != null) + message.cpuCount = object.cpuCount | 0; + if (object.memorySizeMb != null) + message.memorySizeMb = object.memorySizeMb | 0; + return message; + }; + + /** + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1.Instance.NodeConfig} message NodeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpuCount = 0; + object.memorySizeMb = 0; + } + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + object.cpuCount = message.cpuCount; + if (message.memorySizeMb != null && message.hasOwnProperty("memorySizeMb")) + object.memorySizeMb = message.memorySizeMb; + return object; + }; + + /** + * Converts this NodeConfig to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @instance + * @returns {Object.} JSON object + */ + NodeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeConfig; + })(); + + Instance.Node = (function() { + + /** + * Properties of a Node. + * @memberof google.cloud.memcache.v1.Instance + * @interface INode + * @property {string|null} [nodeId] Node nodeId + * @property {string|null} [zone] Node zone + * @property {google.cloud.memcache.v1.Instance.Node.State|null} [state] Node state + * @property {string|null} [host] Node host + * @property {number|null} [port] Node port + * @property {google.cloud.memcache.v1.IMemcacheParameters|null} [parameters] Node parameters + */ + + /** + * Constructs a new Node. + * @memberof google.cloud.memcache.v1.Instance + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {google.cloud.memcache.v1.Instance.INode=} [properties] Properties to set + */ + function Node(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Node nodeId. + * @member {string} nodeId + * @memberof google.cloud.memcache.v1.Instance.Node + * @instance + */ + Node.prototype.nodeId = ""; + + /** + * Node zone. + * @member {string} zone + * @memberof google.cloud.memcache.v1.Instance.Node + * @instance + */ + Node.prototype.zone = ""; + + /** + * Node state. + * @member {google.cloud.memcache.v1.Instance.Node.State} state + * @memberof google.cloud.memcache.v1.Instance.Node + * @instance + */ + Node.prototype.state = 0; + + /** + * Node host. + * @member {string} host + * @memberof google.cloud.memcache.v1.Instance.Node + * @instance + */ + Node.prototype.host = ""; + + /** + * Node port. + * @member {number} port + * @memberof google.cloud.memcache.v1.Instance.Node + * @instance + */ + Node.prototype.port = 0; + + /** + * Node parameters. + * @member {google.cloud.memcache.v1.IMemcacheParameters|null|undefined} parameters + * @memberof google.cloud.memcache.v1.Instance.Node + * @instance + */ + Node.prototype.parameters = null; + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {google.cloud.memcache.v1.Instance.INode=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.Instance.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.memcache.v1.Instance.Node.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {google.cloud.memcache.v1.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeId != null && Object.hasOwnProperty.call(message, "nodeId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeId); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.host); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.port); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.memcache.v1.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.Instance.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {google.cloud.memcache.v1.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.Instance.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nodeId = reader.string(); + break; + case 2: + message.zone = reader.string(); + break; + case 3: + message.state = reader.int32(); + break; + case 4: + message.host = reader.string(); + break; + case 5: + message.port = reader.int32(); + break; + case 6: + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + if (!$util.isString(message.nodeId)) + return "nodeId: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: 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.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.memcache.v1.MemcacheParameters.verify(message.parameters); + if (error) + return "parameters." + error; + } + return null; + }; + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.Instance.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.Instance.Node) + return object; + var message = new $root.google.cloud.memcache.v1.Instance.Node(); + if (object.nodeId != null) + message.nodeId = String(object.nodeId); + if (object.zone != null) + message.zone = String(object.zone); + 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 "DELETING": + case 3: + message.state = 3; + break; + case "UPDATING": + case 4: + message.state = 4; + break; + } + if (object.host != null) + message.host = String(object.host); + if (object.port != null) + message.port = object.port | 0; + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.Node.parameters: object expected"); + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.fromObject(object.parameters); + } + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {google.cloud.memcache.v1.Instance.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.nodeId = ""; + object.zone = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.host = ""; + object.port = 0; + object.parameters = null; + } + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + object.nodeId = message.nodeId; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.memcache.v1.Instance.Node.State[message.state] : message.state; + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.toObject(message.parameters, options); + return object; + }; + + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.Instance.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.memcache.v1.Instance.Node.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} DELETING=3 DELETING value + * @property {number} UPDATING=4 UPDATING value + */ + Node.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] = "DELETING"] = 3; + values[valuesById[4] = "UPDATING"] = 4; + return values; + })(); + + return Node; + })(); + + Instance.InstanceMessage = (function() { + + /** + * Properties of an InstanceMessage. + * @memberof google.cloud.memcache.v1.Instance + * @interface IInstanceMessage + * @property {google.cloud.memcache.v1.Instance.InstanceMessage.Code|null} [code] InstanceMessage code + * @property {string|null} [message] InstanceMessage message + */ + + /** + * Constructs a new InstanceMessage. + * @memberof google.cloud.memcache.v1.Instance + * @classdesc Represents an InstanceMessage. + * @implements IInstanceMessage + * @constructor + * @param {google.cloud.memcache.v1.Instance.IInstanceMessage=} [properties] Properties to set + */ + function InstanceMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceMessage code. + * @member {google.cloud.memcache.v1.Instance.InstanceMessage.Code} code + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @instance + */ + InstanceMessage.prototype.code = 0; + + /** + * InstanceMessage message. + * @member {string} message + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @instance + */ + InstanceMessage.prototype.message = ""; + + /** + * Creates a new InstanceMessage instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1.Instance.IInstanceMessage=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.Instance.InstanceMessage} InstanceMessage instance + */ + InstanceMessage.create = function create(properties) { + return new InstanceMessage(properties); + }; + + /** + * Encodes the specified InstanceMessage message. Does not implicitly {@link google.cloud.memcache.v1.Instance.InstanceMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1.Instance.IInstanceMessage} message InstanceMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceMessage.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); + return writer; + }; + + /** + * Encodes the specified InstanceMessage message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.Instance.InstanceMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1.Instance.IInstanceMessage} message InstanceMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.Instance.InstanceMessage} InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.Instance.InstanceMessage(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.Instance.InstanceMessage} InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceMessage message. + * @function verify + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates an InstanceMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.Instance.InstanceMessage} InstanceMessage + */ + InstanceMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.Instance.InstanceMessage) + return object; + var message = new $root.google.cloud.memcache.v1.Instance.InstanceMessage(); + switch (object.code) { + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "ZONE_DISTRIBUTION_UNBALANCED": + case 1: + message.code = 1; + break; + } + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from an InstanceMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1.Instance.InstanceMessage} message InstanceMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "CODE_UNSPECIFIED" : 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.memcache.v1.Instance.InstanceMessage.Code[message.code] : message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this InstanceMessage to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @instance + * @returns {Object.} JSON object + */ + InstanceMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Code enum. + * @name google.cloud.memcache.v1.Instance.InstanceMessage.Code + * @enum {number} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} ZONE_DISTRIBUTION_UNBALANCED=1 ZONE_DISTRIBUTION_UNBALANCED value + */ + InstanceMessage.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ZONE_DISTRIBUTION_UNBALANCED"] = 1; + return values; + })(); + + return InstanceMessage; + })(); + + /** + * State enum. + * @name google.cloud.memcache.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} DELETING=4 DELETING value + * @property {number} PERFORMING_MAINTENANCE=5 PERFORMING_MAINTENANCE 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[4] = "DELETING"] = 4; + values[valuesById[5] = "PERFORMING_MAINTENANCE"] = 5; + return values; + })(); + + return Instance; + })(); + + v1.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.memcache.v1 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [filter] ListInstancesRequest filter + * @property {string|null} [orderBy] ListInstancesRequest orderBy + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.memcache.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.memcache.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @static + * @param {google.cloud.memcache.v1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @static + * @param {google.cloud.memcache.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @static + * @param {google.cloud.memcache.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.memcache.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.memcache.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.memcache.v1.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + case 5: + message.orderBy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.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.memcache.v1.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.ListInstancesRequest) + return object; + var message = new $root.google.cloud.memcache.v1.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @static + * @param {google.cloud.memcache.v1.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.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.memcache.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.memcache.v1 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.memcache.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.memcache.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @static + * @param {google.cloud.memcache.v1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @static + * @param {google.cloud.memcache.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.memcache.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.memcache.v1.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @static + * @param {google.cloud.memcache.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.memcache.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.memcache.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.memcache.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.memcache.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.memcache.v1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.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.memcache.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.memcache.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.memcache.v1.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.ListInstancesResponse) + return object; + var message = new $root.google.cloud.memcache.v1.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.memcache.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.memcache.v1.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.memcache.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.memcache.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.memcache.v1.ListInstancesResponse + * @static + * @param {google.cloud.memcache.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.memcache.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.memcache.v1.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesResponse; + })(); + + v1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.memcache.v1 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.memcache.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.memcache.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @static + * @param {google.cloud.memcache.v1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @static + * @param {google.cloud.memcache.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.memcache.v1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @static + * @param {google.cloud.memcache.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.memcache.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.memcache.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.memcache.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.memcache.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.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.memcache.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.memcache.v1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.GetInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.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.memcache.v1.GetInstanceRequest + * @static + * @param {google.cloud.memcache.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.memcache.v1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInstanceRequest; + })(); + + v1.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.memcache.v1 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.memcache.v1.IInstance|null} [instance] CreateInstanceRequest instance + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.memcache.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.memcache.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.cloud.memcache.v1.IInstance|null|undefined} instance + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @static + * @param {google.cloud.memcache.v1.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @static + * @param {google.cloud.memcache.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.memcache.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.memcache.v1.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @static + * @param {google.cloud.memcache.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.memcache.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.memcache.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.memcache.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.memcache.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.memcache.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.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.memcache.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.memcache.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.memcache.v1.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.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.memcache.v1.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.memcache.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.memcache.v1.CreateInstanceRequest + * @static + * @param {google.cloud.memcache.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.memcache.v1.Instance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateInstanceRequest; + })(); + + v1.UpdateInstanceRequest = (function() { + + /** + * Properties of an UpdateInstanceRequest. + * @memberof google.cloud.memcache.v1 + * @interface IUpdateInstanceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask + * @property {google.cloud.memcache.v1.IInstance|null} [instance] UpdateInstanceRequest instance + */ + + /** + * Constructs a new UpdateInstanceRequest. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest + * @constructor + * @param {google.cloud.memcache.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.memcache.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.updateMask = null; + + /** + * UpdateInstanceRequest instance. + * @member {google.cloud.memcache.v1.IInstance|null|undefined} instance + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.instance = null; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.memcache.v1.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.UpdateInstanceRequest} UpdateInstanceRequest instance + */ + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.memcache.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.memcache.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.memcache.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.memcache.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.memcache.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.memcache.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.memcache.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.memcache.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.memcache.v1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.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.memcache.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.memcache.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.memcache.v1.UpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.UpdateInstanceRequest} UpdateInstanceRequest + */ + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.UpdateInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.v1.UpdateInstanceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.memcache.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.memcache.v1.UpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.memcache.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.memcache.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.memcache.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.memcache.v1.Instance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateInstanceRequest; + })(); + + v1.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.memcache.v1 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.memcache.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.memcache.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.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.memcache.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.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.memcache.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.memcache.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.memcache.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.memcache.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.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.memcache.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.memcache.v1.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.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.memcache.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.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.memcache.v1.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteInstanceRequest; + })(); + + v1.ApplyParametersRequest = (function() { + + /** + * Properties of an ApplyParametersRequest. + * @memberof google.cloud.memcache.v1 + * @interface IApplyParametersRequest + * @property {string|null} [name] ApplyParametersRequest name + * @property {Array.|null} [nodeIds] ApplyParametersRequest nodeIds + * @property {boolean|null} [applyAll] ApplyParametersRequest applyAll + */ + + /** + * Constructs a new ApplyParametersRequest. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents an ApplyParametersRequest. + * @implements IApplyParametersRequest + * @constructor + * @param {google.cloud.memcache.v1.IApplyParametersRequest=} [properties] Properties to set + */ + function ApplyParametersRequest(properties) { + this.nodeIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplyParametersRequest name. + * @member {string} name + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @instance + */ + ApplyParametersRequest.prototype.name = ""; + + /** + * ApplyParametersRequest nodeIds. + * @member {Array.} nodeIds + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @instance + */ + ApplyParametersRequest.prototype.nodeIds = $util.emptyArray; + + /** + * ApplyParametersRequest applyAll. + * @member {boolean} applyAll + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @instance + */ + ApplyParametersRequest.prototype.applyAll = false; + + /** + * Creates a new ApplyParametersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1.IApplyParametersRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.ApplyParametersRequest} ApplyParametersRequest instance + */ + ApplyParametersRequest.create = function create(properties) { + return new ApplyParametersRequest(properties); + }; + + /** + * Encodes the specified ApplyParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1.ApplyParametersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1.IApplyParametersRequest} message ApplyParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyParametersRequest.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.nodeIds != null && message.nodeIds.length) + for (var i = 0; i < message.nodeIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIds[i]); + if (message.applyAll != null && Object.hasOwnProperty.call(message, "applyAll")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.applyAll); + return writer; + }; + + /** + * Encodes the specified ApplyParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ApplyParametersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1.IApplyParametersRequest} message ApplyParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyParametersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplyParametersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.ApplyParametersRequest} ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyParametersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.ApplyParametersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.nodeIds && message.nodeIds.length)) + message.nodeIds = []; + message.nodeIds.push(reader.string()); + break; + case 3: + message.applyAll = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApplyParametersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.ApplyParametersRequest} ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyParametersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplyParametersRequest message. + * @function verify + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplyParametersRequest.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.nodeIds != null && message.hasOwnProperty("nodeIds")) { + if (!Array.isArray(message.nodeIds)) + return "nodeIds: array expected"; + for (var i = 0; i < message.nodeIds.length; ++i) + if (!$util.isString(message.nodeIds[i])) + return "nodeIds: string[] expected"; + } + if (message.applyAll != null && message.hasOwnProperty("applyAll")) + if (typeof message.applyAll !== "boolean") + return "applyAll: boolean expected"; + return null; + }; + + /** + * Creates an ApplyParametersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.ApplyParametersRequest} ApplyParametersRequest + */ + ApplyParametersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.ApplyParametersRequest) + return object; + var message = new $root.google.cloud.memcache.v1.ApplyParametersRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.nodeIds) { + if (!Array.isArray(object.nodeIds)) + throw TypeError(".google.cloud.memcache.v1.ApplyParametersRequest.nodeIds: array expected"); + message.nodeIds = []; + for (var i = 0; i < object.nodeIds.length; ++i) + message.nodeIds[i] = String(object.nodeIds[i]); + } + if (object.applyAll != null) + message.applyAll = Boolean(object.applyAll); + return message; + }; + + /** + * Creates a plain object from an ApplyParametersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1.ApplyParametersRequest} message ApplyParametersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplyParametersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeIds = []; + if (options.defaults) { + object.name = ""; + object.applyAll = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.nodeIds && message.nodeIds.length) { + object.nodeIds = []; + for (var j = 0; j < message.nodeIds.length; ++j) + object.nodeIds[j] = message.nodeIds[j]; + } + if (message.applyAll != null && message.hasOwnProperty("applyAll")) + object.applyAll = message.applyAll; + return object; + }; + + /** + * Converts this ApplyParametersRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @instance + * @returns {Object.} JSON object + */ + ApplyParametersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ApplyParametersRequest; + })(); + + v1.UpdateParametersRequest = (function() { + + /** + * Properties of an UpdateParametersRequest. + * @memberof google.cloud.memcache.v1 + * @interface IUpdateParametersRequest + * @property {string|null} [name] UpdateParametersRequest name + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateParametersRequest updateMask + * @property {google.cloud.memcache.v1.IMemcacheParameters|null} [parameters] UpdateParametersRequest parameters + */ + + /** + * Constructs a new UpdateParametersRequest. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents an UpdateParametersRequest. + * @implements IUpdateParametersRequest + * @constructor + * @param {google.cloud.memcache.v1.IUpdateParametersRequest=} [properties] Properties to set + */ + function UpdateParametersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateParametersRequest name. + * @member {string} name + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @instance + */ + UpdateParametersRequest.prototype.name = ""; + + /** + * UpdateParametersRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @instance + */ + UpdateParametersRequest.prototype.updateMask = null; + + /** + * UpdateParametersRequest parameters. + * @member {google.cloud.memcache.v1.IMemcacheParameters|null|undefined} parameters + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @instance + */ + UpdateParametersRequest.prototype.parameters = null; + + /** + * Creates a new UpdateParametersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1.IUpdateParametersRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.UpdateParametersRequest} UpdateParametersRequest instance + */ + UpdateParametersRequest.create = function create(properties) { + return new UpdateParametersRequest(properties); + }; + + /** + * Encodes the specified UpdateParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1.UpdateParametersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1.IUpdateParametersRequest} message UpdateParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateParametersRequest.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.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.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.memcache.v1.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.UpdateParametersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1.IUpdateParametersRequest} message UpdateParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateParametersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateParametersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.UpdateParametersRequest} UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateParametersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.UpdateParametersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateParametersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.UpdateParametersRequest} UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateParametersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateParametersRequest message. + * @function verify + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateParametersRequest.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.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.memcache.v1.MemcacheParameters.verify(message.parameters); + if (error) + return "parameters." + error; + } + return null; + }; + + /** + * Creates an UpdateParametersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.UpdateParametersRequest} UpdateParametersRequest + */ + UpdateParametersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.UpdateParametersRequest) + return object; + var message = new $root.google.cloud.memcache.v1.UpdateParametersRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.memcache.v1.UpdateParametersRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.memcache.v1.UpdateParametersRequest.parameters: object expected"); + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.fromObject(object.parameters); + } + return message; + }; + + /** + * Creates a plain object from an UpdateParametersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1.UpdateParametersRequest} message UpdateParametersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateParametersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.updateMask = null; + object.parameters = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.toObject(message.parameters, options); + return object; + }; + + /** + * Converts this UpdateParametersRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateParametersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateParametersRequest; + })(); + + v1.MemcacheParameters = (function() { + + /** + * Properties of a MemcacheParameters. + * @memberof google.cloud.memcache.v1 + * @interface IMemcacheParameters + * @property {string|null} [id] MemcacheParameters id + * @property {Object.|null} [params] MemcacheParameters params + */ + + /** + * Constructs a new MemcacheParameters. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents a MemcacheParameters. + * @implements IMemcacheParameters + * @constructor + * @param {google.cloud.memcache.v1.IMemcacheParameters=} [properties] Properties to set + */ + function MemcacheParameters(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MemcacheParameters id. + * @member {string} id + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @instance + */ + MemcacheParameters.prototype.id = ""; + + /** + * MemcacheParameters params. + * @member {Object.} params + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @instance + */ + MemcacheParameters.prototype.params = $util.emptyObject; + + /** + * Creates a new MemcacheParameters instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1.IMemcacheParameters=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.MemcacheParameters} MemcacheParameters instance + */ + MemcacheParameters.create = function create(properties) { + return new MemcacheParameters(properties); + }; + + /** + * Encodes the specified MemcacheParameters message. Does not implicitly {@link google.cloud.memcache.v1.MemcacheParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1.IMemcacheParameters} message MemcacheParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MemcacheParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified MemcacheParameters message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.MemcacheParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1.IMemcacheParameters} message MemcacheParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MemcacheParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MemcacheParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.MemcacheParameters} MemcacheParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MemcacheParameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.MemcacheParameters(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 3: + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MemcacheParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.MemcacheParameters} MemcacheParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MemcacheParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MemcacheParameters message. + * @function verify + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MemcacheParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a MemcacheParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.MemcacheParameters} MemcacheParameters + */ + MemcacheParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.MemcacheParameters) + return object; + var message = new $root.google.cloud.memcache.v1.MemcacheParameters(); + if (object.id != null) + message.id = String(object.id); + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.memcache.v1.MemcacheParameters.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a MemcacheParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1.MemcacheParameters} message MemcacheParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MemcacheParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this MemcacheParameters to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @instance + * @returns {Object.} JSON object + */ + MemcacheParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MemcacheParameters; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.memcache.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusDetail] OperationMetadata statusDetail + * @property {boolean|null} [cancelRequested] OperationMetadata cancelRequested + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.memcache.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusDetail. + * @member {string} statusDetail + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusDetail = ""; + + /** + * OperationMetadata cancelRequested. + * @member {boolean} cancelRequested + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.cancelRequested = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {google.cloud.memcache.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.memcache.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {google.cloud.memcache.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusDetail != null && Object.hasOwnProperty.call(message, "statusDetail")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusDetail); + if (message.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.memcache.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {google.cloud.memcache.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.target = reader.string(); + break; + case 4: + message.verb = reader.string(); + break; + case 5: + message.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.memcache.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusDetail != null && message.hasOwnProperty("statusDetail")) + if (!$util.isString(message.statusDetail)) + return "statusDetail: string expected"; + if (message.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.memcache.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.memcache.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.memcache.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.memcache.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusDetail != null) + message.statusDetail = String(object.statusDetail); + if (object.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.memcache.v1.OperationMetadata + * @static + * @param {google.cloud.memcache.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.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.memcache.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OperationMetadata; + })(); + + /** + * MemcacheVersion enum. + * @name google.cloud.memcache.v1.MemcacheVersion + * @enum {number} + * @property {number} MEMCACHE_VERSION_UNSPECIFIED=0 MEMCACHE_VERSION_UNSPECIFIED value + * @property {number} MEMCACHE_1_5=1 MEMCACHE_1_5 value + */ + v1.MemcacheVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEMCACHE_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "MEMCACHE_1_5"] = 1; + return values; + })(); + + return v1; + })(); + memcache.v1beta2 = (function() { /** diff --git a/packages/google-cloud-memcache/protos/protos.json b/packages/google-cloud-memcache/protos/protos.json index ba2a6ffbf26..716526b31b9 100644 --- a/packages/google-cloud-memcache/protos/protos.json +++ b/packages/google-cloud-memcache/protos/protos.json @@ -6,6 +6,637 @@ "nested": { "memcache": { "nested": { + "v1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/memcache/v1;memcache", + "java_multiple_files": true, + "java_outer_classname": "CloudMemcacheProto", + "java_package": "com.google.cloud.memcache.v1" + }, + "nested": { + "CloudMemcache": { + "options": { + "(google.api.default_host)": "memcache.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": "google.cloud.memcache.v1.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1.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": "google.cloud.memcache.v1.Instance", + "metadata_type": "google.cloud.memcache.v1.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": "google.cloud.memcache.v1.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1.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": "google.cloud.memcache.v1.Instance", + "metadata_type": "google.cloud.memcache.v1.OperationMetadata" + } + } + ] + }, + "UpdateParameters": { + "requestType": "UpdateParametersRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{name=projects/*/locations/*/instances/*}:updateParameters", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,update_mask,parameters", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{name=projects/*/locations/*/instances/*}:updateParameters", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,update_mask,parameters" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1.Instance", + "metadata_type": "google.cloud.memcache.v1.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.memcache.v1.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.memcache.v1.OperationMetadata" + } + } + ] + }, + "ApplyParameters": { + "requestType": "ApplyParametersRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/instances/*}:applyParameters", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,node_ids,apply_all", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/instances/*}:applyParameters", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,node_ids,apply_all" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1.Instance", + "metadata_type": "google.cloud.memcache.v1.OperationMetadata" + } + } + ] + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "memcache.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "authorizedNetwork": { + "type": "string", + "id": 4 + }, + "zones": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "nodeCount": { + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeConfig": { + "type": "NodeConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "memcacheVersion": { + "type": "MemcacheVersion", + "id": 9 + }, + "parameters": { + "type": "MemcacheParameters", + "id": 11 + }, + "memcacheNodes": { + "rule": "repeated", + "type": "Node", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "memcacheFullVersion": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceMessages": { + "rule": "repeated", + "type": "InstanceMessage", + "id": 19 + }, + "discoveryEndpoint": { + "type": "string", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "NodeConfig": { + "fields": { + "cpuCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "memorySizeMb": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Node": { + "fields": { + "nodeId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "zone": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "host": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "port": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "parameters": { + "type": "MemcacheParameters", + "id": 6 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "DELETING": 3, + "UPDATING": 4 + } + } + } + }, + "InstanceMessage": { + "fields": { + "code": { + "type": "Code", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Code": { + "values": { + "CODE_UNSPECIFIED": 0, + "ZONE_DISTRIBUTION_UNBALANCED": 1 + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "DELETING": 4, + "PERFORMING_MAINTENANCE": 5 + } + } + } + }, + "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 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + } + } + }, + "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" + } + } + } + }, + "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" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + } + } + }, + "ApplyParametersRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + }, + "nodeIds": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "applyAll": { + "type": "bool", + "id": 3 + } + } + }, + "UpdateParametersRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parameters": { + "type": "MemcacheParameters", + "id": 3 + } + } + }, + "MemcacheParameters": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "params": { + "keyType": "string", + "type": "string", + "id": 3 + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "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" + } + } + } + }, + "MemcacheVersion": { + "values": { + "MEMCACHE_VERSION_UNSPECIFIED": 0, + "MEMCACHE_1_5": 1 + } + } + } + }, "v1beta2": { "options": { "go_package": "google.golang.org/genproto/googleapis/cloud/memcache/v1beta2;memcache", diff --git a/packages/google-cloud-memcache/src/index.ts b/packages/google-cloud-memcache/src/index.ts index 9195188dcf7..856e188d9f5 100644 --- a/packages/google-cloud-memcache/src/index.ts +++ b/packages/google-cloud-memcache/src/index.ts @@ -16,10 +16,10 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import * as v1beta2 from './v1beta2'; -const CloudMemcacheClient = v1beta2.CloudMemcacheClient; -type CloudMemcacheClient = v1beta2.CloudMemcacheClient; -export {v1beta2, CloudMemcacheClient}; -export default {v1beta2, CloudMemcacheClient}; +import * as v1 from './v1'; +const CloudMemcacheClient = v1.CloudMemcacheClient; +type CloudMemcacheClient = v1.CloudMemcacheClient; +export {v1, CloudMemcacheClient}; +export default {v1, CloudMemcacheClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts new file mode 100644 index 00000000000..3118cbd2a37 --- /dev/null +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts @@ -0,0 +1,1586 @@ +// 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 * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1/cloud_memcache_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cloud_memcache_client_config.json'; +import {operationsProtos} from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * Configures and manages Cloud Memorystore for Memcached instances. + * + * + * The `memcache.googleapis.com` service implements the Google Cloud Memorystore + * for Memcached API and defines the following resource model for managing + * Memorystore Memcached (also called Memcached below) 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 Memcached instances, named: + * `/instances/*` + * * As such, Memcached instances are resources of the form: + * `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * + * Note that location_id must be a GCP `region`; for example: + * * `projects/my-memcached-project/locations/us-central1/instances/my-memcached` + * @class + * @memberof v1 + */ +export class CloudMemcacheClient { + private _terminated = false; + private _opts: ClientOptions; + 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: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + cloudMemcacheStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CloudMemcacheClient. + * + * @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 CloudMemcacheClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + 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}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + 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' + ), + }; + + // 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 protoFilesRoot = opts.fallback + ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); + + 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.memcache.v1.Instance' + ) as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.Instance' + ) as gax.protobuf.Type; + const updateInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateParametersResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.Instance' + ) as gax.protobuf.Type; + const updateParametersMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.OperationMetadata' + ) as gax.protobuf.Type; + const applyParametersResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.Instance' + ) as gax.protobuf.Type; + const applyParametersMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.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) + ), + updateParameters: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateParametersResponse.decode.bind(updateParametersResponse), + updateParametersMetadata.decode.bind(updateParametersMetadata) + ), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata) + ), + applyParameters: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + applyParametersResponse.decode.bind(applyParametersResponse), + applyParametersMetadata.decode.bind(applyParametersMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.memcache.v1.CloudMemcache', + 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 = {}; + } + + /** + * 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.cloudMemcacheStub) { + return this.cloudMemcacheStub; + } + + // Put together the "service stub" for + // google.cloud.memcache.v1.CloudMemcache. + this.cloudMemcacheStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.memcache.v1.CloudMemcache' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.memcache.v1.CloudMemcache, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const cloudMemcacheStubMethods = [ + 'listInstances', + 'getInstance', + 'createInstance', + 'updateInstance', + 'updateParameters', + 'deleteInstance', + 'applyParameters', + ]; + for (const methodName of cloudMemcacheStubMethods) { + const callPromise = this.cloudMemcacheStub.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.cloudMemcacheStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'memcache.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 'memcache.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.memcache.v1.IGetInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IGetInstanceRequest | undefined, + {} | undefined + ] + >; + getInstance( + request: protos.google.cloud.memcache.v1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + getInstance( + request: protos.google.cloud.memcache.v1.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Gets details of a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.memcache.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.memcache.v1.IGetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.memcache.v1.IInstance, + | protos.google.cloud.memcache.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IGetInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getInstance(request, options, callback); + } + + createInstance( + request: protos.google.cloud.memcache.v1.ICreateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createInstance( + request: protos.google.cloud.memcache.v1.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInstance( + request: protos.google.cloud.memcache.v1.ICreateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new Instance in a given location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {string} request.instanceId + * Required. The logical name of the Memcached instance in the user + * project with the following restrictions: + * + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-40 characters. + * * Must end with a number or a letter. + * * Must be unique within the user project / location + * + * If any of the above are not met, will raise an invalid argument error. + * @param {google.cloud.memcache.v1.Instance} request.instance + * Required. A Memcached Instance + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.createInstance(request); + * const [response] = await operation.promise(); + */ + createInstance( + request: protos.google.cloud.memcache.v1.ICreateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = 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.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createInstance, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + >; + } + updateInstance( + request: protos.google.cloud.memcache.v1.IUpdateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateInstance( + request: protos.google.cloud.memcache.v1.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateInstance( + request: protos.google.cloud.memcache.v1.IUpdateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates an existing Instance in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * * `displayName` + * @param {google.cloud.memcache.v1.Instance} request.instance + * Required. A Memcached 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.memcache.v1.IUpdateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = 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.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.updateInstance, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + >; + } + updateParameters( + request: protos.google.cloud.memcache.v1.IUpdateParametersRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateParameters( + request: protos.google.cloud.memcache.v1.IUpdateParametersRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateParameters( + request: protos.google.cloud.memcache.v1.IUpdateParametersRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the defined Memcached Parameters for an existing Instance. + * This method only stages the parameters, it must be followed by + * ApplyParameters to apply the parameters to nodes of the Memcached Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the Memcached instance for which the parameters should be + * updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * @param {google.cloud.memcache.v1.MemcacheParameters} request.parameters + * The parameters to apply to the instance. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.updateParameters(request); + * const [response] = await operation.promise(); + */ + updateParameters( + request: protos.google.cloud.memcache.v1.IUpdateParametersRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateParameters(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateParameters()`. + * @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 checkUpdateParametersProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkUpdateParametersProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.updateParameters, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + >; + } + deleteInstance( + request: protos.google.cloud.memcache.v1.IDeleteInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteInstance( + request: protos.google.cloud.memcache.v1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request: protos.google.cloud.memcache.v1.IDeleteInstanceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.memcache.v1.IDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = 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.memcache.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.deleteInstance, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.memcache.v1.OperationMetadata + >; + } + applyParameters( + request: protos.google.cloud.memcache.v1.IApplyParametersRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + applyParameters( + request: protos.google.cloud.memcache.v1.IApplyParametersRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + applyParameters( + request: protos.google.cloud.memcache.v1.IApplyParametersRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * ApplyParameters will restart the set of specified nodes in order to update + * them to the current set of parameters for the Memcached Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the Memcached instance for which parameter group updates + * should be applied. + * @param {string[]} request.nodeIds + * Nodes to which we should apply the instance-level parameter group. + * @param {boolean} request.applyAll + * Whether to apply instance-level parameter group to all nodes. If set to + * true, will explicitly restrict users from specifying any nodes, and apply + * parameter group updates to all nodes within the instance. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.applyParameters(request); + * const [response] = await operation.promise(); + */ + applyParameters( + request: protos.google.cloud.memcache.v1.IApplyParametersRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.applyParameters(request, options, callback); + } + /** + * Check the status of the long running operation returned by `applyParameters()`. + * @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 checkApplyParametersProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkApplyParametersProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.applyParameters, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + >; + } + listInstances( + request: protos.google.cloud.memcache.v1.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.memcache.v1.IInstance[], + protos.google.cloud.memcache.v1.IListInstancesRequest | null, + protos.google.cloud.memcache.v1.IListInstancesResponse + ] + >; + listInstances( + request: protos.google.cloud.memcache.v1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.memcache.v1.IListInstancesRequest, + protos.google.cloud.memcache.v1.IListInstancesResponse | null | undefined, + protos.google.cloud.memcache.v1.IInstance + > + ): void; + listInstances( + request: protos.google.cloud.memcache.v1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.memcache.v1.IListInstancesRequest, + protos.google.cloud.memcache.v1.IListInstancesResponse | null | undefined, + protos.google.cloud.memcache.v1.IInstance + > + ): void; + /** + * Lists Instances in a given location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {number} request.pageSize + * The maximum number of items to return. + * + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * {@link CloudMemcache.ListInstancesResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, + * if any. + * @param {string} request.filter + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying "name != my-instance". + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Instance]{@link google.cloud.memcache.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.memcache.v1.IListInstancesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.memcache.v1.IListInstancesRequest, + | protos.google.cloud.memcache.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.memcache.v1.IInstance + >, + callback?: PaginationCallback< + protos.google.cloud.memcache.v1.IListInstancesRequest, + protos.google.cloud.memcache.v1.IListInstancesResponse | null | undefined, + protos.google.cloud.memcache.v1.IInstance + > + ): Promise< + [ + protos.google.cloud.memcache.v1.IInstance[], + protos.google.cloud.memcache.v1.IListInstancesRequest | null, + protos.google.cloud.memcache.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 resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {number} request.pageSize + * The maximum number of items to return. + * + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * {@link CloudMemcache.ListInstancesResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, + * if any. + * @param {string} request.filter + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying "name != my-instance". + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Instance]{@link google.cloud.memcache.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.memcache.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 resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {number} request.pageSize + * The maximum number of items to return. + * + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * {@link CloudMemcache.ListInstancesResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, + * if any. + * @param {string} request.filter + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying "name != my-instance". + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Instance]{@link google.cloud.memcache.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.memcache.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; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project: string, location: string, instance: string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified 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.cloudMemcacheStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client_config.json b/packages/google-cloud-memcache/src/v1/cloud_memcache_client_config.json new file mode 100644 index 00000000000..93395ae4fd3 --- /dev/null +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client_config.json @@ -0,0 +1,61 @@ +{ + "interfaces": { + "google.cloud.memcache.v1.CloudMemcache": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListInstances": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInstance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateParameters": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ApplyParameters": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_proto_list.json b/packages/google-cloud-memcache/src/v1/cloud_memcache_proto_list.json new file mode 100644 index 00000000000..759395dd6de --- /dev/null +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/memcache/v1/cloud_memcache.proto" +] diff --git a/packages/google-cloud-memcache/src/v1/gapic_metadata.json b/packages/google-cloud-memcache/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..dba038c2360 --- /dev/null +++ b/packages/google-cloud-memcache/src/v1/gapic_metadata.json @@ -0,0 +1,97 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.memcache.v1", + "libraryPackage": "@google-cloud/memcache", + "services": { + "CloudMemcache": { + "clients": { + "grpc": { + "libraryClient": "CloudMemcacheClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "UpdateParameters": { + "methods": [ + "updateParameters" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "ApplyParameters": { + "methods": [ + "applyParameters" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CloudMemcacheClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "UpdateParameters": { + "methods": [ + "updateParameters" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "ApplyParameters": { + "methods": [ + "applyParameters" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-memcache/src/v1/index.ts b/packages/google-cloud-memcache/src/v1/index.ts new file mode 100644 index 00000000000..369d196c3a1 --- /dev/null +++ b/packages/google-cloud-memcache/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 {CloudMemcacheClient} from './cloud_memcache_client'; diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index b791c98f760..42a92c848b5 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -3,16 +3,16 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "13da6e2d140a537e5ee33fa0dc3efe926597bc86" + "remote": "git@github.com:googleapis/nodejs-memcache.git", + "sha": "8b2accf06332bc1fc504b50a5106aa50d61d6460" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d189e871205fea665a9648f7c4676f027495ccaf", - "internalRef": "345596855" + "sha": "d99d5d592f3d1d5526511c90120b1e9ab3ce6e17", + "internalRef": "354148500" } }, { @@ -32,6 +32,15 @@ "language": "nodejs", "generator": "bazel" } + }, + { + "client": { + "source": "googleapis", + "apiName": "memcache", + "apiVersion": "v1", + "language": "nodejs", + "generator": "bazel" + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-memcache/synth.py b/packages/google-cloud-memcache/synth.py index 790d1e95f40..aad0810f619 100644 --- a/packages/google-cloud-memcache/synth.py +++ b/packages/google-cloud-memcache/synth.py @@ -22,7 +22,7 @@ # run the gapic generator gapic = gcp.GAPICBazel() -versions = ['v1beta2'] +versions = ['v1beta2', 'v1'] name = 'memcache' for version in versions: library = gapic.node_library(name, version) diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts similarity index 83% rename from packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts rename to packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts index a027e69e0b7..b70dc04aa1c 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts @@ -145,39 +145,37 @@ function stubAsyncIterationCall( return sinon.stub().returns(asyncIterable); } -describe('v1beta2.CloudMemcacheClient', () => { +describe('v1.CloudMemcacheClient', () => { it('has servicePath', () => { - const servicePath = - cloudmemcacheModule.v1beta2.CloudMemcacheClient.servicePath; + const servicePath = cloudmemcacheModule.v1.CloudMemcacheClient.servicePath; assert(servicePath); }); it('has apiEndpoint', () => { - const apiEndpoint = - cloudmemcacheModule.v1beta2.CloudMemcacheClient.apiEndpoint; + const apiEndpoint = cloudmemcacheModule.v1.CloudMemcacheClient.apiEndpoint; assert(apiEndpoint); }); it('has port', () => { - const port = cloudmemcacheModule.v1beta2.CloudMemcacheClient.port; + const port = cloudmemcacheModule.v1.CloudMemcacheClient.port; assert(port); assert(typeof port === 'number'); }); it('should create a client with no option', () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient(); + const client = new cloudmemcacheModule.v1.CloudMemcacheClient(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ fallback: true, }); assert(client); }); it('has initialize method and supports deferred initialization', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -187,7 +185,7 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('has close method', () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -196,7 +194,7 @@ describe('v1beta2.CloudMemcacheClient', () => { it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -208,7 +206,7 @@ describe('v1beta2.CloudMemcacheClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -230,13 +228,13 @@ describe('v1beta2.CloudMemcacheClient', () => { describe('getInstance', () => { it('invokes getInstance without error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() + new protos.google.cloud.memcache.v1.GetInstanceRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -248,7 +246,7 @@ describe('v1beta2.CloudMemcacheClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.Instance() + new protos.google.cloud.memcache.v1.Instance() ); client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); const [response] = await client.getInstance(request); @@ -261,13 +259,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes getInstance without error using callback', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() + new protos.google.cloud.memcache.v1.GetInstanceRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -279,7 +277,7 @@ describe('v1beta2.CloudMemcacheClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.Instance() + new protos.google.cloud.memcache.v1.Instance() ); client.innerApiCalls.getInstance = stubSimpleCallWithCallback( expectedResponse @@ -289,7 +287,7 @@ describe('v1beta2.CloudMemcacheClient', () => { request, ( err?: Error | null, - result?: protos.google.cloud.memcache.v1beta2.IInstance | null + result?: protos.google.cloud.memcache.v1.IInstance | null ) => { if (err) { reject(err); @@ -309,13 +307,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes getInstance with error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() + new protos.google.cloud.memcache.v1.GetInstanceRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -342,13 +340,13 @@ describe('v1beta2.CloudMemcacheClient', () => { describe('createInstance', () => { it('invokes createInstance without error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.CreateInstanceRequest() + new protos.google.cloud.memcache.v1.CreateInstanceRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -376,13 +374,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes createInstance without error using callback', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.CreateInstanceRequest() + new protos.google.cloud.memcache.v1.CreateInstanceRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -405,8 +403,8 @@ describe('v1beta2.CloudMemcacheClient', () => { ( err?: Error | null, result?: LROperation< - protos.google.cloud.memcache.v1beta2.IInstance, - protos.google.cloud.memcache.v1beta2.IOperationMetadata + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata > | null ) => { if (err) { @@ -418,8 +416,8 @@ describe('v1beta2.CloudMemcacheClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.memcache.v1beta2.IInstance, - protos.google.cloud.memcache.v1beta2.IOperationMetadata + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -431,13 +429,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes createInstance with call error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.CreateInstanceRequest() + new protos.google.cloud.memcache.v1.CreateInstanceRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -462,13 +460,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes createInstance with LRO error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.CreateInstanceRequest() + new protos.google.cloud.memcache.v1.CreateInstanceRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -495,7 +493,7 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes checkCreateInstanceProgress without error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -517,7 +515,7 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes checkCreateInstanceProgress with error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -538,17 +536,17 @@ describe('v1beta2.CloudMemcacheClient', () => { describe('updateInstance', () => { it('invokes updateInstance without error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() + new protos.google.cloud.memcache.v1.UpdateInstanceRequest() ); - request.resource = {}; - request.resource.name = ''; - const expectedHeaderRequestParams = 'resource.name='; + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = 'instance.name='; const expectedOptions = { otherArgs: { headers: { @@ -573,17 +571,17 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes updateInstance without error using callback', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() + new protos.google.cloud.memcache.v1.UpdateInstanceRequest() ); - request.resource = {}; - request.resource.name = ''; - const expectedHeaderRequestParams = 'resource.name='; + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = 'instance.name='; const expectedOptions = { otherArgs: { headers: { @@ -603,8 +601,8 @@ describe('v1beta2.CloudMemcacheClient', () => { ( err?: Error | null, result?: LROperation< - protos.google.cloud.memcache.v1beta2.IInstance, - protos.google.cloud.memcache.v1beta2.IOperationMetadata + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata > | null ) => { if (err) { @@ -616,8 +614,8 @@ describe('v1beta2.CloudMemcacheClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.memcache.v1beta2.IInstance, - protos.google.cloud.memcache.v1beta2.IOperationMetadata + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -629,17 +627,17 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes updateInstance with call error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() + new protos.google.cloud.memcache.v1.UpdateInstanceRequest() ); - request.resource = {}; - request.resource.name = ''; - const expectedHeaderRequestParams = 'resource.name='; + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = 'instance.name='; const expectedOptions = { otherArgs: { headers: { @@ -661,17 +659,17 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes updateInstance with LRO error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() + new protos.google.cloud.memcache.v1.UpdateInstanceRequest() ); - request.resource = {}; - request.resource.name = ''; - const expectedHeaderRequestParams = 'resource.name='; + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = 'instance.name='; const expectedOptions = { otherArgs: { headers: { @@ -695,7 +693,7 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes checkUpdateInstanceProgress without error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -717,7 +715,7 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes checkUpdateInstanceProgress with error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -738,13 +736,13 @@ describe('v1beta2.CloudMemcacheClient', () => { describe('updateParameters', () => { it('invokes updateParameters without error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() + new protos.google.cloud.memcache.v1.UpdateParametersRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -772,13 +770,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes updateParameters without error using callback', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() + new protos.google.cloud.memcache.v1.UpdateParametersRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -801,8 +799,8 @@ describe('v1beta2.CloudMemcacheClient', () => { ( err?: Error | null, result?: LROperation< - protos.google.cloud.memcache.v1beta2.IInstance, - protos.google.cloud.memcache.v1beta2.IOperationMetadata + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata > | null ) => { if (err) { @@ -814,8 +812,8 @@ describe('v1beta2.CloudMemcacheClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.memcache.v1beta2.IInstance, - protos.google.cloud.memcache.v1beta2.IOperationMetadata + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -827,13 +825,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes updateParameters with call error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() + new protos.google.cloud.memcache.v1.UpdateParametersRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -858,13 +856,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes updateParameters with LRO error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() + new protos.google.cloud.memcache.v1.UpdateParametersRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -891,7 +889,7 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes checkUpdateParametersProgress without error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -913,7 +911,7 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes checkUpdateParametersProgress with error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -934,13 +932,13 @@ describe('v1beta2.CloudMemcacheClient', () => { describe('deleteInstance', () => { it('invokes deleteInstance without error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.DeleteInstanceRequest() + new protos.google.cloud.memcache.v1.DeleteInstanceRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -968,13 +966,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes deleteInstance without error using callback', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.DeleteInstanceRequest() + new protos.google.cloud.memcache.v1.DeleteInstanceRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -998,7 +996,7 @@ describe('v1beta2.CloudMemcacheClient', () => { err?: Error | null, result?: LROperation< protos.google.protobuf.IEmpty, - protos.google.cloud.memcache.v1beta2.IOperationMetadata + protos.google.cloud.memcache.v1.IOperationMetadata > | null ) => { if (err) { @@ -1011,7 +1009,7 @@ describe('v1beta2.CloudMemcacheClient', () => { }); const operation = (await promise) as LROperation< protos.google.protobuf.IEmpty, - protos.google.cloud.memcache.v1beta2.IOperationMetadata + protos.google.cloud.memcache.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1023,13 +1021,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes deleteInstance with call error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.DeleteInstanceRequest() + new protos.google.cloud.memcache.v1.DeleteInstanceRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1054,13 +1052,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes deleteInstance with LRO error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.DeleteInstanceRequest() + new protos.google.cloud.memcache.v1.DeleteInstanceRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1087,7 +1085,7 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes checkDeleteInstanceProgress without error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -1109,7 +1107,7 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes checkDeleteInstanceProgress with error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -1130,13 +1128,13 @@ describe('v1beta2.CloudMemcacheClient', () => { describe('applyParameters', () => { it('invokes applyParameters without error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() + new protos.google.cloud.memcache.v1.ApplyParametersRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1164,13 +1162,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes applyParameters without error using callback', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() + new protos.google.cloud.memcache.v1.ApplyParametersRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1193,8 +1191,8 @@ describe('v1beta2.CloudMemcacheClient', () => { ( err?: Error | null, result?: LROperation< - protos.google.cloud.memcache.v1beta2.IInstance, - protos.google.cloud.memcache.v1beta2.IOperationMetadata + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata > | null ) => { if (err) { @@ -1206,8 +1204,8 @@ describe('v1beta2.CloudMemcacheClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.memcache.v1beta2.IInstance, - protos.google.cloud.memcache.v1beta2.IOperationMetadata + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1219,13 +1217,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes applyParameters with call error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() + new protos.google.cloud.memcache.v1.ApplyParametersRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1250,13 +1248,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes applyParameters with LRO error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() + new protos.google.cloud.memcache.v1.ApplyParametersRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -1283,7 +1281,7 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes checkApplyParametersProgress without error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -1305,7 +1303,7 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes checkApplyParametersProgress with error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -1326,13 +1324,13 @@ describe('v1beta2.CloudMemcacheClient', () => { describe('listInstances', () => { it('invokes listInstances without error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + new protos.google.cloud.memcache.v1.ListInstancesRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -1344,15 +1342,9 @@ describe('v1beta2.CloudMemcacheClient', () => { }, }; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.Instance() - ), - generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.Instance() - ), - generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.Instance() - ), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), ]; client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); const [response] = await client.listInstances(request); @@ -1365,13 +1357,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes listInstances without error using callback', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + new protos.google.cloud.memcache.v1.ListInstancesRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -1383,15 +1375,9 @@ describe('v1beta2.CloudMemcacheClient', () => { }, }; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.Instance() - ), - generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.Instance() - ), - generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.Instance() - ), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), ]; client.innerApiCalls.listInstances = stubSimpleCallWithCallback( expectedResponse @@ -1401,7 +1387,7 @@ describe('v1beta2.CloudMemcacheClient', () => { request, ( err?: Error | null, - result?: protos.google.cloud.memcache.v1beta2.IInstance[] | null + result?: protos.google.cloud.memcache.v1.IInstance[] | null ) => { if (err) { reject(err); @@ -1421,13 +1407,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes listInstances with error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + new protos.google.cloud.memcache.v1.ListInstancesRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -1452,36 +1438,30 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes listInstancesStream without error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + new protos.google.cloud.memcache.v1.ListInstancesRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.Instance() - ), - generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.Instance() - ), - generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.Instance() - ), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + generateSampleMessage(new protos.google.cloud.memcache.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.memcache.v1beta2.Instance[] = []; + const responses: protos.google.cloud.memcache.v1.Instance[] = []; stream.on( 'data', - (response: protos.google.cloud.memcache.v1beta2.Instance) => { + (response: protos.google.cloud.memcache.v1.Instance) => { responses.push(response); } ); @@ -1509,13 +1489,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('invokes listInstancesStream with error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + new protos.google.cloud.memcache.v1.ListInstancesRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -1526,10 +1506,10 @@ describe('v1beta2.CloudMemcacheClient', () => { ); const stream = client.listInstancesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.memcache.v1beta2.Instance[] = []; + const responses: protos.google.cloud.memcache.v1.Instance[] = []; stream.on( 'data', - (response: protos.google.cloud.memcache.v1beta2.Instance) => { + (response: protos.google.cloud.memcache.v1.Instance) => { responses.push(response); } ); @@ -1556,31 +1536,25 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('uses async iteration with listInstances without error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + new protos.google.cloud.memcache.v1.ListInstancesRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.Instance() - ), - generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.Instance() - ), - generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.Instance() - ), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), ]; client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall( expectedResponse ); - const responses: protos.google.cloud.memcache.v1beta2.IInstance[] = []; + const responses: protos.google.cloud.memcache.v1.IInstance[] = []; const iterable = client.listInstancesAsync(request); for await (const resource of iterable) { responses.push(resource!); @@ -1601,13 +1575,13 @@ describe('v1beta2.CloudMemcacheClient', () => { }); it('uses async iteration with listInstances with error', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + new protos.google.cloud.memcache.v1.ListInstancesRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -1618,7 +1592,7 @@ describe('v1beta2.CloudMemcacheClient', () => { ); const iterable = client.listInstancesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.memcache.v1beta2.IInstance[] = []; + const responses: protos.google.cloud.memcache.v1.IInstance[] = []; for await (const resource of iterable) { responses.push(resource!); } @@ -1646,7 +1620,7 @@ describe('v1beta2.CloudMemcacheClient', () => { location: 'locationValue', instance: 'instanceValue', }; - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); @@ -1709,7 +1683,7 @@ describe('v1beta2.CloudMemcacheClient', () => { project: 'projectValue', location: 'locationValue', }; - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); From 9d90489bd045354b3dafb439c96ad56bff647501 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Feb 2021 17:58:22 -0800 Subject: [PATCH 069/152] build: adds UNORDERED_LIST enum (#90) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/f20ba027-76a5-44ba-baa4-962e18a97819/targets - [ ] To automatically regenerate this PR, check this box. --- packages/google-cloud-memcache/protos/protos.d.ts | 3 ++- packages/google-cloud-memcache/protos/protos.js | 7 +++++++ packages/google-cloud-memcache/protos/protos.json | 3 ++- packages/google-cloud-memcache/synth.metadata | 4 ++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-memcache/protos/protos.d.ts b/packages/google-cloud-memcache/protos/protos.d.ts index 8f5e9736d6d..f3453a5578b 100644 --- a/packages/google-cloud-memcache/protos/protos.d.ts +++ b/packages/google-cloud-memcache/protos/protos.d.ts @@ -4000,7 +4000,8 @@ export namespace google { REQUIRED = 2, OUTPUT_ONLY = 3, INPUT_ONLY = 4, - IMMUTABLE = 5 + IMMUTABLE = 5, + UNORDERED_LIST = 6 } /** Properties of a ResourceDescriptor. */ diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index b8fe91e85e3..a5b6c4a6450 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/protos/protos.js @@ -9831,6 +9831,7 @@ * @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); @@ -9840,6 +9841,7 @@ 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; })(); @@ -16007,6 +16009,7 @@ case 3: case 4: case 5: + case 6: break; } } @@ -16107,6 +16110,10 @@ 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) { diff --git a/packages/google-cloud-memcache/protos/protos.json b/packages/google-cloud-memcache/protos/protos.json index 716526b31b9..35c12661a2a 100644 --- a/packages/google-cloud-memcache/protos/protos.json +++ b/packages/google-cloud-memcache/protos/protos.json @@ -1388,7 +1388,8 @@ "REQUIRED": 2, "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, - "IMMUTABLE": 5 + "IMMUTABLE": 5, + "UNORDERED_LIST": 6 } }, "resourceReference": { diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 42a92c848b5..84ddc299538 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -3,8 +3,8 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-memcache.git", - "sha": "8b2accf06332bc1fc504b50a5106aa50d61d6460" + "remote": "https://github.com/googleapis/nodejs-memcache.git", + "sha": "105dc474f33479cca0888116a9d63a4f9abc59ac" } }, { From f01d7138d1d6e95972d71387b143164bf04d490e Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 1 Mar 2021 12:04:46 -0800 Subject: [PATCH 070/152] feat(docs): indicate ga status (#91) --- .../google-cloud-memcache/.repo-metadata.json | 2 +- packages/google-cloud-memcache/README.md | 11 ++++++----- packages/google-cloud-memcache/synth.metadata | 15 ++++----------- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-memcache/.repo-metadata.json b/packages/google-cloud-memcache/.repo-metadata.json index d8b2652bb05..7908c22bc9b 100644 --- a/packages/google-cloud-memcache/.repo-metadata.json +++ b/packages/google-cloud-memcache/.repo-metadata.json @@ -4,7 +4,7 @@ "product_documentation": "https://cloud.google.com/memorystore/docs/memcached", "client_documentation": "https://googleapis.dev/nodejs/memcache/latest/index.html", "issue_tracker": "https://issuetracker.google.com/savedsearches/5169231", - "release_level": "beta", + "release_level": "ga", "language": "nodejs", "repo": "googleapis/nodejs-memcache", "distribution_name": "@google-cloud/memcache", diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md index 67c5f35f1fa..f136bd02138 100644 --- a/packages/google-cloud-memcache/README.md +++ b/packages/google-cloud-memcache/README.md @@ -4,7 +4,7 @@ # [Memorystore for Memcached: Node.js Client](https://github.com/googleapis/nodejs-memcache) -[![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/memcache.svg)](https://www.npmjs.org/package/@google-cloud/memcache) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-memcache/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-memcache) @@ -109,11 +109,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. -This library is considered to be in **beta**. This means it is expected to be -mostly stable while we work toward a general availability release; however, -complete stability is not guaranteed. We will address issues and requests -against beta libraries with a high priority. diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index 84ddc299538..dc1b2e07fc0 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -3,23 +3,16 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "105dc474f33479cca0888116a9d63a4f9abc59ac" + "remote": "git@github.com:googleapis/nodejs-memcache.git", + "sha": "5ce7bfd3950eb62f000ba862b72df9349546ef8d" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d99d5d592f3d1d5526511c90120b1e9ab3ce6e17", - "internalRef": "354148500" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" + "sha": "d1ec8a4330fdc131e49637ed34bb031695a89060", + "internalRef": "360235141" } } ], From 5e1febab1b23d2275618a89231e16259774e215f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 1 Mar 2021 12:26:39 -0800 Subject: [PATCH 071/152] chore: release 1.4.0 (#89) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-memcache/CHANGELOG.md | 8 ++++++++ packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index 455076c1a40..051659379e9 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [1.4.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.3.0...v1.4.0) (2021-03-01) + + +### Features + +* add v1 version ([#88](https://www.github.com/googleapis/nodejs-memcache/issues/88)) ([105dc47](https://www.github.com/googleapis/nodejs-memcache/commit/105dc474f33479cca0888116a9d63a4f9abc59ac)) +* **docs:** indicate ga status ([#91](https://www.github.com/googleapis/nodejs-memcache/issues/91)) ([f5a4313](https://www.github.com/googleapis/nodejs-memcache/commit/f5a4313e5ee55887ea9c2350dcabd12b9ba2e5e0)) + ## [1.3.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.2.1...v1.3.0) (2021-01-09) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 18c2b57a41d..f6d43ef7718 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "1.3.0", + "version": "1.4.0", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index 47c301e40bd..6a3a3125964 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^1.3.0" + "@google-cloud/memcache": "^1.4.0" }, "devDependencies": { "c8": "^7.0.0", From c91191c9be8766faa5ee908894fa5e4ee008b0b2 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 7 Mar 2021 09:00:32 -0800 Subject: [PATCH 072/152] build: update gapic-generator-typescript to v1.2.10. (#92) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/a27e585a-8362-450e-a458-6225be320237/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 361273630 Source-Link: https://github.com/googleapis/googleapis/commit/5477122b3e8037a1dc5bc920536158edbd151dc4 --- packages/google-cloud-memcache/synth.metadata | 15 +++++++++++---- packages/google-cloud-memcache/webpack.config.js | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata index dc1b2e07fc0..4dc5c49e9bd 100644 --- a/packages/google-cloud-memcache/synth.metadata +++ b/packages/google-cloud-memcache/synth.metadata @@ -3,16 +3,23 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-memcache.git", - "sha": "5ce7bfd3950eb62f000ba862b72df9349546ef8d" + "remote": "https://github.com/googleapis/nodejs-memcache.git", + "sha": "c913005b864a1ceae4bcefeb156c7ad1761990ba" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d1ec8a4330fdc131e49637ed34bb031695a89060", - "internalRef": "360235141" + "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", + "internalRef": "361273630" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "9583f62749edab8e1a5ccd613fe59cf553c189a1" } } ], diff --git a/packages/google-cloud-memcache/webpack.config.js b/packages/google-cloud-memcache/webpack.config.js index 081ae54092e..183014a7caf 100644 --- a/packages/google-cloud-memcache/webpack.config.js +++ b/packages/google-cloud-memcache/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. From 036466155204f3fc2f144c82ac31f4735a680c45 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 23 Mar 2021 17:48:28 +0100 Subject: [PATCH 073/152] chore(deps): update dependency sinon to v10 (#94) [![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)) | [`^9.0.1` -> `^10.0.0`](https://renovatebot.com/diffs/npm/sinon/9.2.4/10.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/compatibility-slim/9.2.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/confidence-slim/9.2.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v10.0.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1000--2021-03-22) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v9.2.4...v10.0.0) ================== - Upgrade nise to 4.1.0 - Use [@​sinonjs/eslint-config](https://togithub.com/sinonjs/eslint-config)[@​4](https://togithub.com/4) => Adopts ES2017 => Drops support for IE 11, Legacy Edge and legacy Safari
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index f6d43ef7718..ea19e1bbe46 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -44,7 +44,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^9.0.1", + "sinon": "^10.0.0", "ts-loader": "^8.0.0", "typescript": "~3.8.3", "webpack": "^5.0.0", From e2ebeab5f61554873dc9ecb55eadc142432e1b41 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Thu, 1 Apr 2021 23:53:15 -0700 Subject: [PATCH 074/152] chore: migrate to owl bot (#95) * chore: migrate to owl bot * chore: copy files from googleapis-gen fb91803ccef5d7c695139b22788b309e2197856b * chore: run the post processor --- .../.github/.OwlBot.yaml | 25 + .../google-cloud-memcache/.repo-metadata.json | 15 +- .../memcache/v1beta2/cloud_memcache.proto | 157 +- .../google-cloud-memcache/protos/protos.d.ts | 135 ++ .../google-cloud-memcache/protos/protos.js | 326 +++ .../google-cloud-memcache/protos/protos.json | 104 +- packages/google-cloud-memcache/src/index.ts | 13 +- .../src/v1beta2/cloud_memcache_client.ts | 224 +- .../v1beta2/cloud_memcache_client_config.json | 5 + .../src/v1beta2/gapic_metadata.json | 10 + packages/google-cloud-memcache/synth.metadata | 46 - packages/google-cloud-memcache/synth.py | 36 - .../test/gapic_cloud_memcache_v1beta2.ts | 1951 +++++++++++++++++ 13 files changed, 2859 insertions(+), 188 deletions(-) create mode 100644 packages/google-cloud-memcache/.github/.OwlBot.yaml delete mode 100644 packages/google-cloud-memcache/synth.metadata delete mode 100644 packages/google-cloud-memcache/synth.py create mode 100644 packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts diff --git a/packages/google-cloud-memcache/.github/.OwlBot.yaml b/packages/google-cloud-memcache/.github/.OwlBot.yaml new file mode 100644 index 00000000000..c19316fdf4f --- /dev/null +++ b/packages/google-cloud-memcache/.github/.OwlBot.yaml @@ -0,0 +1,25 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# 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/memcache/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + +begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b + diff --git a/packages/google-cloud-memcache/.repo-metadata.json b/packages/google-cloud-memcache/.repo-metadata.json index 7908c22bc9b..2c2fad534f9 100644 --- a/packages/google-cloud-memcache/.repo-metadata.json +++ b/packages/google-cloud-memcache/.repo-metadata.json @@ -1,13 +1,14 @@ { - "name": "memcache", - "name_pretty": "Memorystore for Memcached", - "product_documentation": "https://cloud.google.com/memorystore/docs/memcached", - "client_documentation": "https://googleapis.dev/nodejs/memcache/latest/index.html", - "issue_tracker": "https://issuetracker.google.com/savedsearches/5169231", - "release_level": "ga", "language": "nodejs", + "requires_billing": true, + "product_documentation": "https://cloud.google.com/memorystore/docs/memcached", "repo": "googleapis/nodejs-memcache", + "default_version": "v1", + "name_pretty": "Memorystore for Memcached", + "release_level": "ga", "distribution_name": "@google-cloud/memcache", + "name": "memcache", + "client_documentation": "https://googleapis.dev/nodejs/memcache/latest/index.html", "api_id": "memcache.googleapis.com", - "requires_billing": true + "issue_tracker": "https://issuetracker.google.com/savedsearches/5169231" } diff --git a/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto b/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto index 56bd2ef78c5..1a3ff64a7f8 100644 --- a/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto +++ b/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -43,13 +42,13 @@ option java_package = "com.google.cloud.memcache.v1beta2"; // * As such, Memcached instances are resources of the form: // `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` // -// Note that location_id must be refering to a GCP `region`; for example: +// Note that location_id must be a GCP `region`; for example: // * `projects/my-memcached-project/locations/us-central1/instances/my-memcached` service CloudMemcache { option (google.api.default_host) = "memcache.googleapis.com"; option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - // Lists Instances in a given project and location. + // Lists Instances in a given location. rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { option (google.api.http) = { get: "/v1beta2/{parent=projects/*/locations/*}/instances" @@ -65,7 +64,7 @@ service CloudMemcache { option (google.api.method_signature) = "name"; } - // Creates a new Instance in a given project and location. + // Creates a new Instance in a given location. rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta2/{parent=projects/*/locations/*}/instances" @@ -91,9 +90,10 @@ service CloudMemcache { }; } - // Updates the defined Memcached Parameters for an existing Instance. + // Updates the defined Memcached parameters for an existing instance. // This method only stages the parameters, it must be followed by - // ApplyParameters to apply the parameters to nodes of the Memcached Instance. + // `ApplyParameters` to apply the parameters to nodes of the Memcached + // instance. rpc UpdateParameters(UpdateParametersRequest) returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1beta2/{name=projects/*/locations/*/instances/*}:updateParameters" @@ -118,8 +118,8 @@ service CloudMemcache { }; } - // ApplyParameters will update current set of Parameters to the set of - // specified nodes of the Memcached Instance. + // `ApplyParameters` restarts the set of specified nodes in order to update + // them to the current set of parameters for the Memcached Instance. rpc ApplyParameters(ApplyParametersRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta2/{name=projects/*/locations/*/instances/*}:applyParameters" @@ -131,8 +131,22 @@ service CloudMemcache { metadata_type: "google.cloud.memcache.v1beta2.OperationMetadata" }; } + + // Updates software on the selected nodes of the Instance. + rpc ApplySoftwareUpdate(ApplySoftwareUpdateRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta2/{instance=projects/*/locations/*/instances/*}:applySoftwareUpdate" + body: "*" + }; + option (google.api.method_signature) = "instance,node_ids,apply_all"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1beta2.Instance" + metadata_type: "google.cloud.memcache.v1beta2.OperationMetadata" + }; + } } +// A Memorystore for Memcached instance message Instance { option (google.api.resource) = { type: "memcache.googleapis.com/Instance" @@ -150,7 +164,6 @@ message Instance { message Node { // Different states of a Memcached node. - // LINT.IfChange enum State { // Node state is not set. STATE_UNSPECIFIED = 0; @@ -187,6 +200,9 @@ message Instance { // User defined parameters currently applied to the node. MemcacheParameters parameters = 6; + + // Output only. Returns true if there is an update waiting to be applied + bool update_available = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } message InstanceMessage { @@ -206,7 +222,6 @@ message Instance { } // Different states of a Memcached instance. - // LINT.IfChange enum State { // State not set. STATE_UNSPECIFIED = 0; @@ -228,28 +243,28 @@ message Instance { // location using the form: // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` // - // Note: Memcached instances are managed and addressed at regional level so - // location_id here refers to a GCP region; however, users may choose which - // zones Memcached nodes within an instances should be provisioned in. - // Refer to [zones] field for more details. + // Note: Memcached instances are managed and addressed at the regional level + // so `location_id` here refers to a Google Cloud region; however, users may + // choose which zones Memcached nodes should be provisioned in within an + // instance. Refer to [zones][google.cloud.memcache.v1beta2.Instance.zones] field for more details. string name = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. User provided name for the instance only used for display + // User provided name for the instance, which is only used for display // purposes. Cannot be more than 80 characters. string display_name = 2; - // Optional. Resource labels to represent user-provided metadata. + // Resource labels to represent user-provided metadata. // Refer to cloud documentation on labels for more details. // https://cloud.google.com/compute/docs/labeling-resources map labels = 3; - // Optional. The full name of the Google Compute Engine + // The full name of the Google Compute Engine // [network](https://cloud.google.com/vpc/docs/vpc) to which the // instance is connected. If left unspecified, the `default` network // will be used. string authorized_network = 4; - // Optional. Zones where Memcached nodes should be provisioned in. + // Zones in which Memcached nodes should be provisioned. // Memcached nodes will be equally distributed across these zones. If not // provided, the service will by default create nodes in all zones in the // region for the instance. @@ -261,9 +276,9 @@ message Instance { // Required. Configuration for Memcached nodes. NodeConfig node_config = 7 [(google.api.field_behavior) = REQUIRED]; - // Optional. The major version of Memcached software. + // The major version of Memcached software. // If not provided, latest supported version will be used. Currently the - // latest supported major version is MEMCACHE_1_5. + // latest supported major version is `MEMCACHE_1_5`. // The minor version will be automatically determined by our system based on // the latest supported minor version. MemcacheVersion memcache_version = 9; @@ -273,7 +288,7 @@ message Instance { MemcacheParameters parameters = 11; // Output only. List of Memcached nodes. - // Refer to [Node] message for more details. + // Refer to [Node][google.cloud.memcache.v1beta2.Instance.Node] message for more details. repeated Node memcache_nodes = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time the instance was created. @@ -291,11 +306,14 @@ message Instance { // The full version format will be "memcached-1.5.16". string memcache_full_version = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - // List of messages that describe current statuses of memcached instance. + // List of messages that describe the current state of the Memcached instance. repeated InstanceMessage instance_messages = 19; - // Output only. Endpoint for Discovery API + // Output only. Endpoint for the Discovery API. string discovery_endpoint = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Returns true if there is an update waiting to be applied + bool update_available = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Request for [ListInstances][google.cloud.memcache.v1beta2.CloudMemcache.ListInstances]. @@ -313,18 +331,17 @@ message ListInstancesRequest { // The maximum number of items to return. // // If not specified, a default value of 1000 will be used by the service. - // Regardless of the page_size value, the response may include a partial list - // and a caller should only rely on response's - // [next_page_token][CloudMemcache.ListInstancesResponse.next_page_token] + // Regardless of the `page_size` value, the response may include a partial + // list and a caller should only rely on response's + // [`next_page_token`][google.cloud.memcache.v1beta2.ListInstancesResponse.next_page_token] // to determine if there are more instances left to be queried. int32 page_size = 2; - // The next_page_token value returned from a previous List request, - // if any. + // The `next_page_token` value returned from a previous List request, if any. string page_token = 3; // List filter. For example, exclude all Memcached instances with name as - // my-instance by specifying "name != my-instance". + // my-instance by specifying `"name != my-instance"`. string filter = 4; // Sort results. Supported values are "name", "name desc" or "" (unsorted). @@ -380,7 +397,9 @@ message CreateInstanceRequest { // * Must start with a letter. // * Must be between 1-40 characters. // * Must end with a number or a letter. - // * Must be unique within the user project / location + // * Must be unique within the user project / location. + // + // If any of the above are not met, the API raises an invalid argument error. string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. A Memcached [Instance] resource @@ -390,7 +409,7 @@ message CreateInstanceRequest { // Request for [UpdateInstance][google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstance]. message UpdateInstanceRequest { // Required. Mask of fields to update. - // * `displayName` + // * `displayName` google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; // Required. A Memcached [Instance] resource. @@ -400,10 +419,15 @@ message UpdateInstanceRequest { // Request for [DeleteInstance][google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstance]. message DeleteInstanceRequest { - // Memcached instance resource name in the format: + // Required. Memcached instance resource name in the format: // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` // where `location_id` refers to a GCP region - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; } // Request for [ApplyParameters][google.cloud.memcache.v1beta2.CloudMemcache.ApplyParameters]. @@ -417,12 +441,12 @@ message ApplyParametersRequest { } ]; - // Nodes to which we should apply the instance-level parameter group. + // Nodes to which the instance-level parameter group is applied. repeated string node_ids = 2; // Whether to apply instance-level parameter group to all nodes. If set to - // true, will explicitly restrict users from specifying any nodes, and apply - // parameter group updates to all nodes within the instance. + // true, users are restricted from specifying individual nodes, and + // `ApplyParameters` updates all nodes within the instance. bool apply_all = 3; } @@ -444,11 +468,34 @@ message UpdateParametersRequest { MemcacheParameters parameters = 3; } +// Request for [ApplySoftwareUpdate][google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdate]. +message ApplySoftwareUpdateRequest { + // Required. Resource name of the Memcached instance for which software update should be + // applied. + string instance = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; + + // Nodes to which we should apply the update to. Note all the selected nodes + // are updated in parallel. + repeated string node_ids = 2; + + // Whether to apply the update to all nodes. If set to + // true, will explicitly restrict users from specifying any nodes, and apply + // software update to all nodes (where applicable) within the instance. + bool apply_all = 3; +} + +// The unique ID associated with this set of parameters. Users +// can use this id to determine if the parameters associated with the instance +// differ from the parameters associated with the nodes. A discrepancy between +// parameter ids can inform users that they may need to take action to apply +// parameters on nodes. message MemcacheParameters { - // Output only. The unique ID associated with this set of parameters. Users - // can use this id to determine if the parameters associated with the instance - // differ from the parameters associated with the nodes and any action needs - // to be taken to apply parameters on nodes. + // Output only. string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // User defined set of parameters to use in the memcached process. @@ -457,29 +504,29 @@ message MemcacheParameters { // Represents the metadata of a long-running operation. message OperationMetadata { - // Time when the operation was created. - google.protobuf.Timestamp create_time = 1; + // Output only. Time when the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Time when the operation finished running. - google.protobuf.Timestamp end_time = 2; + // Output only. Time when the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Server-defined resource path for the target of the operation. - string target = 3; + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Name of the verb executed by the operation. - string verb = 4; + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Human-readable status of the operation, if any. - string status_detail = 5; + // Output only. Human-readable status of the operation, if any. + string status_detail = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Identifies whether the user has requested cancellation + // Output only. Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, // corresponding to `Code.CANCELLED`. - bool cancel_requested = 6; + bool cancel_requested = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - // API version used to start the operation. - string api_version = 7; + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Memcached versions supported by our service. diff --git a/packages/google-cloud-memcache/protos/protos.d.ts b/packages/google-cloud-memcache/protos/protos.d.ts index f3453a5578b..6f035a0db89 100644 --- a/packages/google-cloud-memcache/protos/protos.d.ts +++ b/packages/google-cloud-memcache/protos/protos.d.ts @@ -1869,6 +1869,20 @@ export namespace google { * @returns Promise */ public applyParameters(request: google.cloud.memcache.v1beta2.IApplyParametersRequest): Promise; + + /** + * Calls ApplySoftwareUpdate. + * @param request ApplySoftwareUpdateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public applySoftwareUpdate(request: google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdateCallback): void; + + /** + * Calls ApplySoftwareUpdate. + * @param request ApplySoftwareUpdateRequest message or plain object + * @returns Promise + */ + public applySoftwareUpdate(request: google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest): Promise; } namespace CloudMemcache { @@ -1921,6 +1935,13 @@ export namespace google { * @param [response] Operation */ type ApplyParametersCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#applySoftwareUpdate}. + * @param error Error, if any + * @param [response] Operation + */ + type ApplySoftwareUpdateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of an Instance. */ @@ -1973,6 +1994,9 @@ export namespace google { /** Instance discoveryEndpoint */ discoveryEndpoint?: (string|null); + + /** Instance updateAvailable */ + updateAvailable?: (boolean|null); } /** Represents an Instance. */ @@ -2032,6 +2056,9 @@ export namespace google { /** Instance discoveryEndpoint. */ public discoveryEndpoint: string; + /** Instance updateAvailable. */ + public updateAvailable: boolean; + /** * Creates a new Instance instance using the specified properties. * @param [properties] Properties to set @@ -2221,6 +2248,9 @@ export namespace google { /** Node parameters */ parameters?: (google.cloud.memcache.v1beta2.IMemcacheParameters|null); + + /** Node updateAvailable */ + updateAvailable?: (boolean|null); } /** Represents a Node. */ @@ -2250,6 +2280,9 @@ export namespace google { /** Node parameters. */ public parameters?: (google.cloud.memcache.v1beta2.IMemcacheParameters|null); + /** Node updateAvailable. */ + public updateAvailable: boolean; + /** * Creates a new Node instance using the specified properties. * @param [properties] Properties to set @@ -3246,6 +3279,108 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of an ApplySoftwareUpdateRequest. */ + interface IApplySoftwareUpdateRequest { + + /** ApplySoftwareUpdateRequest instance */ + instance?: (string|null); + + /** ApplySoftwareUpdateRequest nodeIds */ + nodeIds?: (string[]|null); + + /** ApplySoftwareUpdateRequest applyAll */ + applyAll?: (boolean|null); + } + + /** Represents an ApplySoftwareUpdateRequest. */ + class ApplySoftwareUpdateRequest implements IApplySoftwareUpdateRequest { + + /** + * Constructs a new ApplySoftwareUpdateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest); + + /** ApplySoftwareUpdateRequest instance. */ + public instance: string; + + /** ApplySoftwareUpdateRequest nodeIds. */ + public nodeIds: string[]; + + /** ApplySoftwareUpdateRequest applyAll. */ + public applyAll: boolean; + + /** + * Creates a new ApplySoftwareUpdateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplySoftwareUpdateRequest instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest): google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest; + + /** + * Encodes the specified ApplySoftwareUpdateRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest.verify|verify} messages. + * @param message ApplySoftwareUpdateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplySoftwareUpdateRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest.verify|verify} messages. + * @param message ApplySoftwareUpdateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplySoftwareUpdateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplySoftwareUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest; + + /** + * Decodes an ApplySoftwareUpdateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplySoftwareUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest; + + /** + * Verifies an ApplySoftwareUpdateRequest message. + * @param message Plain 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 ApplySoftwareUpdateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplySoftwareUpdateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest; + + /** + * Creates a plain object from an ApplySoftwareUpdateRequest message. Also converts values to other types if specified. + * @param message ApplySoftwareUpdateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplySoftwareUpdateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a MemcacheParameters. */ interface IMemcacheParameters { diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index a5b6c4a6450..fc9b5c35ddc 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/protos/protos.js @@ -4557,6 +4557,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#applySoftwareUpdate}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef ApplySoftwareUpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ApplySoftwareUpdate. + * @function applySoftwareUpdate + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest} request ApplySoftwareUpdateRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.applySoftwareUpdate = function applySoftwareUpdate(request, callback) { + return this.rpcCall(applySoftwareUpdate, $root.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ApplySoftwareUpdate" }); + + /** + * Calls ApplySoftwareUpdate. + * @function applySoftwareUpdate + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest} request ApplySoftwareUpdateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return CloudMemcache; })(); @@ -4582,6 +4615,7 @@ * @property {string|null} [memcacheFullVersion] Instance memcacheFullVersion * @property {Array.|null} [instanceMessages] Instance instanceMessages * @property {string|null} [discoveryEndpoint] Instance discoveryEndpoint + * @property {boolean|null} [updateAvailable] Instance updateAvailable */ /** @@ -4731,6 +4765,14 @@ */ Instance.prototype.discoveryEndpoint = ""; + /** + * Instance updateAvailable. + * @member {boolean} updateAvailable + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.updateAvailable = false; + /** * Creates a new Instance instance using the specified properties. * @function create @@ -4791,6 +4833,8 @@ $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.encode(message.instanceMessages[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); if (message.discoveryEndpoint != null && Object.hasOwnProperty.call(message, "discoveryEndpoint")) writer.uint32(/* id 20, wireType 2 =*/162).string(message.discoveryEndpoint); + if (message.updateAvailable != null && Object.hasOwnProperty.call(message, "updateAvailable")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.updateAvailable); return writer; }; @@ -4898,6 +4942,9 @@ case 20: message.discoveryEndpoint = reader.string(); break; + case 21: + message.updateAvailable = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -5023,6 +5070,9 @@ if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) if (!$util.isString(message.discoveryEndpoint)) return "discoveryEndpoint: string expected"; + if (message.updateAvailable != null && message.hasOwnProperty("updateAvailable")) + if (typeof message.updateAvailable !== "boolean") + return "updateAvailable: boolean expected"; return null; }; @@ -5136,6 +5186,8 @@ } if (object.discoveryEndpoint != null) message.discoveryEndpoint = String(object.discoveryEndpoint); + if (object.updateAvailable != null) + message.updateAvailable = Boolean(object.updateAvailable); return message; }; @@ -5172,6 +5224,7 @@ object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; object.memcacheFullVersion = ""; object.discoveryEndpoint = ""; + object.updateAvailable = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -5218,6 +5271,8 @@ } if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) object.discoveryEndpoint = message.discoveryEndpoint; + if (message.updateAvailable != null && message.hasOwnProperty("updateAvailable")) + object.updateAvailable = message.updateAvailable; return object; }; @@ -5454,6 +5509,7 @@ * @property {string|null} [host] Node host * @property {number|null} [port] Node port * @property {google.cloud.memcache.v1beta2.IMemcacheParameters|null} [parameters] Node parameters + * @property {boolean|null} [updateAvailable] Node updateAvailable */ /** @@ -5519,6 +5575,14 @@ */ Node.prototype.parameters = null; + /** + * Node updateAvailable. + * @member {boolean} updateAvailable + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.updateAvailable = false; + /** * Creates a new Node instance using the specified properties. * @function create @@ -5555,6 +5619,8 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.port); if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateAvailable != null && Object.hasOwnProperty.call(message, "updateAvailable")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.updateAvailable); return writer; }; @@ -5607,6 +5673,9 @@ case 6: message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); break; + case 7: + message.updateAvailable = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -5670,6 +5739,9 @@ if (error) return "parameters." + error; } + if (message.updateAvailable != null && message.hasOwnProperty("updateAvailable")) + if (typeof message.updateAvailable !== "boolean") + return "updateAvailable: boolean expected"; return null; }; @@ -5720,6 +5792,8 @@ throw TypeError(".google.cloud.memcache.v1beta2.Instance.Node.parameters: object expected"); message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.fromObject(object.parameters); } + if (object.updateAvailable != null) + message.updateAvailable = Boolean(object.updateAvailable); return message; }; @@ -5743,6 +5817,7 @@ object.host = ""; object.port = 0; object.parameters = null; + object.updateAvailable = false; } if (message.nodeId != null && message.hasOwnProperty("nodeId")) object.nodeId = message.nodeId; @@ -5756,6 +5831,8 @@ object.port = message.port; if (message.parameters != null && message.hasOwnProperty("parameters")) object.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.toObject(message.parameters, options); + if (message.updateAvailable != null && message.hasOwnProperty("updateAvailable")) + object.updateAvailable = message.updateAvailable; return object; }; @@ -7921,6 +7998,255 @@ return UpdateParametersRequest; })(); + v1beta2.ApplySoftwareUpdateRequest = (function() { + + /** + * Properties of an ApplySoftwareUpdateRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface IApplySoftwareUpdateRequest + * @property {string|null} [instance] ApplySoftwareUpdateRequest instance + * @property {Array.|null} [nodeIds] ApplySoftwareUpdateRequest nodeIds + * @property {boolean|null} [applyAll] ApplySoftwareUpdateRequest applyAll + */ + + /** + * Constructs a new ApplySoftwareUpdateRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents an ApplySoftwareUpdateRequest. + * @implements IApplySoftwareUpdateRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest=} [properties] Properties to set + */ + function ApplySoftwareUpdateRequest(properties) { + this.nodeIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplySoftwareUpdateRequest instance. + * @member {string} instance + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @instance + */ + ApplySoftwareUpdateRequest.prototype.instance = ""; + + /** + * ApplySoftwareUpdateRequest nodeIds. + * @member {Array.} nodeIds + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @instance + */ + ApplySoftwareUpdateRequest.prototype.nodeIds = $util.emptyArray; + + /** + * ApplySoftwareUpdateRequest applyAll. + * @member {boolean} applyAll + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @instance + */ + ApplySoftwareUpdateRequest.prototype.applyAll = false; + + /** + * Creates a new ApplySoftwareUpdateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest} ApplySoftwareUpdateRequest instance + */ + ApplySoftwareUpdateRequest.create = function create(properties) { + return new ApplySoftwareUpdateRequest(properties); + }; + + /** + * Encodes the specified ApplySoftwareUpdateRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest} message ApplySoftwareUpdateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplySoftwareUpdateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); + if (message.nodeIds != null && message.nodeIds.length) + for (var i = 0; i < message.nodeIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIds[i]); + if (message.applyAll != null && Object.hasOwnProperty.call(message, "applyAll")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.applyAll); + return writer; + }; + + /** + * Encodes the specified ApplySoftwareUpdateRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest} message ApplySoftwareUpdateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplySoftwareUpdateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplySoftwareUpdateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest} ApplySoftwareUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplySoftwareUpdateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.instance = reader.string(); + break; + case 2: + if (!(message.nodeIds && message.nodeIds.length)) + message.nodeIds = []; + message.nodeIds.push(reader.string()); + break; + case 3: + message.applyAll = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApplySoftwareUpdateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest} ApplySoftwareUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplySoftwareUpdateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplySoftwareUpdateRequest message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplySoftwareUpdateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.nodeIds != null && message.hasOwnProperty("nodeIds")) { + if (!Array.isArray(message.nodeIds)) + return "nodeIds: array expected"; + for (var i = 0; i < message.nodeIds.length; ++i) + if (!$util.isString(message.nodeIds[i])) + return "nodeIds: string[] expected"; + } + if (message.applyAll != null && message.hasOwnProperty("applyAll")) + if (typeof message.applyAll !== "boolean") + return "applyAll: boolean expected"; + return null; + }; + + /** + * Creates an ApplySoftwareUpdateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest} ApplySoftwareUpdateRequest + */ + ApplySoftwareUpdateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.nodeIds) { + if (!Array.isArray(object.nodeIds)) + throw TypeError(".google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest.nodeIds: array expected"); + message.nodeIds = []; + for (var i = 0; i < object.nodeIds.length; ++i) + message.nodeIds[i] = String(object.nodeIds[i]); + } + if (object.applyAll != null) + message.applyAll = Boolean(object.applyAll); + return message; + }; + + /** + * Creates a plain object from an ApplySoftwareUpdateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest} message ApplySoftwareUpdateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplySoftwareUpdateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeIds = []; + if (options.defaults) { + object.instance = ""; + object.applyAll = false; + } + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.nodeIds && message.nodeIds.length) { + object.nodeIds = []; + for (var j = 0; j < message.nodeIds.length; ++j) + object.nodeIds[j] = message.nodeIds[j]; + } + if (message.applyAll != null && message.hasOwnProperty("applyAll")) + object.applyAll = message.applyAll; + return object; + }; + + /** + * Converts this ApplySoftwareUpdateRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @instance + * @returns {Object.} JSON object + */ + ApplySoftwareUpdateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ApplySoftwareUpdateRequest; + })(); + v1beta2.MemcacheParameters = (function() { /** diff --git a/packages/google-cloud-memcache/protos/protos.json b/packages/google-cloud-memcache/protos/protos.json index 35c12661a2a..647f68dbd3f 100644 --- a/packages/google-cloud-memcache/protos/protos.json +++ b/packages/google-cloud-memcache/protos/protos.json @@ -824,6 +824,34 @@ } } ] + }, + "ApplySoftwareUpdate": { + "requestType": "ApplySoftwareUpdateRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta2/{instance=projects/*/locations/*/instances/*}:applySoftwareUpdate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "instance,node_ids,apply_all", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1beta2.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/{instance=projects/*/locations/*/instances/*}:applySoftwareUpdate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "instance,node_ids,apply_all" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1beta2.Instance", + "metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + } + ] } } }, @@ -927,6 +955,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "updateAvailable": { + "type": "bool", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -988,6 +1023,13 @@ "parameters": { "type": "MemcacheParameters", "id": 6 + }, + "updateAvailable": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -1139,7 +1181,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } } } }, @@ -1187,6 +1233,27 @@ } } }, + "ApplySoftwareUpdateRequest": { + "fields": { + "instance": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + }, + "nodeIds": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "applyAll": { + "type": "bool", + "id": 3 + } + } + }, "MemcacheParameters": { "fields": { "id": { @@ -1207,31 +1274,52 @@ "fields": { "createTime": { "type": "google.protobuf.Timestamp", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "endTime": { "type": "google.protobuf.Timestamp", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "target": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "verb": { "type": "string", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "statusDetail": { "type": "string", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "cancelRequested": { "type": "bool", - "id": 6 + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "apiVersion": { "type": "string", - "id": 7 + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, diff --git a/packages/google-cloud-memcache/src/index.ts b/packages/google-cloud-memcache/src/index.ts index 856e188d9f5..3172b5015ea 100644 --- a/packages/google-cloud-memcache/src/index.ts +++ b/packages/google-cloud-memcache/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. @@ -12,14 +12,17 @@ // 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 ** +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** +import * as v1beta2 from './v1beta2'; import * as v1 from './v1'; + const CloudMemcacheClient = v1.CloudMemcacheClient; type CloudMemcacheClient = v1.CloudMemcacheClient; -export {v1, CloudMemcacheClient}; -export default {v1, CloudMemcacheClient}; + +export {v1beta2, v1, CloudMemcacheClient}; +export default {v1beta2, v1, CloudMemcacheClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index 0549f6b480a..b45f2cab3df 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -55,7 +55,7 @@ const version = require('../../../package.json').version; * * As such, Memcached instances are resources of the form: * `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` * - * Note that location_id must be refering to a GCP `region`; for example: + * Note that location_id must be a GCP `region`; for example: * * `projects/my-memcached-project/locations/us-central1/instances/my-memcached` * @class * @memberof v1beta2 @@ -247,6 +247,12 @@ export class CloudMemcacheClient { const applyParametersMetadata = protoFilesRoot.lookup( '.google.cloud.memcache.v1beta2.OperationMetadata' ) as gax.protobuf.Type; + const applySoftwareUpdateResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.Instance' + ) as gax.protobuf.Type; + const applySoftwareUpdateMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.OperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createInstance: new this._gaxModule.LongrunningDescriptor( @@ -274,6 +280,11 @@ export class CloudMemcacheClient { applyParametersResponse.decode.bind(applyParametersResponse), applyParametersMetadata.decode.bind(applyParametersMetadata) ), + applySoftwareUpdate: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + applySoftwareUpdateResponse.decode.bind(applySoftwareUpdateResponse), + applySoftwareUpdateMetadata.decode.bind(applySoftwareUpdateMetadata) + ), }; // Put together the default options sent with requests. @@ -329,6 +340,7 @@ export class CloudMemcacheClient { 'updateParameters', 'deleteInstance', 'applyParameters', + 'applySoftwareUpdate', ]; for (const methodName of cloudMemcacheStubMethods) { const callPromise = this.cloudMemcacheStub.then( @@ -545,7 +557,7 @@ export class CloudMemcacheClient { > ): void; /** - * Creates a new Instance in a given project and location. + * Creates a new Instance in a given location. * * @param {Object} request * The request object that will be sent. @@ -561,7 +573,9 @@ export class CloudMemcacheClient { * * Must start with a letter. * * Must be between 1-40 characters. * * Must end with a number or a letter. - * * Must be unique within the user project / location + * * Must be unique within the user project / location. + * + * If any of the above are not met, the API raises an invalid argument error. * @param {google.cloud.memcache.v1beta2.Instance} request.resource * Required. A Memcached [Instance] resource * @param {object} [options] @@ -706,7 +720,7 @@ export class CloudMemcacheClient { * The request object that will be sent. * @param {google.protobuf.FieldMask} request.updateMask * Required. Mask of fields to update. - * * `displayName` + * * `displayName` * @param {google.cloud.memcache.v1beta2.Instance} request.resource * Required. A Memcached [Instance] resource. * Only fields specified in update_mask are updated. @@ -846,9 +860,10 @@ export class CloudMemcacheClient { > ): void; /** - * Updates the defined Memcached Parameters for an existing Instance. + * Updates the defined Memcached parameters for an existing instance. * This method only stages the parameters, it must be followed by - * ApplyParameters to apply the parameters to nodes of the Memcached Instance. + * `ApplyParameters` to apply the parameters to nodes of the Memcached + * instance. * * @param {Object} request * The request object that will be sent. @@ -1000,7 +1015,7 @@ export class CloudMemcacheClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Memcached instance resource name in the format: + * Required. Memcached instance resource name in the format: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` * where `location_id` refers to a GCP region * @param {object} [options] @@ -1139,8 +1154,8 @@ export class CloudMemcacheClient { > ): void; /** - * ApplyParameters will update current set of Parameters to the set of - * specified nodes of the Memcached Instance. + * `ApplyParameters` restarts the set of specified nodes in order to update + * them to the current set of parameters for the Memcached Instance. * * @param {Object} request * The request object that will be sent. @@ -1148,11 +1163,11 @@ export class CloudMemcacheClient { * Required. Resource name of the Memcached instance for which parameter group updates * should be applied. * @param {string[]} request.nodeIds - * Nodes to which we should apply the instance-level parameter group. + * Nodes to which the instance-level parameter group is applied. * @param {boolean} request.applyAll * Whether to apply instance-level parameter group to all nodes. If set to - * true, will explicitly restrict users from specifying any nodes, and apply - * parameter group updates to all nodes within the instance. + * true, users are restricted from specifying individual nodes, and + * `ApplyParameters` updates all nodes within the instance. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1252,6 +1267,156 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1beta2.OperationMetadata >; } + applySoftwareUpdate( + request: protos.google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + applySoftwareUpdate( + request: protos.google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + applySoftwareUpdate( + request: protos.google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates software on the selected nodes of the Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Required. Resource name of the Memcached instance for which software update should be + * applied. + * @param {string[]} request.nodeIds + * Nodes to which we should apply the update to. Note all the selected nodes + * are updated in parallel. + * @param {boolean} request.applyAll + * Whether to apply the update to all nodes. If set to + * true, will explicitly restrict users from specifying any nodes, and apply + * software update to all nodes (where applicable) within the instance. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.applySoftwareUpdate(request); + * const [response] = await operation.promise(); + */ + applySoftwareUpdate( + request: protos.google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.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: request.instance || '', + }); + this.initialize(); + return this.innerApiCalls.applySoftwareUpdate(request, options, callback); + } + /** + * Check the status of the long running operation returned by `applySoftwareUpdate()`. + * @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 checkApplySoftwareUpdateProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkApplySoftwareUpdateProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.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.applySoftwareUpdate, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + >; + } listInstances( request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, options?: CallOptions @@ -1284,7 +1449,7 @@ export class CloudMemcacheClient { > ): void; /** - * Lists Instances in a given project and location. + * Lists Instances in a given location. * * @param {Object} request * The request object that will be sent. @@ -1296,16 +1461,15 @@ export class CloudMemcacheClient { * The maximum number of items to return. * * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * {@link CloudMemcache.ListInstancesResponse.next_page_token|next_page_token} + * Regardless of the `page_size` value, the response may include a partial + * list and a caller should only rely on response's + * {@link google.cloud.memcache.v1beta2.ListInstancesResponse.next_page_token|`next_page_token`} * to determine if there are more instances left to be queried. * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, - * if any. + * The `next_page_token` value returned from a previous List request, if any. * @param {string} request.filter * List filter. For example, exclude all Memcached instances with name as - * my-instance by specifying "name != my-instance". + * my-instance by specifying `"name != my-instance"`. * @param {string} request.orderBy * Sort results. Supported values are "name", "name desc" or "" (unsorted). * @param {object} [options] @@ -1378,16 +1542,15 @@ export class CloudMemcacheClient { * The maximum number of items to return. * * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * {@link CloudMemcache.ListInstancesResponse.next_page_token|next_page_token} + * Regardless of the `page_size` value, the response may include a partial + * list and a caller should only rely on response's + * {@link google.cloud.memcache.v1beta2.ListInstancesResponse.next_page_token|`next_page_token`} * to determine if there are more instances left to be queried. * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, - * if any. + * The `next_page_token` value returned from a previous List request, if any. * @param {string} request.filter * List filter. For example, exclude all Memcached instances with name as - * my-instance by specifying "name != my-instance". + * my-instance by specifying `"name != my-instance"`. * @param {string} request.orderBy * Sort results. Supported values are "name", "name desc" or "" (unsorted). * @param {object} [options] @@ -1438,16 +1601,15 @@ export class CloudMemcacheClient { * The maximum number of items to return. * * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * {@link CloudMemcache.ListInstancesResponse.next_page_token|next_page_token} + * Regardless of the `page_size` value, the response may include a partial + * list and a caller should only rely on response's + * {@link google.cloud.memcache.v1beta2.ListInstancesResponse.next_page_token|`next_page_token`} * to determine if there are more instances left to be queried. * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, - * if any. + * The `next_page_token` value returned from a previous List request, if any. * @param {string} request.filter * List filter. For example, exclude all Memcached instances with name as - * my-instance by specifying "name != my-instance". + * my-instance by specifying `"name != my-instance"`. * @param {string} request.orderBy * Sort results. Supported values are "name", "name desc" or "" (unsorted). * @param {object} [options] diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client_config.json b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client_config.json index 318b8dab0e0..c3d3b2ae69b 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client_config.json +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client_config.json @@ -54,6 +54,11 @@ "timeout_millis": 1200000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "ApplySoftwareUpdate": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-memcache/src/v1beta2/gapic_metadata.json b/packages/google-cloud-memcache/src/v1beta2/gapic_metadata.json index 2eba47bb86d..e6f17d63c4c 100644 --- a/packages/google-cloud-memcache/src/v1beta2/gapic_metadata.json +++ b/packages/google-cloud-memcache/src/v1beta2/gapic_metadata.json @@ -40,6 +40,11 @@ "applyParameters" ] }, + "ApplySoftwareUpdate": { + "methods": [ + "applySoftwareUpdate" + ] + }, "ListInstances": { "methods": [ "listInstances", @@ -82,6 +87,11 @@ "applyParameters" ] }, + "ApplySoftwareUpdate": { + "methods": [ + "applySoftwareUpdate" + ] + }, "ListInstances": { "methods": [ "listInstances", diff --git a/packages/google-cloud-memcache/synth.metadata b/packages/google-cloud-memcache/synth.metadata deleted file mode 100644 index 4dc5c49e9bd..00000000000 --- a/packages/google-cloud-memcache/synth.metadata +++ /dev/null @@ -1,46 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/nodejs-memcache.git", - "sha": "c913005b864a1ceae4bcefeb156c7ad1761990ba" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", - "internalRef": "361273630" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "9583f62749edab8e1a5ccd613fe59cf553c189a1" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "memcache", - "apiVersion": "v1beta2", - "language": "nodejs", - "generator": "bazel" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "memcache", - "apiVersion": "v1", - "language": "nodejs", - "generator": "bazel" - } - } - ] -} \ No newline at end of file diff --git a/packages/google-cloud-memcache/synth.py b/packages/google-cloud-memcache/synth.py deleted file mode 100644 index aad0810f619..00000000000 --- a/packages/google-cloud-memcache/synth.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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. -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -import synthtool.gcp as gcp -import synthtool.languages.node as node -import logging - -logging.basicConfig(level=logging.DEBUG) - -# run the gapic generator -gapic = gcp.GAPICBazel() -versions = ['v1beta2', 'v1'] -name = 'memcache' -for version in versions: - library = gapic.node_library(name, version) -s.copy(library, excludes=['package.json', 'README.md']) - -# Copy common templates -common_templates = gcp.CommonTemplates() -templates = common_templates.node_library(source_location='build/src') -s.copy(templates, excludes=[]) - -node.postprocess_gapic_library() diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts new file mode 100644 index 00000000000..023232cb33c --- /dev/null +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts @@ -0,0 +1,1951 @@ +// 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 cloudmemcacheModule 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('v1beta2.CloudMemcacheClient', () => { + it('has servicePath', () => { + const servicePath = + cloudmemcacheModule.v1beta2.CloudMemcacheClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + cloudmemcacheModule.v1beta2.CloudMemcacheClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = cloudmemcacheModule.v1beta2.CloudMemcacheClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudMemcacheStub, undefined); + await client.initialize(); + assert(client.cloudMemcacheStub); + }); + + it('has close method', () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getInstance(request), expectedError); + assert( + (client.innerApiCalls.getInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() + ); + request.resource = {}; + request.resource.name = ''; + const expectedHeaderRequestParams = 'resource.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() + ); + request.resource = {}; + request.resource.name = ''; + const expectedHeaderRequestParams = 'resource.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.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() + ); + request.resource = {}; + request.resource.name = ''; + const expectedHeaderRequestParams = 'resource.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() + ); + request.resource = {}; + request.resource.name = ''; + const expectedHeaderRequestParams = 'resource.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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('updateParameters', () => { + it('invokes updateParameters without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateParameters = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.updateParameters(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateParameters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateParameters without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateParameters = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateParameters( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateParameters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateParameters with call error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateParameters = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateParameters(request), expectedError); + assert( + (client.innerApiCalls.updateParameters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateParameters with LRO error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateParameters = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateParameters(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.updateParameters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkUpdateParametersProgress without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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.checkUpdateParametersProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateParametersProgress with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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.checkUpdateParametersProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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('applyParameters', () => { + it('invokes applyParameters without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.applyParameters = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.applyParameters(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.applyParameters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes applyParameters without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.applyParameters = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.applyParameters( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.applyParameters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes applyParameters with call error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.applyParameters = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.applyParameters(request), expectedError); + assert( + (client.innerApiCalls.applyParameters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes applyParameters with LRO error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.applyParameters = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.applyParameters(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.applyParameters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkApplyParametersProgress without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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.checkApplyParametersProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkApplyParametersProgress with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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.checkApplyParametersProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('applySoftwareUpdate', () => { + it('invokes applySoftwareUpdate without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest() + ); + request.instance = ''; + const expectedHeaderRequestParams = 'instance='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.applySoftwareUpdate = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.applySoftwareUpdate(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.applySoftwareUpdate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes applySoftwareUpdate without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest() + ); + request.instance = ''; + const expectedHeaderRequestParams = 'instance='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.applySoftwareUpdate = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.applySoftwareUpdate( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.applySoftwareUpdate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes applySoftwareUpdate with call error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest() + ); + request.instance = ''; + const expectedHeaderRequestParams = 'instance='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.applySoftwareUpdate = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.applySoftwareUpdate(request), expectedError); + assert( + (client.innerApiCalls.applySoftwareUpdate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes applySoftwareUpdate with LRO error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest() + ); + request.instance = ''; + const expectedHeaderRequestParams = 'instance='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.applySoftwareUpdate = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.applySoftwareUpdate(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.applySoftwareUpdate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkApplySoftwareUpdateProgress without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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.checkApplySoftwareUpdateProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkApplySoftwareUpdateProgress with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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.checkApplySoftwareUpdateProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + ]; + client.innerApiCalls.listInstances = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + ]; + client.descriptors.page.listInstances.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.memcache.v1beta2.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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.memcache.v1beta2.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + ]; + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.memcache.v1beta2.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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.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.memcache.v1beta2.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInstances + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listInstances + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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) + ); + }); + }); + }); +}); From ffaa79c1d9a84a71d2651f8f40a3d48a576ef4fe Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Apr 2021 23:10:03 +0200 Subject: [PATCH 075/152] chore(deps): update dependency @types/sinon to v10 (#99) [![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/sinon](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^9.0.0` -> `^10.0.0`](https://renovatebot.com/diffs/npm/@types%2fsinon/9.0.11/10.0.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/compatibility-slim/9.0.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/confidence-slim/9.0.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index ea19e1bbe46..1f7e320144a 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -34,7 +34,7 @@ "devDependencies": { "@types/mocha": "^8.0.0", "@types/node": "^12.12.34", - "@types/sinon": "^9.0.0", + "@types/sinon": "^10.0.0", "c8": "^7.1.0", "gts": "^2.0.0", "jsdoc": "^3.6.3", From 586033d23db72ae28561d52475e24bc149087b8f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Apr 2021 00:56:04 +0200 Subject: [PATCH 076/152] chore(deps): update dependency ts-loader to v9 (#103) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | [`^8.0.0` -> `^9.0.0`](https://renovatebot.com/diffs/npm/ts-loader/8.1.0/9.0.0) | [![age](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/compatibility-slim/8.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/confidence-slim/8.1.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
TypeStrong/ts-loader ### [`v9.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v900) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v8.1.0...v9.0.0) Breaking changes: - minimum webpack version: 5 - minimum node version: 12 Changes: - [webpack 5 migration](https://togithub.com/TypeStrong/ts-loader/pull/1251) - thanks [@​johnnyreilly](https://togithub.com/johnnyreilly), [@​jonwallsten](https://togithub.com/jonwallsten), [@​sokra](https://togithub.com/sokra), [@​appzuka](https://togithub.com/appzuka), [@​alexander-akait](https://togithub.com/alexander-akait)
--- ### Configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 1f7e320144a..9655128c18c 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -45,7 +45,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^10.0.0", - "ts-loader": "^8.0.0", + "ts-loader": "^9.0.0", "typescript": "~3.8.3", "webpack": "^5.0.0", "webpack-cli": "^4.0.0", From 1298a3729b5a458277fbb52378b5bede58be0a19 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 6 May 2021 17:52:40 -0700 Subject: [PATCH 077/152] fix(deps): require google-gax v2.12.0 (#107) --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 9655128c18c..43aca7325c7 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -29,7 +29,7 @@ "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { - "google-gax": "^2.9.2" + "google-gax": "^2.12.0" }, "devDependencies": { "@types/mocha": "^8.0.0", From 3c74df1864333e4b657bd15558fb571252540702 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 17:02:14 +0000 Subject: [PATCH 078/152] chore: new owl bot post processor docker image (#109) gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f --- .../google-cloud-memcache/protos/protos.d.ts | 10 +- .../google-cloud-memcache/protos/protos.js | 20 +-- .../src/v1/cloud_memcache_client.ts | 98 ++++++------- .../src/v1beta2/cloud_memcache_client.ts | 107 +++++++------- .../test/gapic_cloud_memcache_v1.ts | 127 +++++++--------- .../test/gapic_cloud_memcache_v1beta2.ts | 137 ++++++++---------- 6 files changed, 219 insertions(+), 280 deletions(-) diff --git a/packages/google-cloud-memcache/protos/protos.d.ts b/packages/google-cloud-memcache/protos/protos.d.ts index 6f035a0db89..5f2e4e817ad 100644 --- a/packages/google-cloud-memcache/protos/protos.d.ts +++ b/packages/google-cloud-memcache/protos/protos.d.ts @@ -3932,19 +3932,19 @@ export namespace google { public selector: string; /** HttpRule get. */ - public get: string; + public get?: (string|null); /** HttpRule put. */ - public put: string; + public put?: (string|null); /** HttpRule post. */ - public post: string; + public post?: (string|null); /** HttpRule delete. */ - public delete: string; + public delete?: (string|null); /** HttpRule patch. */ - public patch: string; + public patch?: (string|null); /** HttpRule custom. */ public custom?: (google.api.ICustomHttpPattern|null); diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index fc9b5c35ddc..e1a780b8fa5 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/protos/protos.js @@ -9518,43 +9518,43 @@ /** * HttpRule get. - * @member {string} get + * @member {string|null|undefined} get * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.get = ""; + HttpRule.prototype.get = null; /** * HttpRule put. - * @member {string} put + * @member {string|null|undefined} put * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.put = ""; + HttpRule.prototype.put = null; /** * HttpRule post. - * @member {string} post + * @member {string|null|undefined} post * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.post = ""; + HttpRule.prototype.post = null; /** * HttpRule delete. - * @member {string} delete + * @member {string|null|undefined} delete * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype["delete"] = ""; + HttpRule.prototype["delete"] = null; /** * HttpRule patch. - * @member {string} patch + * @member {string|null|undefined} patch * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.patch = ""; + HttpRule.prototype.patch = null; /** * HttpRule custom. diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts index 3118cbd2a37..c89abf5a7cf 100644 --- a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts @@ -332,13 +332,14 @@ export class CloudMemcacheClient { ]; for (const methodName of cloudMemcacheStubMethods) { const callPromise = this.cloudMemcacheStub.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); - }, + 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; } @@ -493,11 +494,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getInstance(request, options, callback); } @@ -614,11 +614,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createInstance(request, options, callback); } @@ -760,11 +759,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'instance.name': request.instance!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'instance.name': request.instance!.name || '', + }); this.initialize(); return this.innerApiCalls.updateInstance(request, options, callback); } @@ -909,11 +907,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.updateParameters(request, options, callback); } @@ -1053,11 +1050,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteInstance(request, options, callback); } @@ -1203,11 +1199,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.applyParameters(request, options, callback); } @@ -1347,11 +1342,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listInstances(request, options, callback); } @@ -1400,11 +1394,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listInstances.createStream( @@ -1464,17 +1457,16 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listInstances.asyncIterate( this.innerApiCalls['listInstances'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index b45f2cab3df..1a74c73f80f 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -344,13 +344,14 @@ export class CloudMemcacheClient { ]; for (const methodName of cloudMemcacheStubMethods) { const callPromise = this.cloudMemcacheStub.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); - }, + 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; } @@ -511,11 +512,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getInstance(request, options, callback); } @@ -632,11 +632,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createInstance(request, options, callback); } @@ -778,11 +777,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'resource.name': request.resource!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'resource.name': request.resource!.name || '', + }); this.initialize(); return this.innerApiCalls.updateInstance(request, options, callback); } @@ -928,11 +926,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.updateParameters(request, options, callback); } @@ -1072,11 +1069,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteInstance(request, options, callback); } @@ -1222,11 +1218,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.applyParameters(request, options, callback); } @@ -1372,11 +1367,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - instance: request.instance || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + instance: request.instance || '', + }); this.initialize(); return this.innerApiCalls.applySoftwareUpdate(request, options, callback); } @@ -1521,11 +1515,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listInstances(request, options, callback); } @@ -1573,11 +1566,10 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listInstances.createStream( @@ -1636,17 +1628,16 @@ export class CloudMemcacheClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listInstances.asyncIterate( this.innerApiCalls['listInstances'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts index b70dc04aa1c..07f107d71a4 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts @@ -28,10 +28,9 @@ 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} - ); + 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; @@ -279,9 +278,8 @@ describe('v1.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.memcache.v1.Instance() ); - client.innerApiCalls.getInstance = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getInstance = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getInstance( request, @@ -360,9 +358,8 @@ describe('v1.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createInstance = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.createInstance = + stubLongRunningCall(expectedResponse); const [operation] = await client.createInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -394,9 +391,8 @@ describe('v1.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createInstance = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createInstance = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createInstance( request, @@ -557,9 +553,8 @@ describe('v1.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateInstance = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.updateInstance = + stubLongRunningCall(expectedResponse); const [operation] = await client.updateInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -592,9 +587,8 @@ describe('v1.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateInstance = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateInstance( request, @@ -756,9 +750,8 @@ describe('v1.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateParameters = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.updateParameters = + stubLongRunningCall(expectedResponse); const [operation] = await client.updateParameters(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -790,9 +783,8 @@ describe('v1.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateParameters = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateParameters = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateParameters( request, @@ -952,9 +944,8 @@ describe('v1.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteInstance = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.deleteInstance = + stubLongRunningCall(expectedResponse); const [operation] = await client.deleteInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -986,9 +977,8 @@ describe('v1.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteInstance = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteInstance( request, @@ -1148,9 +1138,8 @@ describe('v1.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.applyParameters = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.applyParameters = + stubLongRunningCall(expectedResponse); const [operation] = await client.applyParameters(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1182,9 +1171,8 @@ describe('v1.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.applyParameters = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.applyParameters = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.applyParameters( request, @@ -1379,9 +1367,8 @@ describe('v1.CloudMemcacheClient', () => { generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), ]; - client.innerApiCalls.listInstances = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listInstances = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listInstances( request, @@ -1453,9 +1440,8 @@ describe('v1.CloudMemcacheClient', () => { generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), ]; - client.descriptors.page.listInstances.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listInstancesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.memcache.v1.Instance[] = []; @@ -1480,10 +1466,9 @@ describe('v1.CloudMemcacheClient', () => { .calledWith(client.innerApiCalls.listInstances, request) ); assert.strictEqual( - (client.descriptors.page.listInstances - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listInstances.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1500,10 +1485,8 @@ describe('v1.CloudMemcacheClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listInstances.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listInstancesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.memcache.v1.Instance[] = []; @@ -1527,10 +1510,9 @@ describe('v1.CloudMemcacheClient', () => { .calledWith(client.innerApiCalls.listInstances, request) ); assert.strictEqual( - (client.descriptors.page.listInstances - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listInstances.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1551,9 +1533,8 @@ describe('v1.CloudMemcacheClient', () => { generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), ]; - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.memcache.v1.IInstance[] = []; const iterable = client.listInstancesAsync(request); for await (const resource of iterable) { @@ -1561,15 +1542,15 @@ describe('v1.CloudMemcacheClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listInstances - .asyncIterate as SinonStub).getCall(0).args[1], + ( + 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' - ], + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1586,10 +1567,8 @@ describe('v1.CloudMemcacheClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listInstancesAsync(request); await assert.rejects(async () => { const responses: protos.google.cloud.memcache.v1.IInstance[] = []; @@ -1598,15 +1577,15 @@ describe('v1.CloudMemcacheClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listInstances - .asyncIterate as SinonStub).getCall(0).args[1], + ( + 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' - ], + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts index 023232cb33c..e2fda9c8a13 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts @@ -28,10 +28,9 @@ 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} - ); + 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; @@ -281,9 +280,8 @@ describe('v1beta2.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.Instance() ); - client.innerApiCalls.getInstance = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getInstance = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getInstance( request, @@ -362,9 +360,8 @@ describe('v1beta2.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createInstance = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.createInstance = + stubLongRunningCall(expectedResponse); const [operation] = await client.createInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -396,9 +393,8 @@ describe('v1beta2.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createInstance = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createInstance = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createInstance( request, @@ -559,9 +555,8 @@ describe('v1beta2.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateInstance = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.updateInstance = + stubLongRunningCall(expectedResponse); const [operation] = await client.updateInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -594,9 +589,8 @@ describe('v1beta2.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateInstance = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateInstance( request, @@ -758,9 +752,8 @@ describe('v1beta2.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateParameters = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.updateParameters = + stubLongRunningCall(expectedResponse); const [operation] = await client.updateParameters(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -792,9 +785,8 @@ describe('v1beta2.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateParameters = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateParameters = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateParameters( request, @@ -954,9 +946,8 @@ describe('v1beta2.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteInstance = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.deleteInstance = + stubLongRunningCall(expectedResponse); const [operation] = await client.deleteInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -988,9 +979,8 @@ describe('v1beta2.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteInstance = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteInstance( request, @@ -1150,9 +1140,8 @@ describe('v1beta2.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.applyParameters = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.applyParameters = + stubLongRunningCall(expectedResponse); const [operation] = await client.applyParameters(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1184,9 +1173,8 @@ describe('v1beta2.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.applyParameters = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.applyParameters = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.applyParameters( request, @@ -1346,9 +1334,8 @@ describe('v1beta2.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.applySoftwareUpdate = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.applySoftwareUpdate = + stubLongRunningCall(expectedResponse); const [operation] = await client.applySoftwareUpdate(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1380,9 +1367,8 @@ describe('v1beta2.CloudMemcacheClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.applySoftwareUpdate = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.applySoftwareUpdate = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.applySoftwareUpdate( request, @@ -1589,9 +1575,8 @@ describe('v1beta2.CloudMemcacheClient', () => { new protos.google.cloud.memcache.v1beta2.Instance() ), ]; - client.innerApiCalls.listInstances = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listInstances = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listInstances( request, @@ -1669,9 +1654,8 @@ describe('v1beta2.CloudMemcacheClient', () => { new protos.google.cloud.memcache.v1beta2.Instance() ), ]; - client.descriptors.page.listInstances.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listInstancesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.memcache.v1beta2.Instance[] = []; @@ -1696,10 +1680,9 @@ describe('v1beta2.CloudMemcacheClient', () => { .calledWith(client.innerApiCalls.listInstances, request) ); assert.strictEqual( - (client.descriptors.page.listInstances - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listInstances.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1716,10 +1699,8 @@ describe('v1beta2.CloudMemcacheClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listInstances.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listInstancesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.memcache.v1beta2.Instance[] = []; @@ -1743,10 +1724,9 @@ describe('v1beta2.CloudMemcacheClient', () => { .calledWith(client.innerApiCalls.listInstances, request) ); assert.strictEqual( - (client.descriptors.page.listInstances - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listInstances.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1773,9 +1753,8 @@ describe('v1beta2.CloudMemcacheClient', () => { new protos.google.cloud.memcache.v1beta2.Instance() ), ]; - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.memcache.v1beta2.IInstance[] = []; const iterable = client.listInstancesAsync(request); for await (const resource of iterable) { @@ -1783,15 +1762,15 @@ describe('v1beta2.CloudMemcacheClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listInstances - .asyncIterate as SinonStub).getCall(0).args[1], + ( + 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' - ], + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1808,10 +1787,8 @@ describe('v1beta2.CloudMemcacheClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listInstancesAsync(request); await assert.rejects(async () => { const responses: protos.google.cloud.memcache.v1beta2.IInstance[] = []; @@ -1820,15 +1797,15 @@ describe('v1beta2.CloudMemcacheClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listInstances - .asyncIterate as SinonStub).getCall(0).args[1], + ( + 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' - ], + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); From 9b305fbd7c697142da60916d017421e80326d196 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 21:56:19 +0000 Subject: [PATCH 079/152] fix: use require() to load JSON protos (#110) The library is regenerated with gapic-generator-typescript v1.3.1. Committer: @alexander-fenster PiperOrigin-RevId: 372468161 Source-Link: https://github.com/googleapis/googleapis/commit/75880c3e6a6aa2597400582848e81bbbfac51dea Source-Link: https://github.com/googleapis/googleapis-gen/commit/77b18044813d4c8c415ff9ea68e76e307eb8e904 --- .../src/v1/cloud_memcache_client.ts | 26 +++---------------- .../src/v1beta2/cloud_memcache_client.ts | 26 +++---------------- 2 files changed, 8 insertions(+), 44 deletions(-) diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts index c89abf5a7cf..a39f1714879 100644 --- a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts @@ -32,6 +32,7 @@ import * as path from 'path'; 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_memcache_client_config.json`. @@ -161,22 +162,7 @@ export class CloudMemcacheClient { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -201,15 +187,11 @@ export class CloudMemcacheClient { ), }; + 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 protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index 1a74c73f80f..92885f78465 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -32,6 +32,7 @@ import * as path from 'path'; 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/v1beta2/cloud_memcache_client_config.json`. @@ -161,22 +162,7 @@ export class CloudMemcacheClient { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -201,15 +187,11 @@ export class CloudMemcacheClient { ), }; + 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 protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ From 444eaeafe9dfb636f8cabc571698d763028cb090 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 23:12:41 +0000 Subject: [PATCH 080/152] chore: update gapic-generator-typescript to v1.3.2 (#111) Committer: @alexander-fenster PiperOrigin-RevId: 372656503 Source-Link: https://github.com/googleapis/googleapis/commit/6fa858c6489b1bbc505a7d7afe39f2dc45819c38 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d7c95df3ab1ea1b4c22a4542bad4924cc46d1388 --- packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts | 1 - .../google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts index a39f1714879..325d9a2e297 100644 --- a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts @@ -27,7 +27,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index 92885f78465..be069f512b6 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -27,7 +27,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; From be944b6b7cca2d3753ea5dc0a90c2b1266bfd3c8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 13 May 2021 10:35:26 -0700 Subject: [PATCH 081/152] chore: release 1.4.1 (#108) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-memcache/CHANGELOG.md | 8 ++++++++ packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index 051659379e9..17665a37feb 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [1.4.1](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.0...v1.4.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#107](https://www.github.com/googleapis/nodejs-memcache/issues/107)) ([5a10a63](https://www.github.com/googleapis/nodejs-memcache/commit/5a10a632b62e00b2fe488deb92885bdc14f09f92)) +* use require() to load JSON protos ([#110](https://www.github.com/googleapis/nodejs-memcache/issues/110)) ([8335678](https://www.github.com/googleapis/nodejs-memcache/commit/8335678c41a08fb0b811db48540ff232b802e47a)) + ## [1.4.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.3.0...v1.4.0) (2021-03-01) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 43aca7325c7..a965af9b008 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "1.4.0", + "version": "1.4.1", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index 6a3a3125964..e7a3c98e22c 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^1.4.0" + "@google-cloud/memcache": "^1.4.1" }, "devDependencies": { "c8": "^7.0.0", From 392090848f00fb4acdce0e1d115f2c3959a3c688 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 21 May 2021 19:06:06 +0200 Subject: [PATCH 082/152] chore(deps): update dependency @types/node to v14 (#114) 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) | [`^12.12.34` -> `^14.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/12.20.13/14.17.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/compatibility-slim/12.20.13)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/confidence-slim/12.20.13)](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, 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-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index a965af9b008..6a4fbe03e5a 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^12.12.34", + "@types/node": "^14.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", "gts": "^2.0.0", From fe19348b9483bb6931a6c6a2a8bfd0ef1297d639 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 25 May 2021 17:56:37 +0200 Subject: [PATCH 083/152] chore(deps): update dependency sinon to v11 (#115) 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)) | [`^10.0.0` -> `^11.0.0`](https://renovatebot.com/diffs/npm/sinon/10.0.0/11.1.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/compatibility-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/confidence-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v11.1.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1110--2021-05-25) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.0.0...31be9a5d5a4762ef01cb195f29024616dfee9ce8) \================== - Add sinon.promise() implementation ([#​2369](https://togithub.com/sinonjs/sinon/issues/2369)) - Set wrappedMethod on getters/setters ([#​2378](https://togithub.com/sinonjs/sinon/issues/2378)) - \[Docs] Update fake-server usage & descriptions ([#​2365](https://togithub.com/sinonjs/sinon/issues/2365)) - Fake docs improvement ([#​2360](https://togithub.com/sinonjs/sinon/issues/2360)) - Update nise to 5.1.0 (fixed [#​2318](https://togithub.com/sinonjs/sinon/issues/2318)) ### [`v11.0.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1100--2021-05-24) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.1...v11.0.0) \================== - Explicitly use samsam 6.0.2 with fix for [#​2345](https://togithub.com/sinonjs/sinon/issues/2345) - Update most packages ([#​2371](https://togithub.com/sinonjs/sinon/issues/2371)) - Update compatibility docs ([#​2366](https://togithub.com/sinonjs/sinon/issues/2366)) - Update packages (includes breaking fake-timers change, see [#​2352](https://togithub.com/sinonjs/sinon/issues/2352)) - Warn of potential memory leaks ([#​2357](https://togithub.com/sinonjs/sinon/issues/2357)) - Fix clock test errors ### [`v10.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1001--2021-04-08) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.0...v10.0.1) \================== - Upgrade sinon components (bumps y18n to 4.0.1) - Bump y18n from 4.0.0 to 4.0.1
--- ### 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, 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-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 6a4fbe03e5a..e15a95fccb0 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -44,7 +44,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^10.0.0", + "sinon": "^11.0.0", "ts-loader": "^9.0.0", "typescript": "~3.8.3", "webpack": "^5.0.0", From aa148f42faa0b06541d5d56fd342d858ff7ff834 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 25 May 2021 20:48:45 +0000 Subject: [PATCH 084/152] fix: GoogleAdsError missing using generator version after 1.3.0 (#116) [PR](https://github.com/googleapis/gapic-generator-typescript/pull/878) within updated gapic-generator-typescript version 1.4.0 Committer: @summer-ji-eng PiperOrigin-RevId: 375759421 Source-Link: https://github.com/googleapis/googleapis/commit/95fa72fdd0d69b02d72c33b37d1e4cc66d4b1446 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f40a34377ad488a7c2bc3992b3c8d5faf5a15c46 --- packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts | 2 ++ .../google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts index 325d9a2e297..c8217da535d 100644 --- a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts @@ -156,6 +156,8 @@ export class CloudMemcacheClient { } 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}`); diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index be069f512b6..ce15b9ed1da 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -156,6 +156,8 @@ export class CloudMemcacheClient { } 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}`); From fe7def04507023e360a519976c1aab5df01d4cc9 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 29 May 2021 20:52:04 +0000 Subject: [PATCH 085/152] chore: make generate_index_ts() deterministic (#118) Fixes https://github.com/googleapis/synthtool/issues/1103 Source-Link: https://github.com/googleapis/synthtool/commit/c3e41da0fa256ad7f6b4bc76b9d069dedecdfef4 Post-Processor: gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:e37a815333a6f3e14d8532efe90cba8aa0d34210f8c0fdbdd9e6a34dcbe51e96 --- packages/google-cloud-memcache/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-memcache/src/index.ts b/packages/google-cloud-memcache/src/index.ts index 3172b5015ea..24e7272ecd0 100644 --- a/packages/google-cloud-memcache/src/index.ts +++ b/packages/google-cloud-memcache/src/index.ts @@ -16,13 +16,13 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** -import * as v1beta2 from './v1beta2'; import * as v1 from './v1'; +import * as v1beta2 from './v1beta2'; const CloudMemcacheClient = v1.CloudMemcacheClient; type CloudMemcacheClient = v1.CloudMemcacheClient; -export {v1beta2, v1, CloudMemcacheClient}; -export default {v1beta2, v1, CloudMemcacheClient}; +export {v1, v1beta2, CloudMemcacheClient}; +export default {v1, v1beta2, CloudMemcacheClient}; import * as protos from '../protos/protos'; export {protos}; From 44c2adfd78b5513e70a9f99c1569a4637539dddd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 2 Jun 2021 18:07:27 -0700 Subject: [PATCH 086/152] chore: release 1.4.2 (#117) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-memcache/CHANGELOG.md | 7 +++++++ packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index 17665a37feb..2168dd4e107 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.4.2](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.1...v1.4.2) (2021-05-29) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#116](https://www.github.com/googleapis/nodejs-memcache/issues/116)) ([d892630](https://www.github.com/googleapis/nodejs-memcache/commit/d89263085fd359b47105c1fa3e78fd3cfb2f1d3c)) + ### [1.4.1](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.0...v1.4.1) (2021-05-12) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index e15a95fccb0..0fde045063b 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "1.4.1", + "version": "1.4.2", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index e7a3c98e22c..e56fb3fc06a 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^1.4.1" + "@google-cloud/memcache": "^1.4.2" }, "devDependencies": { "c8": "^7.0.0", From cbc9edbdcc45b7e8ce2009dcec98a50517d77897 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Thu, 10 Jun 2021 23:00:46 +0200 Subject: [PATCH 087/152] chore(nodejs): remove api-extractor dependencies (#123) --- packages/google-cloud-memcache/package.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 0fde045063b..9a3c3c4799a 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -24,9 +24,7 @@ "system-test": "c8 mocha build/system-test", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "test": "c8 mocha build/test", - "precompile": "gts clean", - "api-extractor": "api-extractor run --local", - "api-documenter": "api-documenter yaml --input-folder=temp" + "precompile": "gts clean" }, "dependencies": { "google-gax": "^2.12.0" @@ -48,9 +46,7 @@ "ts-loader": "^9.0.0", "typescript": "~3.8.3", "webpack": "^5.0.0", - "webpack-cli": "^4.0.0", - "@microsoft/api-documenter": "^7.8.10", - "@microsoft/api-extractor": "^7.8.10" + "webpack-cli": "^4.0.0" }, "engines": { "node": ">=10.0.0" From 1ea17521d28484c5e860fee4cf46306456c6d862 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:22:51 +0000 Subject: [PATCH 088/152] fix: make request optional in all cases (#125) ... chore: update gapic-generator-ruby to the latest commit chore: release gapic-generator-typescript 1.5.0 Committer: @miraleung PiperOrigin-RevId: 380641501 Source-Link: https://github.com/googleapis/googleapis/commit/076f7e9f0b258bdb54338895d7251b202e8f0de3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/27e4c88b4048e5f56508d4e1aa417d60a3380892 --- .../src/v1/cloud_memcache_client.ts | 28 ++++++++-------- .../src/v1beta2/cloud_memcache_client.ts | 32 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts index c8217da535d..d5e2e0f06f9 100644 --- a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts @@ -398,7 +398,7 @@ export class CloudMemcacheClient { // -- Service calls -- // ------------------- getInstance( - request: protos.google.cloud.memcache.v1.IGetInstanceRequest, + request?: protos.google.cloud.memcache.v1.IGetInstanceRequest, options?: CallOptions ): Promise< [ @@ -444,7 +444,7 @@ export class CloudMemcacheClient { * const [response] = await client.getInstance(request); */ getInstance( - request: protos.google.cloud.memcache.v1.IGetInstanceRequest, + request?: protos.google.cloud.memcache.v1.IGetInstanceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -486,7 +486,7 @@ export class CloudMemcacheClient { } createInstance( - request: protos.google.cloud.memcache.v1.ICreateInstanceRequest, + request?: protos.google.cloud.memcache.v1.ICreateInstanceRequest, options?: CallOptions ): Promise< [ @@ -557,7 +557,7 @@ export class CloudMemcacheClient { * const [response] = await operation.promise(); */ createInstance( - request: protos.google.cloud.memcache.v1.ICreateInstanceRequest, + request?: protos.google.cloud.memcache.v1.ICreateInstanceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -642,7 +642,7 @@ export class CloudMemcacheClient { >; } updateInstance( - request: protos.google.cloud.memcache.v1.IUpdateInstanceRequest, + request?: protos.google.cloud.memcache.v1.IUpdateInstanceRequest, options?: CallOptions ): Promise< [ @@ -702,7 +702,7 @@ export class CloudMemcacheClient { * const [response] = await operation.promise(); */ updateInstance( - request: protos.google.cloud.memcache.v1.IUpdateInstanceRequest, + request?: protos.google.cloud.memcache.v1.IUpdateInstanceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -787,7 +787,7 @@ export class CloudMemcacheClient { >; } updateParameters( - request: protos.google.cloud.memcache.v1.IUpdateParametersRequest, + request?: protos.google.cloud.memcache.v1.IUpdateParametersRequest, options?: CallOptions ): Promise< [ @@ -850,7 +850,7 @@ export class CloudMemcacheClient { * const [response] = await operation.promise(); */ updateParameters( - request: protos.google.cloud.memcache.v1.IUpdateParametersRequest, + request?: protos.google.cloud.memcache.v1.IUpdateParametersRequest, optionsOrCallback?: | CallOptions | Callback< @@ -935,7 +935,7 @@ export class CloudMemcacheClient { >; } deleteInstance( - request: protos.google.cloud.memcache.v1.IDeleteInstanceRequest, + request?: protos.google.cloud.memcache.v1.IDeleteInstanceRequest, options?: CallOptions ): Promise< [ @@ -993,7 +993,7 @@ export class CloudMemcacheClient { * const [response] = await operation.promise(); */ deleteInstance( - request: protos.google.cloud.memcache.v1.IDeleteInstanceRequest, + request?: protos.google.cloud.memcache.v1.IDeleteInstanceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1078,7 +1078,7 @@ export class CloudMemcacheClient { >; } applyParameters( - request: protos.google.cloud.memcache.v1.IApplyParametersRequest, + request?: protos.google.cloud.memcache.v1.IApplyParametersRequest, options?: CallOptions ): Promise< [ @@ -1142,7 +1142,7 @@ export class CloudMemcacheClient { * const [response] = await operation.promise(); */ applyParameters( - request: protos.google.cloud.memcache.v1.IApplyParametersRequest, + request?: protos.google.cloud.memcache.v1.IApplyParametersRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1227,7 +1227,7 @@ export class CloudMemcacheClient { >; } listInstances( - request: protos.google.cloud.memcache.v1.IListInstancesRequest, + request?: protos.google.cloud.memcache.v1.IListInstancesRequest, options?: CallOptions ): Promise< [ @@ -1292,7 +1292,7 @@ export class CloudMemcacheClient { * for more details and examples. */ listInstances( - request: protos.google.cloud.memcache.v1.IListInstancesRequest, + request?: protos.google.cloud.memcache.v1.IListInstancesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index ce15b9ed1da..576baae79cf 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -410,7 +410,7 @@ export class CloudMemcacheClient { // -- Service calls -- // ------------------- getInstance( - request: protos.google.cloud.memcache.v1beta2.IGetInstanceRequest, + request?: protos.google.cloud.memcache.v1beta2.IGetInstanceRequest, options?: CallOptions ): Promise< [ @@ -460,7 +460,7 @@ export class CloudMemcacheClient { * const [response] = await client.getInstance(request); */ getInstance( - request: protos.google.cloud.memcache.v1beta2.IGetInstanceRequest, + request?: protos.google.cloud.memcache.v1beta2.IGetInstanceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -504,7 +504,7 @@ export class CloudMemcacheClient { } createInstance( - request: protos.google.cloud.memcache.v1beta2.ICreateInstanceRequest, + request?: protos.google.cloud.memcache.v1beta2.ICreateInstanceRequest, options?: CallOptions ): Promise< [ @@ -575,7 +575,7 @@ export class CloudMemcacheClient { * const [response] = await operation.promise(); */ createInstance( - request: protos.google.cloud.memcache.v1beta2.ICreateInstanceRequest, + request?: protos.google.cloud.memcache.v1beta2.ICreateInstanceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -660,7 +660,7 @@ export class CloudMemcacheClient { >; } updateInstance( - request: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, + request?: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, options?: CallOptions ): Promise< [ @@ -720,7 +720,7 @@ export class CloudMemcacheClient { * const [response] = await operation.promise(); */ updateInstance( - request: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, + request?: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -805,7 +805,7 @@ export class CloudMemcacheClient { >; } updateParameters( - request: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, + request?: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, options?: CallOptions ): Promise< [ @@ -869,7 +869,7 @@ export class CloudMemcacheClient { * const [response] = await operation.promise(); */ updateParameters( - request: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, + request?: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, optionsOrCallback?: | CallOptions | Callback< @@ -954,7 +954,7 @@ export class CloudMemcacheClient { >; } deleteInstance( - request: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, + request?: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, options?: CallOptions ): Promise< [ @@ -1012,7 +1012,7 @@ export class CloudMemcacheClient { * const [response] = await operation.promise(); */ deleteInstance( - request: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, + request?: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1097,7 +1097,7 @@ export class CloudMemcacheClient { >; } applyParameters( - request: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, + request?: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, options?: CallOptions ): Promise< [ @@ -1161,7 +1161,7 @@ export class CloudMemcacheClient { * const [response] = await operation.promise(); */ applyParameters( - request: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, + request?: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1246,7 +1246,7 @@ export class CloudMemcacheClient { >; } applySoftwareUpdate( - request: protos.google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, + request?: protos.google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, options?: CallOptions ): Promise< [ @@ -1310,7 +1310,7 @@ export class CloudMemcacheClient { * const [response] = await operation.promise(); */ applySoftwareUpdate( - request: protos.google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, + request?: protos.google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1395,7 +1395,7 @@ export class CloudMemcacheClient { >; } listInstances( - request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + request?: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, options?: CallOptions ): Promise< [ @@ -1463,7 +1463,7 @@ export class CloudMemcacheClient { * for more details and examples. */ listInstances( - request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + request?: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< From 667755c7a2442df1b2b94d9e62ccd7fcb07c8a65 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:48:33 +0000 Subject: [PATCH 089/152] chore: release 1.4.3 (#126) :robot: I have created a release \*beep\* \*boop\* --- ### [1.4.3](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.2...v1.4.3) (2021-06-22) ### Bug Fixes * make request optional in all cases ([#125](https://www.github.com/googleapis/nodejs-memcache/issues/125)) ([3b296ba](https://www.github.com/googleapis/nodejs-memcache/commit/3b296ba1e2598054ed391979b616ddf03f0b89f4)) --- 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-memcache/CHANGELOG.md | 7 +++++++ packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index 2168dd4e107..d85f555350d 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.4.3](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.2...v1.4.3) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#125](https://www.github.com/googleapis/nodejs-memcache/issues/125)) ([3b296ba](https://www.github.com/googleapis/nodejs-memcache/commit/3b296ba1e2598054ed391979b616ddf03f0b89f4)) + ### [1.4.2](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.1...v1.4.2) (2021-05-29) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 9a3c3c4799a..0e804273515 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "1.4.2", + "version": "1.4.3", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index e56fb3fc06a..1dd7f441a2e 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^1.4.2" + "@google-cloud/memcache": "^1.4.3" }, "devDependencies": { "c8": "^7.0.0", From a7b7fcba13a9a115e7907255bbbc9051f5543a74 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 29 Jun 2021 11:25:14 -0400 Subject: [PATCH 090/152] fix(deps): google-gax v2.17.0 with mTLS (#131) --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 0e804273515..c247f2a76e2 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.12.0" + "google-gax": "^2.17.0" }, "devDependencies": { "@types/mocha": "^8.0.0", From e9b4d7dcb47ca47281d1c98366b106fa32e6cbdd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 29 Jun 2021 15:50:49 +0000 Subject: [PATCH 091/152] chore: release 1.4.4 (#132) :robot: I have created a release \*beep\* \*boop\* --- ### [1.4.4](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.3...v1.4.4) (2021-06-29) ### Bug Fixes * **deps:** google-gax v2.17.0 with mTLS ([#131](https://www.github.com/googleapis/nodejs-memcache/issues/131)) ([f475455](https://www.github.com/googleapis/nodejs-memcache/commit/f47545548fe2bc478984a7ab715995fc32aee7cd)) --- 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-memcache/CHANGELOG.md | 7 +++++++ packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index d85f555350d..c33b623e5a6 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.4.4](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.3...v1.4.4) (2021-06-29) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#131](https://www.github.com/googleapis/nodejs-memcache/issues/131)) ([f475455](https://www.github.com/googleapis/nodejs-memcache/commit/f47545548fe2bc478984a7ab715995fc32aee7cd)) + ### [1.4.3](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.2...v1.4.3) (2021-06-22) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index c247f2a76e2..b4854c76da2 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "1.4.3", + "version": "1.4.4", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index 1dd7f441a2e..36ea843f036 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^1.4.3" + "@google-cloud/memcache": "^1.4.4" }, "devDependencies": { "c8": "^7.0.0", From 8d6cf3da1a717c70960a557f21b9288bd92852d8 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 12 Jul 2021 17:44:36 -0400 Subject: [PATCH 092/152] fix(deps): google-gax v2.17.1 (#134) --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index b4854c76da2..a9d11afb9a6 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.17.0" + "google-gax": "^2.17.1" }, "devDependencies": { "@types/mocha": "^8.0.0", From 1f4e6a471cb22e38f064c8a25038e7516b166e5e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 12 Jul 2021 22:04:29 +0000 Subject: [PATCH 093/152] chore: release 1.4.5 (#135) :robot: I have created a release \*beep\* \*boop\* --- ### [1.4.5](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.4...v1.4.5) (2021-07-12) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#134](https://www.github.com/googleapis/nodejs-memcache/issues/134)) ([0a53a9b](https://www.github.com/googleapis/nodejs-memcache/commit/0a53a9b9febde8ac007105ee7356df90278c4949)) --- 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-memcache/CHANGELOG.md | 7 +++++++ packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index c33b623e5a6..5433446dede 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.4.5](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.4...v1.4.5) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#134](https://www.github.com/googleapis/nodejs-memcache/issues/134)) ([0a53a9b](https://www.github.com/googleapis/nodejs-memcache/commit/0a53a9b9febde8ac007105ee7356df90278c4949)) + ### [1.4.4](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.3...v1.4.4) (2021-06-29) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index a9d11afb9a6..49334fc1887 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "1.4.4", + "version": "1.4.5", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index 36ea843f036..3df444b6f97 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^1.4.4" + "@google-cloud/memcache": "^1.4.5" }, "devDependencies": { "c8": "^7.0.0", From e4eda6fe7144a2dfefbd62f673ce003175ec7716 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 19:08:34 +0000 Subject: [PATCH 094/152] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#136) Also removing the explicit generator tag for the IAMPolicy mixin for the kms and pubsub APIS as the generator will now read it from the .yaml file. PiperOrigin-RevId: 385101839 Source-Link: https://github.com/googleapis/googleapis/commit/80f404215a9346259db760d80d0671f28c433453 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d3509d2520fb8db862129633f1cf8406d17454e1 --- .../src/v1/cloud_memcache_client.ts | 11 ++++++++++- .../src/v1beta2/cloud_memcache_client.ts | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts index d5e2e0f06f9..5d446610ab8 100644 --- a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts @@ -63,6 +63,7 @@ const version = require('../../../package.json').version; export class CloudMemcacheClient { 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: {}; @@ -74,6 +75,7 @@ export class CloudMemcacheClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -118,6 +120,9 @@ export class CloudMemcacheClient { const staticMembers = this.constructor as typeof CloudMemcacheClient; 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 = @@ -271,6 +276,9 @@ export class CloudMemcacheClient { // 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; } /** @@ -299,7 +307,8 @@ export class CloudMemcacheClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.memcache.v1.CloudMemcache, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index 576baae79cf..7065be31e4a 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -63,6 +63,7 @@ const version = require('../../../package.json').version; export class CloudMemcacheClient { 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: {}; @@ -74,6 +75,7 @@ export class CloudMemcacheClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -118,6 +120,9 @@ export class CloudMemcacheClient { const staticMembers = this.constructor as typeof CloudMemcacheClient; 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 = @@ -282,6 +287,9 @@ export class CloudMemcacheClient { // 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; } /** @@ -310,7 +318,8 @@ export class CloudMemcacheClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.memcache.v1beta2.CloudMemcache, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides From 9828624beef14470359f113d9768aab394acfa2a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 21 Jul 2021 00:30:15 +0000 Subject: [PATCH 095/152] chore: release 1.4.6 (#137) :robot: I have created a release \*beep\* \*boop\* --- ### [1.4.6](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.5...v1.4.6) (2021-07-21) ### Bug Fixes * Updating WORKSPACE files to use the newest version of the Typescript generator. ([#136](https://www.github.com/googleapis/nodejs-memcache/issues/136)) ([619f23e](https://www.github.com/googleapis/nodejs-memcache/commit/619f23ec0c25c8e5dd97894ada5f65ae763d2721)) --- 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-memcache/CHANGELOG.md | 7 +++++++ packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index 5433446dede..9062e623e5f 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.4.6](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.5...v1.4.6) (2021-07-21) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#136](https://www.github.com/googleapis/nodejs-memcache/issues/136)) ([619f23e](https://www.github.com/googleapis/nodejs-memcache/commit/619f23ec0c25c8e5dd97894ada5f65ae763d2721)) + ### [1.4.5](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.4...v1.4.5) (2021-07-12) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 49334fc1887..ec367638b7e 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "1.4.5", + "version": "1.4.6", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index 3df444b6f97..9af9bb68e7b 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^1.4.5" + "@google-cloud/memcache": "^1.4.6" }, "devDependencies": { "c8": "^7.0.0", From 31b090d3bb3fd490247510bc0b17e1659307e863 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 4 Aug 2021 16:00:41 -0400 Subject: [PATCH 096/152] chore(nodejs): update client ref docs link in metadata (#142) --- packages/google-cloud-memcache/.repo-metadata.json | 2 +- packages/google-cloud-memcache/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/.repo-metadata.json b/packages/google-cloud-memcache/.repo-metadata.json index 2c2fad534f9..de3f3d6f785 100644 --- a/packages/google-cloud-memcache/.repo-metadata.json +++ b/packages/google-cloud-memcache/.repo-metadata.json @@ -8,7 +8,7 @@ "release_level": "ga", "distribution_name": "@google-cloud/memcache", "name": "memcache", - "client_documentation": "https://googleapis.dev/nodejs/memcache/latest/index.html", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/memcache/latest", "api_id": "memcache.googleapis.com", "issue_tracker": "https://issuetracker.google.com/savedsearches/5169231" } diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md index f136bd02138..8f8562079e5 100644 --- a/packages/google-cloud-memcache/README.md +++ b/packages/google-cloud-memcache/README.md @@ -139,7 +139,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-memcache/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/memcache/latest/index.html +[client-docs]: https://cloud.google.com/nodejs/docs/reference/memcache/latest [product-docs]: https://cloud.google.com/memorystore/docs/memcached [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From b50e79409ad28c7d9043f2433c62b18c51bf2801 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 16 Aug 2021 22:42:22 -0400 Subject: [PATCH 097/152] fix(deps): google-gax v2.24.1 (#144) --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index ec367638b7e..ba4323105ec 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.17.1" + "google-gax": "^2.24.1" }, "devDependencies": { "@types/mocha": "^8.0.0", From e0ef8addcdac280fe3e5ffd9f261e02d139b60e8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 Aug 2021 17:04:48 +0000 Subject: [PATCH 098/152] chore: release 1.4.7 (#145) :robot: I have created a release \*beep\* \*boop\* --- ### [1.4.7](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.6...v1.4.7) (2021-08-17) ### Bug Fixes * **deps:** google-gax v2.24.1 ([#144](https://www.github.com/googleapis/nodejs-memcache/issues/144)) ([b50e358](https://www.github.com/googleapis/nodejs-memcache/commit/b50e3582e3e0381484617b23d2e2b63c2e4c4254)) --- 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-memcache/CHANGELOG.md | 7 +++++++ packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index 9062e623e5f..8f376520ad3 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.4.7](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.6...v1.4.7) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#144](https://www.github.com/googleapis/nodejs-memcache/issues/144)) ([b50e358](https://www.github.com/googleapis/nodejs-memcache/commit/b50e3582e3e0381484617b23d2e2b63c2e4c4254)) + ### [1.4.6](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.5...v1.4.6) (2021-07-21) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index ba4323105ec..b43d13df4d2 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "1.4.6", + "version": "1.4.7", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index 9af9bb68e7b..7265bb8304d 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^1.4.6" + "@google-cloud/memcache": "^1.4.7" }, "devDependencies": { "c8": "^7.0.0", From 73fec79b7c952e4e2309f3a97d9aa23d8eff881f 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:32:22 +0000 Subject: [PATCH 099/152] feat: turns on self-signed JWT feature flag (#147) - [ ] 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 --- .../google-cloud-memcache/src/v1/cloud_memcache_client.ts | 7 +++++++ .../src/v1beta2/cloud_memcache_client.ts | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts index 5d446610ab8..703e98353c5 100644 --- a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts @@ -147,6 +147,12 @@ export class CloudMemcacheClient { // 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; @@ -1563,6 +1569,7 @@ export class CloudMemcacheClient { return this.cloudMemcacheStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index 7065be31e4a..1d1a7c0af8c 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -147,6 +147,12 @@ export class CloudMemcacheClient { // 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; @@ -1734,6 +1740,7 @@ export class CloudMemcacheClient { return this.cloudMemcacheStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); From e81cc03590c739ecac2ecb3da33745f4648fcc5b 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:56:26 +0000 Subject: [PATCH 100/152] chore: release 1.5.0 (#148) :robot: I have created a release \*beep\* \*boop\* --- ## [1.5.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.7...v1.5.0) (2021-08-23) ### Features * turns on self-signed JWT feature flag ([#147](https://www.github.com/googleapis/nodejs-memcache/issues/147)) ([2914811](https://www.github.com/googleapis/nodejs-memcache/commit/2914811e7094e157af785fb52fe7211d2f4073cb)) --- 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-memcache/CHANGELOG.md | 7 +++++++ packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index 8f376520ad3..0bbae640332 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.5.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.7...v1.5.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#147](https://www.github.com/googleapis/nodejs-memcache/issues/147)) ([2914811](https://www.github.com/googleapis/nodejs-memcache/commit/2914811e7094e157af785fb52fe7211d2f4073cb)) + ### [1.4.7](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.6...v1.4.7) (2021-08-17) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index b43d13df4d2..7e6d84126d3 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "1.4.7", + "version": "1.5.0", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index 7265bb8304d..387cb44b249 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^1.4.7" + "@google-cloud/memcache": "^1.5.0" }, "devDependencies": { "c8": "^7.0.0", From cf579a48f2dd9bc98acfa6ca76a66ff2e5dced29 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 25 Aug 2021 23:36:23 +0000 Subject: [PATCH 101/152] chore: disable renovate dependency dashboard (#1194) (#149) --- packages/google-cloud-memcache/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md index 8f8562079e5..a1d041e5471 100644 --- a/packages/google-cloud-memcache/README.md +++ b/packages/google-cloud-memcache/README.md @@ -130,8 +130,8 @@ Contributions welcome! See the [Contributing Guide](https://github.com/googleapi 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 From 6a538e2647e38ecdc49afd3375b3c4dcc6e67d31 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 8 Sep 2021 11:08:15 -0400 Subject: [PATCH 102/152] fix(build): update branch to main (#150) --- packages/google-cloud-memcache/README.md | 12 ++++++------ packages/google-cloud-memcache/samples/README.md | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md index a1d041e5471..a21b74cee21 100644 --- a/packages/google-cloud-memcache/README.md +++ b/packages/google-cloud-memcache/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/memcache.svg)](https://www.npmjs.org/package/@google-cloud/memcache) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-memcache/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-memcache) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-memcache/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-memcache) @@ -15,7 +15,7 @@ Memcache client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-memcache/blob/master/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/nodejs-memcache/blob/main/CHANGELOG.md). * [Memorystore for Memcached Node.js Client API Reference][client-docs] * [Memorystore for Memcached Documentation][product-docs] @@ -72,11 +72,11 @@ console.info(cmc); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-memcache/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-memcache/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-memcache/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-memcache&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-memcache/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-memcache&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | @@ -125,7 +125,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-memcache/blob/master/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-memcache/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`) @@ -137,7 +137,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-memcache/blob/master/LICENSE) +See [LICENSE](https://github.com/googleapis/nodejs-memcache/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/memcache/latest [product-docs]: https://cloud.google.com/memorystore/docs/memcached diff --git a/packages/google-cloud-memcache/samples/README.md b/packages/google-cloud-memcache/samples/README.md index c45d3fe4faf..9e90121f898 100644 --- a/packages/google-cloud-memcache/samples/README.md +++ b/packages/google-cloud-memcache/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-memcache/blob/master/samples/quickstart.js). +View the [source code](https://github.com/googleapis/nodejs-memcache/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-memcache&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) From 3cf78252d8d83a719b7a5f636d2e0e5824458f23 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 8 Sep 2021 15:16:18 +0000 Subject: [PATCH 103/152] chore: release 1.5.1 (#151) :robot: I have created a release \*beep\* \*boop\* --- ### [1.5.1](https://www.github.com/googleapis/nodejs-memcache/compare/v1.5.0...v1.5.1) (2021-09-08) ### Bug Fixes * **build:** update branch to main ([#150](https://www.github.com/googleapis/nodejs-memcache/issues/150)) ([8c534ef](https://www.github.com/googleapis/nodejs-memcache/commit/8c534efaa39919a8df10622c9fa4e7dae18f5f61)) --- 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-memcache/CHANGELOG.md | 7 +++++++ packages/google-cloud-memcache/package.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index 0bbae640332..50495448301 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.5.1](https://www.github.com/googleapis/nodejs-memcache/compare/v1.5.0...v1.5.1) (2021-09-08) + + +### Bug Fixes + +* **build:** update branch to main ([#150](https://www.github.com/googleapis/nodejs-memcache/issues/150)) ([8c534ef](https://www.github.com/googleapis/nodejs-memcache/commit/8c534efaa39919a8df10622c9fa4e7dae18f5f61)) + ## [1.5.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.7...v1.5.0) (2021-08-23) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 7e6d84126d3..5450329c7ee 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "1.5.0", + "version": "1.5.1", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index 387cb44b249..c4ee1374a21 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^1.5.0" + "@google-cloud/memcache": "^1.5.1" }, "devDependencies": { "c8": "^7.0.0", From 306fcf59b2f5e4e81082783b63ab5a72d637b954 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Tue, 21 Sep 2021 07:16:24 -0700 Subject: [PATCH 104/152] chore: relocate owl bot post processor (#153) chore: relocate owl bot post processor --- packages/google-cloud-memcache/.github/.OwlBot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/.github/.OwlBot.yaml b/packages/google-cloud-memcache/.github/.OwlBot.yaml index c19316fdf4f..108d0937087 100644 --- a/packages/google-cloud-memcache/.github/.OwlBot.yaml +++ b/packages/google-cloud-memcache/.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 1b615ff4b98dca902a9d40ee298ec519718b7f95 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:44:54 +0000 Subject: [PATCH 105/152] build(node): update deps used during postprocessing (#1243) (#158) --- packages/google-cloud-memcache/protos/protos.d.ts | 3 ++- packages/google-cloud-memcache/protos/protos.js | 7 +++++++ packages/google-cloud-memcache/protos/protos.json | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/protos/protos.d.ts b/packages/google-cloud-memcache/protos/protos.d.ts index 5f2e4e817ad..f81a7f50d6a 100644 --- a/packages/google-cloud-memcache/protos/protos.d.ts +++ b/packages/google-cloud-memcache/protos/protos.d.ts @@ -4136,7 +4136,8 @@ export namespace google { OUTPUT_ONLY = 3, INPUT_ONLY = 4, IMMUTABLE = 5, - UNORDERED_LIST = 6 + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 } /** Properties of a ResourceDescriptor. */ diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index e1a780b8fa5..7ef396c657d 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/protos/protos.js @@ -10158,6 +10158,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); @@ -10168,6 +10169,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; })(); @@ -16336,6 +16338,7 @@ case 4: case 5: case 6: + case 7: break; } } @@ -16440,6 +16443,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-memcache/protos/protos.json b/packages/google-cloud-memcache/protos/protos.json index 647f68dbd3f..23c51758194 100644 --- a/packages/google-cloud-memcache/protos/protos.json +++ b/packages/google-cloud-memcache/protos/protos.json @@ -1477,7 +1477,8 @@ "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, "IMMUTABLE": 5, - "UNORDERED_LIST": 6 + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 } }, "resourceReference": { @@ -2120,6 +2121,18 @@ ] ], "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], [ 8, 8 From 357aca43748e6c74a92eb1c235a9e75c5d24257f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 26 Oct 2021 23:19:18 +0200 Subject: [PATCH 106/152] chore(deps): update dependency @types/node to v16 (#159) 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.0.0` -> `^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-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 5450329c7ee..2af40ffad94 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^14.0.0", + "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", "gts": "^2.0.0", From 9bc66997868d80d94b5721bc3695e919c5ed02a7 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Thu, 4 Nov 2021 11:50:38 -0400 Subject: [PATCH 107/152] chore(cloud-rad): delete api-extractor config (#161) --- .../google-cloud-memcache/api-extractor.json | 369 ------------------ 1 file changed, 369 deletions(-) delete mode 100644 packages/google-cloud-memcache/api-extractor.json diff --git a/packages/google-cloud-memcache/api-extractor.json b/packages/google-cloud-memcache/api-extractor.json deleted file mode 100644 index de228294b23..00000000000 --- a/packages/google-cloud-memcache/api-extractor.json +++ /dev/null @@ -1,369 +0,0 @@ -/** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - - /** - * Optionally specifies another JSON config file that this file extends from. This provides a way for - * standard settings to be shared across multiple projects. - * - * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains - * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be - * resolved using NodeJS require(). - * - * SUPPORTED TOKENS: none - * DEFAULT VALUE: "" - */ - // "extends": "./shared/api-extractor-base.json" - // "extends": "my-package/include/api-extractor-base.json" - - /** - * Determines the "" token that can be used with other config file settings. The project folder - * typically contains the tsconfig.json and package.json config files, but the path is user-defined. - * - * The path is resolved relative to the folder of the config file that contains the setting. - * - * The default value for "projectFolder" is the token "", which means the folder is determined by traversing - * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder - * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error - * will be reported. - * - * SUPPORTED TOKENS: - * DEFAULT VALUE: "" - */ - // "projectFolder": "..", - - /** - * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor - * analyzes the symbols exported by this module. - * - * The file extension must be ".d.ts" and not ".ts". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - */ - "mainEntryPointFilePath": "/protos/protos.d.ts", - - /** - * A list of NPM package names whose exports should be treated as part of this package. - * - * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", - * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part - * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly - * imports library2. To avoid this, we can specify: - * - * "bundledPackages": [ "library2" ], - * - * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been - * local files for library1. - */ - "bundledPackages": [ ], - - /** - * Determines how the TypeScript compiler engine will be invoked by API Extractor. - */ - "compiler": { - /** - * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * Note: This setting will be ignored if "overrideTsconfig" is used. - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/tsconfig.json" - */ - // "tsconfigFilePath": "/tsconfig.json", - - /** - * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. - * The object must conform to the TypeScript tsconfig schema: - * - * http://json.schemastore.org/tsconfig - * - * If omitted, then the tsconfig.json file will be read from the "projectFolder". - * - * DEFAULT VALUE: no overrideTsconfig section - */ - // "overrideTsconfig": { - // . . . - // } - - /** - * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended - * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when - * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses - * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. - * - * DEFAULT VALUE: false - */ - // "skipLibCheck": true, - }, - - /** - * Configures how the API report file (*.api.md) will be generated. - */ - "apiReport": { - /** - * (REQUIRED) Whether to generate an API report. - */ - "enabled": true, - - /** - * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce - * a full file path. - * - * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". - * - * SUPPORTED TOKENS: , - * DEFAULT VALUE: ".api.md" - */ - // "reportFileName": ".api.md", - - /** - * Specifies the folder where the API report file is written. The file name portion is determined by - * the "reportFileName" setting. - * - * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, - * e.g. for an API review. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/etc/" - */ - // "reportFolder": "/etc/", - - /** - * Specifies the folder where the temporary report file is written. The file name portion is determined by - * the "reportFileName" setting. - * - * After the temporary file is written to disk, it is compared with the file in the "reportFolder". - * If they are different, a production build will fail. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/temp/" - */ - // "reportTempFolder": "/temp/" - }, - - /** - * Configures how the doc model file (*.api.json) will be generated. - */ - "docModel": { - /** - * (REQUIRED) Whether to generate a doc model file. - */ - "enabled": true, - - /** - * The output path for the doc model file. The file extension should be ".api.json". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/temp/.api.json" - */ - // "apiJsonFilePath": "/temp/.api.json" - }, - - /** - * Configures how the .d.ts rollup file will be generated. - */ - "dtsRollup": { - /** - * (REQUIRED) Whether to generate the .d.ts rollup file. - */ - "enabled": true, - - /** - * Specifies the output path for a .d.ts rollup file to be generated without any trimming. - * This file will include all declarations that are exported by the main entry point. - * - * If the path is an empty string, then this file will not be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/dist/.d.ts" - */ - // "untrimmedFilePath": "/dist/.d.ts", - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. - * This file will include only declarations that are marked as "@public" or "@beta". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "betaTrimmedFilePath": "/dist/-beta.d.ts", - - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. - * This file will include only declarations that are marked as "@public". - * - * If the path is an empty string, then this file will not be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "publicTrimmedFilePath": "/dist/-public.d.ts", - - /** - * When a declaration is trimmed, by default it will be replaced by a code comment such as - * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the - * declaration completely. - * - * DEFAULT VALUE: false - */ - // "omitTrimmingComments": true - }, - - /** - * Configures how the tsdoc-metadata.json file will be generated. - */ - "tsdocMetadata": { - /** - * Whether to generate the tsdoc-metadata.json file. - * - * DEFAULT VALUE: true - */ - // "enabled": true, - - /** - * Specifies where the TSDoc metadata file should be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", - * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup - * falls back to "tsdoc-metadata.json" in the package folder. - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" - }, - - /** - * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files - * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. - * To use the OS's default newline kind, specify "os". - * - * DEFAULT VALUE: "crlf" - */ - // "newlineKind": "crlf", - - /** - * Configures how API Extractor reports error and warning messages produced during analysis. - * - * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. - */ - "messages": { - /** - * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing - * the input .d.ts files. - * - * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" - * - * DEFAULT VALUE: A single "default" entry with logLevel=warning. - */ - "compilerMessageReporting": { - /** - * Configures the default routing for messages that don't match an explicit rule in this table. - */ - "default": { - /** - * Specifies whether the message should be written to the the tool's output log. Note that - * the "addToApiReportFile" property may supersede this option. - * - * Possible values: "error", "warning", "none" - * - * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail - * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes - * the "--local" option), the warning is displayed but the build will not fail. - * - * DEFAULT VALUE: "warning" - */ - "logLevel": "warning", - - /** - * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), - * then the message will be written inside that file; otherwise, the message is instead logged according to - * the "logLevel" option. - * - * DEFAULT VALUE: false - */ - // "addToApiReportFile": false - }, - - // "TS2551": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - }, - - /** - * Configures handling of messages reported by API Extractor during its analysis. - * - * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" - * - * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings - */ - "extractorMessageReporting": { - "default": { - "logLevel": "warning", - // "addToApiReportFile": false - }, - - // "ae-extra-release-tag": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - }, - - /** - * Configures handling of messages reported by the TSDoc parser when analyzing code comments. - * - * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" - * - * DEFAULT VALUE: A single "default" entry with logLevel=warning. - */ - "tsdocMessageReporting": { - "default": { - "logLevel": "warning", - // "addToApiReportFile": false - } - - // "tsdoc-link-tag-unescaped-text": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - } - } - -} From 90a83cd7a8f7a0d28fc5926eb6941cc6b557aafe Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 4 Nov 2021 20:46:32 +0100 Subject: [PATCH 108/152] chore(deps): update dependency sinon to v12 (#160) 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-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 2af40ffad94..61d1b7ec24f 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -42,7 +42,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^11.0.0", + "sinon": "^12.0.0", "ts-loader": "^9.0.0", "typescript": "~3.8.3", "webpack": "^5.0.0", From 67b992091e268be1ac05848d1f84065f21ca811c 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 15:13:58 -0800 Subject: [PATCH 109/152] docs(samples): add example tags to generated samples (#162) 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 * chore: change node version for sample Co-authored-by: Owl Bot Co-authored-by: Takashi Matsuo --- .../linkinator.config.json | 2 +- .../v1/cloud_memcache.apply_parameters.js | 64 +++ .../v1/cloud_memcache.create_instance.js | 72 +++ .../v1/cloud_memcache.delete_instance.js | 55 ++ .../v1/cloud_memcache.get_instance.js | 54 ++ .../v1/cloud_memcache.list_instances.js | 79 +++ .../v1/cloud_memcache.update_instance.js | 60 +++ .../v1/cloud_memcache.update_parameters.js | 63 +++ .../cloud_memcache.apply_parameters.js | 64 +++ .../cloud_memcache.apply_software_update.js | 65 +++ .../v1beta2/cloud_memcache.create_instance.js | 72 +++ .../v1beta2/cloud_memcache.delete_instance.js | 55 ++ .../v1beta2/cloud_memcache.get_instance.js | 54 ++ .../v1beta2/cloud_memcache.list_instances.js | 78 +++ .../v1beta2/cloud_memcache.update_instance.js | 60 +++ .../cloud_memcache.update_parameters.js | 63 +++ .../samples/package.json | 2 +- .../src/v1/cloud_memcache_client.ts | 408 +++++++-------- .../src/v1beta2/cloud_memcache_client.ts | 480 +++++++++--------- 19 files changed, 1380 insertions(+), 470 deletions(-) create mode 100644 packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js create mode 100644 packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js create mode 100644 packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js create mode 100644 packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js create mode 100644 packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js create mode 100644 packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js create mode 100644 packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js create mode 100644 packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js create mode 100644 packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js create mode 100644 packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js create mode 100644 packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js create mode 100644 packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js create mode 100644 packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js create mode 100644 packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js create mode 100644 packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js diff --git a/packages/google-cloud-memcache/linkinator.config.json b/packages/google-cloud-memcache/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-memcache/linkinator.config.json +++ b/packages/google-cloud-memcache/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js new file mode 100644 index 00000000000..149f6c3a480 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.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(name) { + // [START memcache_v1_generated_CloudMemcache_ApplyParameters_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the Memcached instance for which parameter group updates + * should be applied. + */ + // const name = 'abc123' + /** + * Nodes to which we should apply the instance-level parameter group. + */ + // const nodeIds = 'abc123' + /** + * Whether to apply instance-level parameter group to all nodes. If set to + * true, will explicitly restrict users from specifying any nodes, and apply + * parameter group updates to all nodes within the instance. + */ + // const applyAll = true + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callApplyParameters() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await memcacheClient.applyParameters(request); + const [response] = await operation.promise(); + console.log(response); + } + + callApplyParameters(); + // [END memcache_v1_generated_CloudMemcache_ApplyParameters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js new file mode 100644 index 00000000000..fbfc07d5386 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js @@ -0,0 +1,72 @@ +// 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 memcache_v1_generated_CloudMemcache_CreateInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + */ + // const parent = 'abc123' + /** + * Required. The logical name of the Memcached instance in the user + * project with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-40 characters. + * * Must end with a number or a letter. + * * Must be unique within the user project / location + * If any of the above are not met, will raise an invalid argument error. + */ + // const instanceId = 'abc123' + /** + * Required. A Memcached Instance + */ + // const instance = {} + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callCreateInstance() { + // Construct request + const request = { + parent, + instanceId, + instance, + }; + + // Run request + const [operation] = await memcacheClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInstance(); + // [END memcache_v1_generated_CloudMemcache_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js new file mode 100644 index 00000000000..3adb5cd5e51 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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 memcache_v1_generated_CloudMemcache_DeleteInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + */ + // const name = 'abc123' + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callDeleteInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await memcacheClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInstance(); + // [END memcache_v1_generated_CloudMemcache_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js new file mode 100644 index 00000000000..b790ca11cc2 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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 memcache_v1_generated_CloudMemcache_GetInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + */ + // const name = 'abc123' + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callGetInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await memcacheClient.getInstance(request); + console.log(response); + } + + callGetInstance(); + // [END memcache_v1_generated_CloudMemcache_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js new file mode 100644 index 00000000000..a41bb41f3d7 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js @@ -0,0 +1,79 @@ +// 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 memcache_v1_generated_CloudMemcache_ListInstances_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * next_page_token CloudMemcache.ListInstancesResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, + * if any. + */ + // const pageToken = 'abc123' + /** + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying "name != my-instance". + */ + // const filter = 'abc123' + /** + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + */ + // const orderBy = 'abc123' + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callListInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await memcacheClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInstances(); + // [END memcache_v1_generated_CloudMemcache_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js new file mode 100644 index 00000000000..8f0489639f6 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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(updateMask, instance) { + // [START memcache_v1_generated_CloudMemcache_UpdateInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Mask of fields to update. + * * `displayName` + */ + // const updateMask = {} + /** + * Required. A Memcached Instance. + * Only fields specified in update_mask are updated. + */ + // const instance = {} + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callUpdateInstance() { + // Construct request + const request = { + updateMask, + instance, + }; + + // Run request + const [operation] = await memcacheClient.updateInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateInstance(); + // [END memcache_v1_generated_CloudMemcache_UpdateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js new file mode 100644 index 00000000000..3718dbbee48 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js @@ -0,0 +1,63 @@ +// 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, updateMask) { + // [START memcache_v1_generated_CloudMemcache_UpdateParameters_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the Memcached instance for which the parameters should be + * updated. + */ + // const name = 'abc123' + /** + * Required. Mask of fields to update. + */ + // const updateMask = {} + /** + * The parameters to apply to the instance. + */ + // const parameters = {} + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callUpdateParameters() { + // Construct request + const request = { + name, + updateMask, + }; + + // Run request + const [operation] = await memcacheClient.updateParameters(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateParameters(); + // [END memcache_v1_generated_CloudMemcache_UpdateParameters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js new file mode 100644 index 00000000000..614e8f93ae5 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.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(name) { + // [START memcache_v1beta2_generated_CloudMemcache_ApplyParameters_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the Memcached instance for which parameter group updates + * should be applied. + */ + // const name = 'abc123' + /** + * Nodes to which the instance-level parameter group is applied. + */ + // const nodeIds = 'abc123' + /** + * Whether to apply instance-level parameter group to all nodes. If set to + * true, users are restricted from specifying individual nodes, and + * `ApplyParameters` updates all nodes within the instance. + */ + // const applyAll = true + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callApplyParameters() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await memcacheClient.applyParameters(request); + const [response] = await operation.promise(); + console.log(response); + } + + callApplyParameters(); + // [END memcache_v1beta2_generated_CloudMemcache_ApplyParameters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js new file mode 100644 index 00000000000..8b78adc6ed2 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.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(instance) { + // [START memcache_v1beta2_generated_CloudMemcache_ApplySoftwareUpdate_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the Memcached instance for which software update should be + * applied. + */ + // const instance = 'abc123' + /** + * Nodes to which we should apply the update to. Note all the selected nodes + * are updated in parallel. + */ + // const nodeIds = 'abc123' + /** + * Whether to apply the update to all nodes. If set to + * true, will explicitly restrict users from specifying any nodes, and apply + * software update to all nodes (where applicable) within the instance. + */ + // const applyAll = true + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callApplySoftwareUpdate() { + // Construct request + const request = { + instance, + }; + + // Run request + const [operation] = await memcacheClient.applySoftwareUpdate(request); + const [response] = await operation.promise(); + console.log(response); + } + + callApplySoftwareUpdate(); + // [END memcache_v1beta2_generated_CloudMemcache_ApplySoftwareUpdate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js new file mode 100644 index 00000000000..9f1b2249837 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js @@ -0,0 +1,72 @@ +// 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, resource) { + // [START memcache_v1beta2_generated_CloudMemcache_CreateInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + */ + // const parent = 'abc123' + /** + * Required. The logical name of the Memcached instance in the user + * project with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-40 characters. + * * Must end with a number or a letter. + * * Must be unique within the user project / location. + * If any of the above are not met, the API raises an invalid argument error. + */ + // const instanceId = 'abc123' + /** + * Required. A Memcached Instance resource + */ + // const resource = {} + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callCreateInstance() { + // Construct request + const request = { + parent, + instanceId, + resource, + }; + + // Run request + const [operation] = await memcacheClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInstance(); + // [END memcache_v1beta2_generated_CloudMemcache_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js new file mode 100644 index 00000000000..521ba672d48 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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 memcache_v1beta2_generated_CloudMemcache_DeleteInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + */ + // const name = 'abc123' + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callDeleteInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await memcacheClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInstance(); + // [END memcache_v1beta2_generated_CloudMemcache_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js new file mode 100644 index 00000000000..0dd966a3052 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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 memcache_v1beta2_generated_CloudMemcache_GetInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + */ + // const name = 'abc123' + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callGetInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await memcacheClient.getInstance(request); + console.log(response); + } + + callGetInstance(); + // [END memcache_v1beta2_generated_CloudMemcache_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js new file mode 100644 index 00000000000..b4318185471 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js @@ -0,0 +1,78 @@ +// 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 memcache_v1beta2_generated_CloudMemcache_ListInstances_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the `page_size` value, the response may include a partial + * list and a caller should only rely on response's + * `next_page_token` google.cloud.memcache.v1beta2.ListInstancesResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * The `next_page_token` value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + /** + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying `"name != my-instance"`. + */ + // const filter = 'abc123' + /** + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + */ + // const orderBy = 'abc123' + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callListInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await memcacheClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInstances(); + // [END memcache_v1beta2_generated_CloudMemcache_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js new file mode 100644 index 00000000000..3acaccae955 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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(updateMask, resource) { + // [START memcache_v1beta2_generated_CloudMemcache_UpdateInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Mask of fields to update. + * * `displayName` + */ + // const updateMask = {} + /** + * Required. A Memcached Instance resource. + * Only fields specified in update_mask are updated. + */ + // const resource = {} + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callUpdateInstance() { + // Construct request + const request = { + updateMask, + resource, + }; + + // Run request + const [operation] = await memcacheClient.updateInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateInstance(); + // [END memcache_v1beta2_generated_CloudMemcache_UpdateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js new file mode 100644 index 00000000000..cff9b7de0d0 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js @@ -0,0 +1,63 @@ +// 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, updateMask) { + // [START memcache_v1beta2_generated_CloudMemcache_UpdateParameters_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the Memcached instance for which the parameters should be + * updated. + */ + // const name = 'abc123' + /** + * Required. Mask of fields to update. + */ + // const updateMask = {} + /** + * The parameters to apply to the instance. + */ + // const parameters = {} + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callUpdateParameters() { + // Construct request + const request = { + name, + updateMask, + }; + + // Run request + const [operation] = await memcacheClient.updateParameters(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateParameters(); + // [END memcache_v1beta2_generated_CloudMemcache_UpdateParameters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index c4ee1374a21..92d70f442d5 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=8" + "node": ">=10" }, "files": [ "*.js" diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts index 703e98353c5..8915c0f78c7 100644 --- a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts @@ -412,6 +412,25 @@ export class CloudMemcacheClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Gets details of a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.memcache.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_memcache.get_instance.js + * region_tag:memcache_v1_generated_CloudMemcache_GetInstance_async + */ getInstance( request?: protos.google.cloud.memcache.v1.IGetInstanceRequest, options?: CallOptions @@ -439,25 +458,6 @@ export class CloudMemcacheClient { {} | null | undefined > ): void; - /** - * Gets details of a single Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Memcached instance resource name in the format: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.memcache.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.memcache.v1.IGetInstanceRequest, optionsOrCallback?: @@ -500,6 +500,40 @@ export class CloudMemcacheClient { return this.innerApiCalls.getInstance(request, options, callback); } + /** + * Creates a new Instance in a given location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {string} request.instanceId + * Required. The logical name of the Memcached instance in the user + * project with the following restrictions: + * + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-40 characters. + * * Must end with a number or a letter. + * * Must be unique within the user project / location + * + * If any of the above are not met, will raise an invalid argument error. + * @param {google.cloud.memcache.v1.Instance} request.instance + * Required. A Memcached Instance + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_memcache.create_instance.js + * region_tag:memcache_v1_generated_CloudMemcache_CreateInstance_async + */ createInstance( request?: protos.google.cloud.memcache.v1.ICreateInstanceRequest, options?: CallOptions @@ -536,41 +570,6 @@ export class CloudMemcacheClient { {} | null | undefined > ): void; - /** - * Creates a new Instance in a given location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the instance location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region - * @param {string} request.instanceId - * Required. The logical name of the Memcached instance in the user - * project with the following restrictions: - * - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-40 characters. - * * Must end with a number or a letter. - * * Must be unique within the user project / location - * - * If any of the above are not met, will raise an invalid argument error. - * @param {google.cloud.memcache.v1.Instance} request.instance - * Required. A Memcached Instance - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.createInstance(request); - * const [response] = await operation.promise(); - */ createInstance( request?: protos.google.cloud.memcache.v1.ICreateInstanceRequest, optionsOrCallback?: @@ -628,11 +627,8 @@ export class CloudMemcacheClient { * 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_memcache.create_instance.js + * region_tag:memcache_v1_generated_CloudMemcache_CreateInstance_async */ async checkCreateInstanceProgress( name: string @@ -656,6 +652,29 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1.OperationMetadata >; } + /** + * Updates an existing Instance in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * * `displayName` + * @param {google.cloud.memcache.v1.Instance} request.instance + * Required. A Memcached 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_memcache.update_instance.js + * region_tag:memcache_v1_generated_CloudMemcache_UpdateInstance_async + */ updateInstance( request?: protos.google.cloud.memcache.v1.IUpdateInstanceRequest, options?: CallOptions @@ -692,30 +711,6 @@ export class CloudMemcacheClient { {} | null | undefined > ): void; - /** - * Updates an existing Instance in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Mask of fields to update. - * * `displayName` - * @param {google.cloud.memcache.v1.Instance} request.instance - * Required. A Memcached 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.memcache.v1.IUpdateInstanceRequest, optionsOrCallback?: @@ -773,11 +768,8 @@ export class CloudMemcacheClient { * 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_memcache.update_instance.js + * region_tag:memcache_v1_generated_CloudMemcache_UpdateInstance_async */ async checkUpdateInstanceProgress( name: string @@ -801,6 +793,32 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1.OperationMetadata >; } + /** + * Updates the defined Memcached Parameters for an existing Instance. + * This method only stages the parameters, it must be followed by + * ApplyParameters to apply the parameters to nodes of the Memcached Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the Memcached instance for which the parameters should be + * updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * @param {google.cloud.memcache.v1.MemcacheParameters} request.parameters + * The parameters to apply to the instance. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_memcache.update_parameters.js + * region_tag:memcache_v1_generated_CloudMemcache_UpdateParameters_async + */ updateParameters( request?: protos.google.cloud.memcache.v1.IUpdateParametersRequest, options?: CallOptions @@ -837,33 +855,6 @@ export class CloudMemcacheClient { {} | null | undefined > ): void; - /** - * Updates the defined Memcached Parameters for an existing Instance. - * This method only stages the parameters, it must be followed by - * ApplyParameters to apply the parameters to nodes of the Memcached Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the Memcached instance for which the parameters should be - * updated. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Mask of fields to update. - * @param {google.cloud.memcache.v1.MemcacheParameters} request.parameters - * The parameters to apply to the instance. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.updateParameters(request); - * const [response] = await operation.promise(); - */ updateParameters( request?: protos.google.cloud.memcache.v1.IUpdateParametersRequest, optionsOrCallback?: @@ -921,11 +912,8 @@ export class CloudMemcacheClient { * 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 checkUpdateParametersProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/cloud_memcache.update_parameters.js + * region_tag:memcache_v1_generated_CloudMemcache_UpdateParameters_async */ async checkUpdateParametersProgress( name: string @@ -949,6 +937,27 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1.OperationMetadata >; } + /** + * Deletes a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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_memcache.delete_instance.js + * region_tag:memcache_v1_generated_CloudMemcache_DeleteInstance_async + */ deleteInstance( request?: protos.google.cloud.memcache.v1.IDeleteInstanceRequest, options?: CallOptions @@ -985,28 +994,6 @@ export class CloudMemcacheClient { {} | null | undefined > ): void; - /** - * Deletes a single Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Memcached instance resource name in the format: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.memcache.v1.IDeleteInstanceRequest, optionsOrCallback?: @@ -1064,11 +1051,8 @@ export class CloudMemcacheClient { * 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_memcache.delete_instance.js + * region_tag:memcache_v1_generated_CloudMemcache_DeleteInstance_async */ async checkDeleteInstanceProgress( name: string @@ -1092,6 +1076,33 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1.OperationMetadata >; } + /** + * ApplyParameters will restart the set of specified nodes in order to update + * them to the current set of parameters for the Memcached Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the Memcached instance for which parameter group updates + * should be applied. + * @param {string[]} request.nodeIds + * Nodes to which we should apply the instance-level parameter group. + * @param {boolean} request.applyAll + * Whether to apply instance-level parameter group to all nodes. If set to + * true, will explicitly restrict users from specifying any nodes, and apply + * parameter group updates to all nodes within the instance. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_memcache.apply_parameters.js + * region_tag:memcache_v1_generated_CloudMemcache_ApplyParameters_async + */ applyParameters( request?: protos.google.cloud.memcache.v1.IApplyParametersRequest, options?: CallOptions @@ -1128,34 +1139,6 @@ export class CloudMemcacheClient { {} | null | undefined > ): void; - /** - * ApplyParameters will restart the set of specified nodes in order to update - * them to the current set of parameters for the Memcached Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the Memcached instance for which parameter group updates - * should be applied. - * @param {string[]} request.nodeIds - * Nodes to which we should apply the instance-level parameter group. - * @param {boolean} request.applyAll - * Whether to apply instance-level parameter group to all nodes. If set to - * true, will explicitly restrict users from specifying any nodes, and apply - * parameter group updates to all nodes within the instance. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.applyParameters(request); - * const [response] = await operation.promise(); - */ applyParameters( request?: protos.google.cloud.memcache.v1.IApplyParametersRequest, optionsOrCallback?: @@ -1213,11 +1196,8 @@ export class CloudMemcacheClient { * 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 checkApplyParametersProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/cloud_memcache.apply_parameters.js + * region_tag:memcache_v1_generated_CloudMemcache_ApplyParameters_async */ async checkApplyParametersProgress( name: string @@ -1241,33 +1221,6 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1.OperationMetadata >; } - listInstances( - request?: protos.google.cloud.memcache.v1.IListInstancesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.memcache.v1.IInstance[], - protos.google.cloud.memcache.v1.IListInstancesRequest | null, - protos.google.cloud.memcache.v1.IListInstancesResponse - ] - >; - listInstances( - request: protos.google.cloud.memcache.v1.IListInstancesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.memcache.v1.IListInstancesRequest, - protos.google.cloud.memcache.v1.IListInstancesResponse | null | undefined, - protos.google.cloud.memcache.v1.IInstance - > - ): void; - listInstances( - request: protos.google.cloud.memcache.v1.IListInstancesRequest, - callback: PaginationCallback< - protos.google.cloud.memcache.v1.IListInstancesRequest, - protos.google.cloud.memcache.v1.IListInstancesResponse | null | undefined, - protos.google.cloud.memcache.v1.IInstance - > - ): void; /** * Lists Instances in a given location. * @@ -1306,6 +1259,33 @@ export class CloudMemcacheClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listInstances( + request?: protos.google.cloud.memcache.v1.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.memcache.v1.IInstance[], + protos.google.cloud.memcache.v1.IListInstancesRequest | null, + protos.google.cloud.memcache.v1.IListInstancesResponse + ] + >; + listInstances( + request: protos.google.cloud.memcache.v1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.memcache.v1.IListInstancesRequest, + protos.google.cloud.memcache.v1.IListInstancesResponse | null | undefined, + protos.google.cloud.memcache.v1.IInstance + > + ): void; + listInstances( + request: protos.google.cloud.memcache.v1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.memcache.v1.IListInstancesRequest, + protos.google.cloud.memcache.v1.IListInstancesResponse | null | undefined, + protos.google.cloud.memcache.v1.IInstance + > + ): void; listInstances( request?: protos.google.cloud.memcache.v1.IListInstancesRequest, optionsOrCallback?: @@ -1396,7 +1376,8 @@ export class CloudMemcacheClient { 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, @@ -1441,11 +1422,8 @@ export class CloudMemcacheClient { * 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_memcache.list_instances.js + * region_tag:memcache_v1_generated_CloudMemcache_ListInstances_async */ listInstancesAsync( request?: protos.google.cloud.memcache.v1.IListInstancesRequest, @@ -1459,8 +1437,8 @@ export class CloudMemcacheClient { gax.routingHeader.fromParams({ 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, diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index 1d1a7c0af8c..3af9253b6ff 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -424,6 +424,25 @@ export class CloudMemcacheClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Gets details of a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.memcache.v1beta2.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/v1beta2/cloud_memcache.get_instance.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_GetInstance_async + */ getInstance( request?: protos.google.cloud.memcache.v1beta2.IGetInstanceRequest, options?: CallOptions @@ -455,25 +474,6 @@ export class CloudMemcacheClient { {} | null | undefined > ): void; - /** - * Gets details of a single Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Memcached instance resource name in the format: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.memcache.v1beta2.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.memcache.v1beta2.IGetInstanceRequest, optionsOrCallback?: @@ -518,6 +518,40 @@ export class CloudMemcacheClient { return this.innerApiCalls.getInstance(request, options, callback); } + /** + * Creates a new Instance in a given location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {string} request.instanceId + * Required. The logical name of the Memcached instance in the user + * project with the following restrictions: + * + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-40 characters. + * * Must end with a number or a letter. + * * Must be unique within the user project / location. + * + * If any of the above are not met, the API raises an invalid argument error. + * @param {google.cloud.memcache.v1beta2.Instance} request.resource + * Required. A Memcached [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/v1beta2/cloud_memcache.create_instance.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_CreateInstance_async + */ createInstance( request?: protos.google.cloud.memcache.v1beta2.ICreateInstanceRequest, options?: CallOptions @@ -554,41 +588,6 @@ export class CloudMemcacheClient { {} | null | undefined > ): void; - /** - * Creates a new Instance in a given location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the instance location using the form: - * `projects/{project_id}/locations/{location_id}` - * where `location_id` refers to a GCP region - * @param {string} request.instanceId - * Required. The logical name of the Memcached instance in the user - * project with the following restrictions: - * - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-40 characters. - * * Must end with a number or a letter. - * * Must be unique within the user project / location. - * - * If any of the above are not met, the API raises an invalid argument error. - * @param {google.cloud.memcache.v1beta2.Instance} request.resource - * Required. A Memcached [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.memcache.v1beta2.ICreateInstanceRequest, optionsOrCallback?: @@ -646,11 +645,8 @@ export class CloudMemcacheClient { * 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/v1beta2/cloud_memcache.create_instance.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_CreateInstance_async */ async checkCreateInstanceProgress( name: string @@ -674,6 +670,29 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1beta2.OperationMetadata >; } + /** + * Updates an existing Instance in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * * `displayName` + * @param {google.cloud.memcache.v1beta2.Instance} request.resource + * Required. A Memcached [Instance] resource. + * 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/v1beta2/cloud_memcache.update_instance.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_UpdateInstance_async + */ updateInstance( request?: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, options?: CallOptions @@ -710,30 +729,6 @@ export class CloudMemcacheClient { {} | null | undefined > ): void; - /** - * Updates an existing Instance in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Mask of fields to update. - * * `displayName` - * @param {google.cloud.memcache.v1beta2.Instance} request.resource - * Required. A Memcached [Instance] resource. - * 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.memcache.v1beta2.IUpdateInstanceRequest, optionsOrCallback?: @@ -791,11 +786,8 @@ export class CloudMemcacheClient { * 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/v1beta2/cloud_memcache.update_instance.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_UpdateInstance_async */ async checkUpdateInstanceProgress( name: string @@ -819,6 +811,33 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1beta2.OperationMetadata >; } + /** + * Updates the defined Memcached parameters for an existing instance. + * This method only stages the parameters, it must be followed by + * `ApplyParameters` to apply the parameters to nodes of the Memcached + * instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the Memcached instance for which the parameters should be + * updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * @param {google.cloud.memcache.v1beta2.MemcacheParameters} request.parameters + * The parameters to apply to the instance. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.update_parameters.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_UpdateParameters_async + */ updateParameters( request?: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, options?: CallOptions @@ -855,34 +874,6 @@ export class CloudMemcacheClient { {} | null | undefined > ): void; - /** - * Updates the defined Memcached parameters for an existing instance. - * This method only stages the parameters, it must be followed by - * `ApplyParameters` to apply the parameters to nodes of the Memcached - * instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the Memcached instance for which the parameters should be - * updated. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Mask of fields to update. - * @param {google.cloud.memcache.v1beta2.MemcacheParameters} request.parameters - * The parameters to apply to the instance. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.updateParameters(request); - * const [response] = await operation.promise(); - */ updateParameters( request?: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, optionsOrCallback?: @@ -940,11 +931,8 @@ export class CloudMemcacheClient { * 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 checkUpdateParametersProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta2/cloud_memcache.update_parameters.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_UpdateParameters_async */ async checkUpdateParametersProgress( name: string @@ -968,6 +956,27 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1beta2.OperationMetadata >; } + /** + * Deletes a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1beta2/cloud_memcache.delete_instance.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_DeleteInstance_async + */ deleteInstance( request?: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, options?: CallOptions @@ -1004,28 +1013,6 @@ export class CloudMemcacheClient { {} | null | undefined > ): void; - /** - * Deletes a single Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Memcached instance resource name in the format: - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - * where `location_id` refers to a GCP region - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.memcache.v1beta2.IDeleteInstanceRequest, optionsOrCallback?: @@ -1083,11 +1070,8 @@ export class CloudMemcacheClient { * 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/v1beta2/cloud_memcache.delete_instance.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_DeleteInstance_async */ async checkDeleteInstanceProgress( name: string @@ -1111,6 +1095,33 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1beta2.OperationMetadata >; } + /** + * `ApplyParameters` restarts the set of specified nodes in order to update + * them to the current set of parameters for the Memcached Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the Memcached instance for which parameter group updates + * should be applied. + * @param {string[]} request.nodeIds + * Nodes to which the instance-level parameter group is applied. + * @param {boolean} request.applyAll + * Whether to apply instance-level parameter group to all nodes. If set to + * true, users are restricted from specifying individual nodes, and + * `ApplyParameters` updates all nodes within the instance. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.apply_parameters.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_ApplyParameters_async + */ applyParameters( request?: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, options?: CallOptions @@ -1147,34 +1158,6 @@ export class CloudMemcacheClient { {} | null | undefined > ): void; - /** - * `ApplyParameters` restarts the set of specified nodes in order to update - * them to the current set of parameters for the Memcached Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the Memcached instance for which parameter group updates - * should be applied. - * @param {string[]} request.nodeIds - * Nodes to which the instance-level parameter group is applied. - * @param {boolean} request.applyAll - * Whether to apply instance-level parameter group to all nodes. If set to - * true, users are restricted from specifying individual nodes, and - * `ApplyParameters` updates all nodes within the instance. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.applyParameters(request); - * const [response] = await operation.promise(); - */ applyParameters( request?: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, optionsOrCallback?: @@ -1232,11 +1215,8 @@ export class CloudMemcacheClient { * 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 checkApplyParametersProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta2/cloud_memcache.apply_parameters.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_ApplyParameters_async */ async checkApplyParametersProgress( name: string @@ -1260,6 +1240,33 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1beta2.OperationMetadata >; } + /** + * Updates software on the selected nodes of the Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Required. Resource name of the Memcached instance for which software update should be + * applied. + * @param {string[]} request.nodeIds + * Nodes to which we should apply the update to. Note all the selected nodes + * are updated in parallel. + * @param {boolean} request.applyAll + * Whether to apply the update to all nodes. If set to + * true, will explicitly restrict users from specifying any nodes, and apply + * software update to all nodes (where applicable) within the instance. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.apply_software_update.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_ApplySoftwareUpdate_async + */ applySoftwareUpdate( request?: protos.google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, options?: CallOptions @@ -1296,34 +1303,6 @@ export class CloudMemcacheClient { {} | null | undefined > ): void; - /** - * Updates software on the selected nodes of the Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.instance - * Required. Resource name of the Memcached instance for which software update should be - * applied. - * @param {string[]} request.nodeIds - * Nodes to which we should apply the update to. Note all the selected nodes - * are updated in parallel. - * @param {boolean} request.applyAll - * Whether to apply the update to all nodes. If set to - * true, will explicitly restrict users from specifying any nodes, and apply - * software update to all nodes (where applicable) within the instance. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.applySoftwareUpdate(request); - * const [response] = await operation.promise(); - */ applySoftwareUpdate( request?: protos.google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, optionsOrCallback?: @@ -1381,11 +1360,8 @@ export class CloudMemcacheClient { * 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 checkApplySoftwareUpdateProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta2/cloud_memcache.apply_software_update.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_ApplySoftwareUpdate_async */ async checkApplySoftwareUpdateProgress( name: string @@ -1409,37 +1385,6 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1beta2.OperationMetadata >; } - listInstances( - request?: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.memcache.v1beta2.IInstance[], - protos.google.cloud.memcache.v1beta2.IListInstancesRequest | null, - protos.google.cloud.memcache.v1beta2.IListInstancesResponse - ] - >; - listInstances( - request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.memcache.v1beta2.IListInstancesRequest, - | protos.google.cloud.memcache.v1beta2.IListInstancesResponse - | null - | undefined, - protos.google.cloud.memcache.v1beta2.IInstance - > - ): void; - listInstances( - request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, - callback: PaginationCallback< - protos.google.cloud.memcache.v1beta2.IListInstancesRequest, - | protos.google.cloud.memcache.v1beta2.IListInstancesResponse - | null - | undefined, - protos.google.cloud.memcache.v1beta2.IInstance - > - ): void; /** * Lists Instances in a given location. * @@ -1477,6 +1422,37 @@ export class CloudMemcacheClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listInstances( + request?: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.memcache.v1beta2.IInstance[], + protos.google.cloud.memcache.v1beta2.IListInstancesRequest | null, + protos.google.cloud.memcache.v1beta2.IListInstancesResponse + ] + >; + listInstances( + request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + | protos.google.cloud.memcache.v1beta2.IListInstancesResponse + | null + | undefined, + protos.google.cloud.memcache.v1beta2.IInstance + > + ): void; + listInstances( + request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + | protos.google.cloud.memcache.v1beta2.IListInstancesResponse + | null + | undefined, + protos.google.cloud.memcache.v1beta2.IInstance + > + ): void; listInstances( request?: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, optionsOrCallback?: @@ -1568,7 +1544,8 @@ export class CloudMemcacheClient { 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, @@ -1612,11 +1589,8 @@ export class CloudMemcacheClient { * 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/v1beta2/cloud_memcache.list_instances.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_ListInstances_async */ listInstancesAsync( request?: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, @@ -1630,8 +1604,8 @@ export class CloudMemcacheClient { gax.routingHeader.fromParams({ 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, From 70696aedbda7cecac6b62f3d35b3bed38feb4601 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 9 Dec 2021 23:06:13 +0000 Subject: [PATCH 110/152] build: add generated samples to .eslintignore (#163) --- packages/google-cloud-memcache/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-memcache/.eslintignore b/packages/google-cloud-memcache/.eslintignore index 9340ad9b86d..ea5b04aebe6 100644 --- a/packages/google-cloud-memcache/.eslintignore +++ b/packages/google-cloud-memcache/.eslintignore @@ -4,3 +4,4 @@ test/fixtures build/ docs/ protos/ +samples/generated/ From 5ccf9ad621247c64dd711dfa26e2442372d22f6f 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 19:50:16 +0000 Subject: [PATCH 111/152] docs(node): support "stable"/"preview" release level (#1312) (#166) --- packages/google-cloud-memcache/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md index a21b74cee21..596d7f6607b 100644 --- a/packages/google-cloud-memcache/README.md +++ b/packages/google-cloud-memcache/README.md @@ -119,6 +119,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 f94b24ad5f59619fcfdde9556bd3099940ea0636 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 23:12:33 +0000 Subject: [PATCH 112/152] docs(badges): tweak badge to use new preview/stable language (#1314) (#167) --- packages/google-cloud-memcache/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md index 596d7f6607b..1c21a4a143a 100644 --- a/packages/google-cloud-memcache/README.md +++ b/packages/google-cloud-memcache/README.md @@ -6,7 +6,6 @@ [![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/memcache.svg)](https://www.npmjs.org/package/@google-cloud/memcache) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-memcache/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-memcache) From f77025a91c9809834802a1b7f8d7895e1a4baa0c 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:14:11 +0000 Subject: [PATCH 113/152] test(nodejs): remove 15 add 16 (#1322) (#169) --- packages/google-cloud-memcache/protos/protos.d.ts | 2 +- packages/google-cloud-memcache/protos/protos.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/protos/protos.d.ts b/packages/google-cloud-memcache/protos/protos.d.ts index f81a7f50d6a..e2c6a8862bb 100644 --- a/packages/google-cloud-memcache/protos/protos.d.ts +++ b/packages/google-cloud-memcache/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-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index 7ef396c657d..39bc7154253 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/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 c3eea36c21a658930aa2c3b71cc2475c698739d2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 31 Jan 2022 23:34:32 +0100 Subject: [PATCH 114/152] chore(deps): update dependency sinon to v13 (#176) 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)) | [`^12.0.0` -> `^13.0.0`](https://renovatebot.com/diffs/npm/sinon/12.0.1/13.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/compatibility-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/confidence-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v13.0.0`](https://togithub.com/sinonjs/sinon/blob/HEAD/CHANGES.md#​1300) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v12.0.1...v13.0.0) - [`cf3d6c0c`](https://togithub.com/sinonjs/sinon/commit/cf3d6c0cd9689c0ee673b3daa8bf9abd70304392) Upgrade packages ([#​2431](https://togithub.com/sinonjs/sinon/issues/2431)) (Carl-Erik Kopseng) > - Update all @​sinonjs/ packages > > - Upgrade to fake-timers 9 > > - chore: ensure always using latest LTS release - [`41710467`](https://togithub.com/sinonjs/sinon/commit/417104670d575e96a1b645ea40ce763afa76fb1b) Adjust deploy scripts to archive old releases in a separate branch, move existing releases out of master ([#​2426](https://togithub.com/sinonjs/sinon/issues/2426)) (Joel Bradshaw) > Co-authored-by: Carl-Erik Kopseng - [`c80a7266`](https://togithub.com/sinonjs/sinon/commit/c80a72660e89d88b08275eff1028ecb9e26fd8e9) Bump node-fetch from 2.6.1 to 2.6.7 ([#​2430](https://togithub.com/sinonjs/sinon/issues/2430)) (dependabot\[bot]) > Co-authored-by: dependabot\[bot] <49699333+dependabot\[bot][@​users](https://togithub.com/users).noreply.github.com> - [`a00f14a9`](https://togithub.com/sinonjs/sinon/commit/a00f14a97dbe8c65afa89674e16ad73fc7d2fdc0) Add explicit export for `./*` ([#​2413](https://togithub.com/sinonjs/sinon/issues/2413)) (なつき) - [`b82ca7ad`](https://togithub.com/sinonjs/sinon/commit/b82ca7ad9b1add59007771f65a18ee34415de8ca) Bump cached-path-relative from 1.0.2 to 1.1.0 ([#​2428](https://togithub.com/sinonjs/sinon/issues/2428)) (dependabot\[bot]) - [`a9ea1427`](https://togithub.com/sinonjs/sinon/commit/a9ea142716c094ef3c432ecc4089f8207b8dd8b6) Add documentation for assert.calledOnceWithMatch ([#​2424](https://togithub.com/sinonjs/sinon/issues/2424)) (Mathias Schreck) - [`1d5ab86b`](https://togithub.com/sinonjs/sinon/commit/1d5ab86ba60e50dd69593ffed2bffd4b8faa0d38) Be more general in stripping off stack frames to fix Firefox tests ([#​2425](https://togithub.com/sinonjs/sinon/issues/2425)) (Joel Bradshaw) - [`56b06129`](https://togithub.com/sinonjs/sinon/commit/56b06129e223eae690265c37b1113067e2b31bdc) Check call count type ([#​2410](https://togithub.com/sinonjs/sinon/issues/2410)) (Joel Bradshaw) - [`7863e2df`](https://togithub.com/sinonjs/sinon/commit/7863e2dfdbda79e0a32e42af09e6539fc2f2b80f) Fix [#​2414](https://togithub.com/sinonjs/sinon/issues/2414): make Sinon available on homepage (Carl-Erik Kopseng) - [`fabaabdd`](https://togithub.com/sinonjs/sinon/commit/fabaabdda82f39a7f5b75b55bd56cf77b1cd4a8f) Bump nokogiri from 1.11.4 to 1.13.1 ([#​2423](https://togithub.com/sinonjs/sinon/issues/2423)) (dependabot\[bot]) - [`dbc0fbd2`](https://togithub.com/sinonjs/sinon/commit/dbc0fbd263c8419fa47f9c3b20cf47890a242d21) Bump shelljs from 0.8.4 to 0.8.5 ([#​2422](https://togithub.com/sinonjs/sinon/issues/2422)) (dependabot\[bot]) - [`fb8b3d72`](https://togithub.com/sinonjs/sinon/commit/fb8b3d72a85dc8fb0547f859baf3f03a22a039f7) Run Prettier (Carl-Erik Kopseng) - [`12a45939`](https://togithub.com/sinonjs/sinon/commit/12a45939e9b047b6d3663fe55f2eb383ec63c4e1) Fix 2377: Throw error when trying to stub non-configurable or non-writable properties ([#​2417](https://togithub.com/sinonjs/sinon/issues/2417)) (Stuart Dotson) > Fixes issue [#​2377](https://togithub.com/sinonjs/sinon/issues/2377) by throwing an error when trying to stub non-configurable or non-writable properties *Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2022-01-28.*
--- ### 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-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 61d1b7ec24f..ab6c382446d 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -42,7 +42,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^12.0.0", + "sinon": "^13.0.0", "ts-loader": "^9.0.0", "typescript": "~3.8.3", "webpack": "^5.0.0", From 423756849f8d25d0dc828e5616d787ae284a5bb7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 31 Jan 2022 23:33:04 +0000 Subject: [PATCH 115/152] build: update copyright year to 2022 (#172) 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 --- packages/google-cloud-memcache/.jsdoc.js | 4 ++-- .../samples/generated/v1/cloud_memcache.apply_parameters.js | 1 + .../samples/generated/v1/cloud_memcache.create_instance.js | 1 + .../samples/generated/v1/cloud_memcache.delete_instance.js | 1 + .../samples/generated/v1/cloud_memcache.get_instance.js | 1 + .../samples/generated/v1/cloud_memcache.list_instances.js | 5 +++-- .../samples/generated/v1/cloud_memcache.update_instance.js | 1 + .../samples/generated/v1/cloud_memcache.update_parameters.js | 1 + .../generated/v1beta2/cloud_memcache.apply_parameters.js | 1 + .../v1beta2/cloud_memcache.apply_software_update.js | 1 + .../generated/v1beta2/cloud_memcache.create_instance.js | 1 + .../generated/v1beta2/cloud_memcache.delete_instance.js | 1 + .../samples/generated/v1beta2/cloud_memcache.get_instance.js | 1 + .../generated/v1beta2/cloud_memcache.list_instances.js | 5 +++-- .../generated/v1beta2/cloud_memcache.update_instance.js | 1 + .../generated/v1beta2/cloud_memcache.update_parameters.js | 1 + .../google-cloud-memcache/src/v1/cloud_memcache_client.ts | 2 +- packages/google-cloud-memcache/src/v1/index.ts | 2 +- .../src/v1beta2/cloud_memcache_client.ts | 2 +- packages/google-cloud-memcache/src/v1beta2/index.ts | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- packages/google-cloud-memcache/system-test/install.ts | 2 +- .../google-cloud-memcache/test/gapic_cloud_memcache_v1.ts | 2 +- .../test/gapic_cloud_memcache_v1beta2.ts | 2 +- 25 files changed, 30 insertions(+), 15 deletions(-) diff --git a/packages/google-cloud-memcache/.jsdoc.js b/packages/google-cloud-memcache/.jsdoc.js index a17e386df11..27a3802542f 100644 --- a/packages/google-cloud-memcache/.jsdoc.js +++ b/packages/google-cloud-memcache/.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/memcache', diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js index 149f6c3a480..9c8a97f953f 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.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-memcache/samples/generated/v1/cloud_memcache.create_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js index fbfc07d5386..5a7279cdfa6 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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) { diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js index 3adb5cd5e51..34467067eac 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.get_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js index b790ca11cc2..5a2cd85679b 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.list_instances.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js index a41bb41f3d7..19aeadaa82a 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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) { @@ -30,7 +31,7 @@ function main(parent) { * If not specified, a default value of 1000 will be used by the service. * Regardless of the page_size value, the response may include a partial list * and a caller should only rely on response's - * next_page_token CloudMemcache.ListInstancesResponse.next_page_token + * next_page_token CloudMemcache.ListInstancesResponse.next_page_token * to determine if there are more instances left to be queried. */ // const pageSize = 1234 @@ -64,7 +65,7 @@ function main(parent) { // Run request const iterable = await memcacheClient.listInstancesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js index 8f0489639f6..814358d09d6 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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) { diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js index 3718dbbee48..6b9ac8b299b 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name, updateMask) { diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js index 614e8f93ae5..d862a2a61c1 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.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-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js index 8b78adc6ed2..63920665ce9 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(instance) { diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js index 9f1b2249837..13259abc5b0 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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, resource) { diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js index 521ba672d48..1bae7f1461e 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js index 0dd966a3052..9eff35e454f 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js index b4318185471..f4e34012d23 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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) { @@ -30,7 +31,7 @@ function main(parent) { * If not specified, a default value of 1000 will be used by the service. * Regardless of the `page_size` value, the response may include a partial * list and a caller should only rely on response's - * `next_page_token` google.cloud.memcache.v1beta2.ListInstancesResponse.next_page_token + * `next_page_token` google.cloud.memcache.v1beta2.ListInstancesResponse.next_page_token * to determine if there are more instances left to be queried. */ // const pageSize = 1234 @@ -63,7 +64,7 @@ function main(parent) { // Run request const iterable = await memcacheClient.listInstancesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js index 3acaccae955..8dd6723e0e0 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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, resource) { diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js index cff9b7de0d0..566d37530ff 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name, updateMask) { diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts index 8915c0f78c7..db22edd69db 100644 --- a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_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-memcache/src/v1/index.ts b/packages/google-cloud-memcache/src/v1/index.ts index 369d196c3a1..86a77cf1cfe 100644 --- a/packages/google-cloud-memcache/src/v1/index.ts +++ b/packages/google-cloud-memcache/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-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index 3af9253b6ff..0c8146d6ad7 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_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-memcache/src/v1beta2/index.ts b/packages/google-cloud-memcache/src/v1beta2/index.ts index 369d196c3a1..86a77cf1cfe 100644 --- a/packages/google-cloud-memcache/src/v1beta2/index.ts +++ b/packages/google-cloud-memcache/src/v1beta2/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-memcache/system-test/fixtures/sample/src/index.js b/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.js index f438f083f50..33fe980a26b 100644 --- a/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-memcache/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-memcache/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts index b1a36b7591b..4c9dab2db99 100644 --- a/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-memcache/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-memcache/system-test/install.ts b/packages/google-cloud-memcache/system-test/install.ts index d2d61c0396f..6dd1eaadafa 100644 --- a/packages/google-cloud-memcache/system-test/install.ts +++ b/packages/google-cloud-memcache/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-memcache/test/gapic_cloud_memcache_v1.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts index 07f107d71a4..ef629677692 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_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-memcache/test/gapic_cloud_memcache_v1beta2.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts index e2fda9c8a13..1a4a907b8d7 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.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 a56a523ae5567a9edadcd626fca6f8edd017a3e8 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:47 +0000 Subject: [PATCH 116/152] docs(nodejs): version support policy edits (#1346) (#178) --- packages/google-cloud-memcache/README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md index 1c21a4a143a..eba7db5ddcd 100644 --- a/packages/google-cloud-memcache/README.md +++ b/packages/google-cloud-memcache/README.md @@ -87,21 +87,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/memcache@legacy-8` installs client libraries +for versions compatible with Node.js 8. ## Versioning From 2a5bba0e50f2b2150625718342c4bca959fd2b3e Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sat, 5 Feb 2022 13:14:46 -0500 Subject: [PATCH 117/152] chore: add api_shortname and library_type to repo metadata (#165) Update .repo-metadata.json as required by go/library-data-integrity --- packages/google-cloud-memcache/.repo-metadata.json | 6 ++++-- packages/google-cloud-memcache/README.md | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-memcache/.repo-metadata.json b/packages/google-cloud-memcache/.repo-metadata.json index de3f3d6f785..ec1bfcc3c0f 100644 --- a/packages/google-cloud-memcache/.repo-metadata.json +++ b/packages/google-cloud-memcache/.repo-metadata.json @@ -5,10 +5,12 @@ "repo": "googleapis/nodejs-memcache", "default_version": "v1", "name_pretty": "Memorystore for Memcached", - "release_level": "ga", + "release_level": "stable", "distribution_name": "@google-cloud/memcache", "name": "memcache", "client_documentation": "https://cloud.google.com/nodejs/docs/reference/memcache/latest", "api_id": "memcache.googleapis.com", - "issue_tracker": "https://issuetracker.google.com/savedsearches/5169231" + "issue_tracker": "https://issuetracker.google.com/savedsearches/5169231", + "api_shortname": "memcache", + "library_type": "GAPIC_AUTO" } diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md index eba7db5ddcd..e48609eac17 100644 --- a/packages/google-cloud-memcache/README.md +++ b/packages/google-cloud-memcache/README.md @@ -4,7 +4,7 @@ # [Memorystore for Memcached: Node.js Client](https://github.com/googleapis/nodejs-memcache) -[![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) +[![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/memcache.svg)](https://www.npmjs.org/package/@google-cloud/memcache) @@ -108,10 +108,10 @@ for versions compatible with Node.js 8. 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. @@ -119,7 +119,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 4efd17a241cb248dc434c1d3c66ee949b8defbb0 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:05:07 +0000 Subject: [PATCH 118/152] docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#179) - [ ] 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 --- .../linkinator.config.json | 10 +- .../v1/cloud_memcache.apply_parameters.js | 9 +- .../v1/cloud_memcache.create_instance.js | 9 +- .../v1/cloud_memcache.delete_instance.js | 9 +- .../v1/cloud_memcache.get_instance.js | 9 +- .../v1/cloud_memcache.list_instances.js | 9 +- .../v1/cloud_memcache.update_instance.js | 9 +- .../v1/cloud_memcache.update_parameters.js | 9 +- ...pet_metadata.google.cloud.memcache.v1.json | 339 +++++++++++++++ .../cloud_memcache.apply_parameters.js | 9 +- .../cloud_memcache.apply_software_update.js | 9 +- .../v1beta2/cloud_memcache.create_instance.js | 9 +- .../v1beta2/cloud_memcache.delete_instance.js | 9 +- .../v1beta2/cloud_memcache.get_instance.js | 9 +- .../v1beta2/cloud_memcache.list_instances.js | 9 +- .../v1beta2/cloud_memcache.update_instance.js | 9 +- .../cloud_memcache.update_parameters.js | 9 +- ...etadata.google.cloud.memcache.v1beta2.json | 387 ++++++++++++++++++ .../src/v1/cloud_memcache_client.ts | 5 +- .../src/v1beta2/cloud_memcache_client.ts | 5 +- .../test/gapic_cloud_memcache_v1.ts | 35 +- .../test/gapic_cloud_memcache_v1beta2.ts | 35 +- 22 files changed, 909 insertions(+), 42 deletions(-) create mode 100644 packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json create mode 100644 packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json diff --git a/packages/google-cloud-memcache/linkinator.config.json b/packages/google-cloud-memcache/linkinator.config.json index 0121dfa684f..befd23c8633 100644 --- a/packages/google-cloud-memcache/linkinator.config.json +++ b/packages/google-cloud-memcache/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-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js index 9c8a97f953f..cab63971ab5 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.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-memcache/samples/generated/v1/cloud_memcache.create_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js index 5a7279cdfa6..fd5f2aa0b27 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.delete_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js index 34467067eac..1f4c3fd63da 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.get_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js index 5a2cd85679b..c9f947b1d19 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.list_instances.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js index 19aeadaa82a..9c669cbd5a0 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.update_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js index 814358d09d6..f97a14f0ec6 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.update_parameters.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js index 6b9ac8b299b..887d8f747dd 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.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-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json new file mode 100644 index 00000000000..7cdc2338e11 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json @@ -0,0 +1,339 @@ +{ + "clientLibrary": { + "name": "nodejs-memcache", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.memcache.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "memcache_v1_generated_CloudMemcache_ListInstances_async", + "title": "CloudMemcache listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists Instances in a given location.", + "canonical": true, + "file": "cloud_memcache.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.memcache.v1.CloudMemcache.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.memcache.v1.ListInstancesResponse", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.memcache.v1.CloudMemcache.ListInstances", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1_generated_CloudMemcache_GetInstance_async", + "title": "CloudMemcache getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Instance.", + "canonical": true, + "file": "cloud_memcache.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.memcache.v1.Instance", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.GetInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1_generated_CloudMemcache_CreateInstance_async", + "title": "CloudMemcache createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Instance in a given location.", + "canonical": true, + "file": "cloud_memcache.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.memcache.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.CreateInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1_generated_CloudMemcache_UpdateInstance_async", + "title": "CloudMemcache updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing Instance in a given project and location.", + "canonical": true, + "file": "cloud_memcache.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "instance", + "type": ".google.cloud.memcache.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.UpdateInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1_generated_CloudMemcache_UpdateParameters_async", + "title": "CloudMemcache updateParameters Sample", + "origin": "API_DEFINITION", + "description": " Updates the defined Memcached Parameters for an existing Instance. This method only stages the parameters, it must be followed by ApplyParameters to apply the parameters to nodes of the Memcached Instance.", + "canonical": true, + "file": "cloud_memcache.update_parameters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateParameters", + "fullName": "google.cloud.memcache.v1.CloudMemcache.UpdateParameters", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "parameters", + "type": ".google.cloud.memcache.v1.MemcacheParameters" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "UpdateParameters", + "fullName": "google.cloud.memcache.v1.CloudMemcache.UpdateParameters", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1_generated_CloudMemcache_DeleteInstance_async", + "title": "CloudMemcache deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Instance.", + "canonical": true, + "file": "cloud_memcache.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.DeleteInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1_generated_CloudMemcache_ApplyParameters_async", + "title": "CloudMemcache applyParameters Sample", + "origin": "API_DEFINITION", + "description": " ApplyParameters will restart the set of specified nodes in order to update them to the current set of parameters for the Memcached Instance.", + "canonical": true, + "file": "cloud_memcache.apply_parameters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ApplyParameters", + "fullName": "google.cloud.memcache.v1.CloudMemcache.ApplyParameters", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "node_ids", + "type": "TYPE_STRING[]" + }, + { + "name": "apply_all", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "ApplyParameters", + "fullName": "google.cloud.memcache.v1.CloudMemcache.ApplyParameters", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } + } + ] +} diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js index d862a2a61c1..633ba79cb21 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.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-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js index 63920665ce9..7c60dba7ea1 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.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-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js index 13259abc5b0..e9d1ad7f37f 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js index 1bae7f1461e..665420df96a 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js index 9eff35e454f..4817ac6d81e 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js index f4e34012d23..ba83c1d4221 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js index 8dd6723e0e0..a87b8c2c293 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js index 566d37530ff..e6fbba3a582 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.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-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json new file mode 100644 index 00000000000..75a47958e2e --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json @@ -0,0 +1,387 @@ +{ + "clientLibrary": { + "name": "nodejs-memcache", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.memcache.v1beta2", + "version": "v1beta2" + } + ] + }, + "snippets": [ + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_ListInstances_async", + "title": "CloudMemcache listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists Instances in a given location.", + "canonical": true, + "file": "cloud_memcache.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.memcache.v1beta2.ListInstancesResponse", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ListInstances", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_GetInstance_async", + "title": "CloudMemcache getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Instance.", + "canonical": true, + "file": "cloud_memcache.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.memcache.v1beta2.Instance", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.GetInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_CreateInstance_async", + "title": "CloudMemcache createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Instance in a given location.", + "canonical": true, + "file": "cloud_memcache.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "resource", + "type": ".google.cloud.memcache.v1beta2.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.CreateInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_UpdateInstance_async", + "title": "CloudMemcache updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing Instance in a given project and location.", + "canonical": true, + "file": "cloud_memcache.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "resource", + "type": ".google.cloud.memcache.v1beta2.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_UpdateParameters_async", + "title": "CloudMemcache updateParameters Sample", + "origin": "API_DEFINITION", + "description": " Updates the defined Memcached parameters for an existing instance. This method only stages the parameters, it must be followed by `ApplyParameters` to apply the parameters to nodes of the Memcached instance.", + "canonical": true, + "file": "cloud_memcache.update_parameters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateParameters", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.UpdateParameters", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "parameters", + "type": ".google.cloud.memcache.v1beta2.MemcacheParameters" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "UpdateParameters", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.UpdateParameters", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_DeleteInstance_async", + "title": "CloudMemcache deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Instance.", + "canonical": true, + "file": "cloud_memcache.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_ApplyParameters_async", + "title": "CloudMemcache applyParameters Sample", + "origin": "API_DEFINITION", + "description": " `ApplyParameters` restarts the set of specified nodes in order to update them to the current set of parameters for the Memcached Instance.", + "canonical": true, + "file": "cloud_memcache.apply_parameters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ApplyParameters", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ApplyParameters", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "node_ids", + "type": "TYPE_STRING[]" + }, + { + "name": "apply_all", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "ApplyParameters", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ApplyParameters", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_ApplySoftwareUpdate_async", + "title": "CloudMemcache applySoftwareUpdate Sample", + "origin": "API_DEFINITION", + "description": " Updates software on the selected nodes of the Instance.", + "canonical": true, + "file": "cloud_memcache.apply_software_update.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ApplySoftwareUpdate", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdate", + "async": true, + "parameters": [ + { + "name": "instance", + "type": "TYPE_STRING" + }, + { + "name": "node_ids", + "type": "TYPE_STRING[]" + }, + { + "name": "apply_all", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "ApplySoftwareUpdate", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdate", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } + } + ] +} diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts index db22edd69db..52020f7f33e 100644 --- a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts @@ -1542,9 +1542,8 @@ export class CloudMemcacheClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.cloudMemcacheStub!.then(stub => { + if (this.cloudMemcacheStub && !this._terminated) { + return this.cloudMemcacheStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index 0c8146d6ad7..f4c21cd7344 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -1709,9 +1709,8 @@ export class CloudMemcacheClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.cloudMemcacheStub!.then(stub => { + if (this.cloudMemcacheStub && !this._terminated) { + return this.cloudMemcacheStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts index ef629677692..d16c9008528 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts @@ -183,12 +183,27 @@ describe('v1.CloudMemcacheClient', () => { assert(client.cloudMemcacheStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.cloudMemcacheStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudMemcacheStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -334,6 +349,22 @@ describe('v1.CloudMemcacheClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getInstance with closed client', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInstance(request), expectedError); + }); }); describe('createInstance', () => { diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts index 1a4a907b8d7..4624b4a4f96 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts @@ -185,12 +185,27 @@ describe('v1beta2.CloudMemcacheClient', () => { assert(client.cloudMemcacheStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.cloudMemcacheStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudMemcacheStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -336,6 +351,22 @@ describe('v1beta2.CloudMemcacheClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getInstance with closed client', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInstance(request), expectedError); + }); }); describe('createInstance', () => { From 0ec81b3880da50c9119a65e1fc53ff2e76646d9e 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:26 +0000 Subject: [PATCH 119/152] chore: update v2.14.2 gapic-generator-typescript (#183) - [ ] Regenerate this pull request now. Committer: @summer-ji-eng PiperOrigin-RevId: 434859890 Source-Link: https://github.com/googleapis/googleapis/commit/bc2432d50cba657e95212122e3fa112591b5bec2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/930b673103e92523f8cfed38decd7d3afae8ebe7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTMwYjY3MzEwM2U5MjUyM2Y4Y2ZlZDM4ZGVjZDdkM2FmYWU4ZWJlNyJ9 --- packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts | 1 - .../google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts index d16c9008528..10a969d766b 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts @@ -360,7 +360,6 @@ describe('v1.CloudMemcacheClient', () => { new protos.google.cloud.memcache.v1.GetInstanceRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getInstance(request), expectedError); diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts index 4624b4a4f96..4904ba07f1f 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts @@ -362,7 +362,6 @@ describe('v1beta2.CloudMemcacheClient', () => { new protos.google.cloud.memcache.v1beta2.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); From bf2fe1a27e7836c8200deb0395d0a06fbdad24ac Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 02:34:18 +0000 Subject: [PATCH 120/152] build(node): update client library version in samples metadata (#1356) (#190) * 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 --- ...pet_metadata.google.cloud.memcache.v1.json | 648 +++++++-------- ...etadata.google.cloud.memcache.v1beta2.json | 740 +++++++++--------- 2 files changed, 694 insertions(+), 694 deletions(-) diff --git a/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json index 7cdc2338e11..b05ee41af15 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json +++ b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json @@ -1,339 +1,339 @@ { - "clientLibrary": { - "name": "nodejs-memcache", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.memcache.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "memcache_v1_generated_CloudMemcache_ListInstances_async", - "title": "CloudMemcache listInstances Sample", - "origin": "API_DEFINITION", - "description": " Lists Instances in a given location.", - "canonical": true, - "file": "cloud_memcache.list_instances.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListInstances", - "fullName": "google.cloud.memcache.v1.CloudMemcache.ListInstances", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.memcache.v1.ListInstancesResponse", - "client": { - "shortName": "CloudMemcacheClient", - "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" - }, - "method": { - "shortName": "ListInstances", - "fullName": "google.cloud.memcache.v1.CloudMemcache.ListInstances", - "service": { - "shortName": "CloudMemcache", - "fullName": "google.cloud.memcache.v1.CloudMemcache" - } - } - } + "clientLibrary": { + "name": "nodejs-memcache", + "version": "1.5.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.memcache.v1", + "version": "v1" + } + ] }, - { - "regionTag": "memcache_v1_generated_CloudMemcache_GetInstance_async", - "title": "CloudMemcache getInstance Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single Instance.", - "canonical": true, - "file": "cloud_memcache.get_instance.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetInstance", - "fullName": "google.cloud.memcache.v1.CloudMemcache.GetInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.memcache.v1.Instance", - "client": { - "shortName": "CloudMemcacheClient", - "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + "regionTag": "memcache_v1_generated_CloudMemcache_ListInstances_async", + "title": "CloudMemcache listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists Instances in a given location.", + "canonical": true, + "file": "cloud_memcache.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.memcache.v1.CloudMemcache.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.memcache.v1.ListInstancesResponse", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.memcache.v1.CloudMemcache.ListInstances", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } }, - "method": { - "shortName": "GetInstance", - "fullName": "google.cloud.memcache.v1.CloudMemcache.GetInstance", - "service": { - "shortName": "CloudMemcache", - "fullName": "google.cloud.memcache.v1.CloudMemcache" - } - } - } - }, - { - "regionTag": "memcache_v1_generated_CloudMemcache_CreateInstance_async", - "title": "CloudMemcache createInstance Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Instance in a given location.", - "canonical": true, - "file": "cloud_memcache.create_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateInstance", - "fullName": "google.cloud.memcache.v1.CloudMemcache.CreateInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "instance_id", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": ".google.cloud.memcache.v1.Instance" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudMemcacheClient", - "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + "regionTag": "memcache_v1_generated_CloudMemcache_GetInstance_async", + "title": "CloudMemcache getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Instance.", + "canonical": true, + "file": "cloud_memcache.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.memcache.v1.Instance", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.GetInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } }, - "method": { - "shortName": "CreateInstance", - "fullName": "google.cloud.memcache.v1.CloudMemcache.CreateInstance", - "service": { - "shortName": "CloudMemcache", - "fullName": "google.cloud.memcache.v1.CloudMemcache" - } - } - } - }, - { - "regionTag": "memcache_v1_generated_CloudMemcache_UpdateInstance_async", - "title": "CloudMemcache updateInstance Sample", - "origin": "API_DEFINITION", - "description": " Updates an existing Instance in a given project and location.", - "canonical": true, - "file": "cloud_memcache.update_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.memcache.v1.CloudMemcache.UpdateInstance", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "instance", - "type": ".google.cloud.memcache.v1.Instance" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudMemcacheClient", - "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + "regionTag": "memcache_v1_generated_CloudMemcache_CreateInstance_async", + "title": "CloudMemcache createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Instance in a given location.", + "canonical": true, + "file": "cloud_memcache.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.memcache.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.CreateInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } }, - "method": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.memcache.v1.CloudMemcache.UpdateInstance", - "service": { - "shortName": "CloudMemcache", - "fullName": "google.cloud.memcache.v1.CloudMemcache" - } - } - } - }, - { - "regionTag": "memcache_v1_generated_CloudMemcache_UpdateParameters_async", - "title": "CloudMemcache updateParameters Sample", - "origin": "API_DEFINITION", - "description": " Updates the defined Memcached Parameters for an existing Instance. This method only stages the parameters, it must be followed by ApplyParameters to apply the parameters to nodes of the Memcached Instance.", - "canonical": true, - "file": "cloud_memcache.update_parameters.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateParameters", - "fullName": "google.cloud.memcache.v1.CloudMemcache.UpdateParameters", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "parameters", - "type": ".google.cloud.memcache.v1.MemcacheParameters" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudMemcacheClient", - "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + "regionTag": "memcache_v1_generated_CloudMemcache_UpdateInstance_async", + "title": "CloudMemcache updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing Instance in a given project and location.", + "canonical": true, + "file": "cloud_memcache.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "instance", + "type": ".google.cloud.memcache.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.UpdateInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } }, - "method": { - "shortName": "UpdateParameters", - "fullName": "google.cloud.memcache.v1.CloudMemcache.UpdateParameters", - "service": { - "shortName": "CloudMemcache", - "fullName": "google.cloud.memcache.v1.CloudMemcache" - } - } - } - }, - { - "regionTag": "memcache_v1_generated_CloudMemcache_DeleteInstance_async", - "title": "CloudMemcache deleteInstance Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Instance.", - "canonical": true, - "file": "cloud_memcache.delete_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.memcache.v1.CloudMemcache.DeleteInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudMemcacheClient", - "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + "regionTag": "memcache_v1_generated_CloudMemcache_UpdateParameters_async", + "title": "CloudMemcache updateParameters Sample", + "origin": "API_DEFINITION", + "description": " Updates the defined Memcached Parameters for an existing Instance. This method only stages the parameters, it must be followed by ApplyParameters to apply the parameters to nodes of the Memcached Instance.", + "canonical": true, + "file": "cloud_memcache.update_parameters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateParameters", + "fullName": "google.cloud.memcache.v1.CloudMemcache.UpdateParameters", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "parameters", + "type": ".google.cloud.memcache.v1.MemcacheParameters" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "UpdateParameters", + "fullName": "google.cloud.memcache.v1.CloudMemcache.UpdateParameters", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } }, - "method": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.memcache.v1.CloudMemcache.DeleteInstance", - "service": { - "shortName": "CloudMemcache", - "fullName": "google.cloud.memcache.v1.CloudMemcache" - } - } - } - }, - { - "regionTag": "memcache_v1_generated_CloudMemcache_ApplyParameters_async", - "title": "CloudMemcache applyParameters Sample", - "origin": "API_DEFINITION", - "description": " ApplyParameters will restart the set of specified nodes in order to update them to the current set of parameters for the Memcached Instance.", - "canonical": true, - "file": "cloud_memcache.apply_parameters.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ApplyParameters", - "fullName": "google.cloud.memcache.v1.CloudMemcache.ApplyParameters", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "node_ids", - "type": "TYPE_STRING[]" - }, - { - "name": "apply_all", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudMemcacheClient", - "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + "regionTag": "memcache_v1_generated_CloudMemcache_DeleteInstance_async", + "title": "CloudMemcache deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Instance.", + "canonical": true, + "file": "cloud_memcache.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.DeleteInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } }, - "method": { - "shortName": "ApplyParameters", - "fullName": "google.cloud.memcache.v1.CloudMemcache.ApplyParameters", - "service": { - "shortName": "CloudMemcache", - "fullName": "google.cloud.memcache.v1.CloudMemcache" - } + { + "regionTag": "memcache_v1_generated_CloudMemcache_ApplyParameters_async", + "title": "CloudMemcache applyParameters Sample", + "origin": "API_DEFINITION", + "description": " ApplyParameters will restart the set of specified nodes in order to update them to the current set of parameters for the Memcached Instance.", + "canonical": true, + "file": "cloud_memcache.apply_parameters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ApplyParameters", + "fullName": "google.cloud.memcache.v1.CloudMemcache.ApplyParameters", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "node_ids", + "type": "TYPE_STRING[]" + }, + { + "name": "apply_all", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "ApplyParameters", + "fullName": "google.cloud.memcache.v1.CloudMemcache.ApplyParameters", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json index 75a47958e2e..6276a86e678 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json @@ -1,387 +1,387 @@ { - "clientLibrary": { - "name": "nodejs-memcache", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.memcache.v1beta2", - "version": "v1beta2" - } - ] - }, - "snippets": [ - { - "regionTag": "memcache_v1beta2_generated_CloudMemcache_ListInstances_async", - "title": "CloudMemcache listInstances Sample", - "origin": "API_DEFINITION", - "description": " Lists Instances in a given location.", - "canonical": true, - "file": "cloud_memcache.list_instances.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 76, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListInstances", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ListInstances", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.memcache.v1beta2.ListInstancesResponse", - "client": { - "shortName": "CloudMemcacheClient", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" - }, - "method": { - "shortName": "ListInstances", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ListInstances", - "service": { - "shortName": "CloudMemcache", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" - } - } - } + "clientLibrary": { + "name": "nodejs-memcache", + "version": "1.5.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.memcache.v1beta2", + "version": "v1beta2" + } + ] }, - { - "regionTag": "memcache_v1beta2_generated_CloudMemcache_GetInstance_async", - "title": "CloudMemcache getInstance Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single Instance.", - "canonical": true, - "file": "cloud_memcache.get_instance.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetInstance", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.GetInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.memcache.v1beta2.Instance", - "client": { - "shortName": "CloudMemcacheClient", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + "regionTag": "memcache_v1beta2_generated_CloudMemcache_ListInstances_async", + "title": "CloudMemcache listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists Instances in a given location.", + "canonical": true, + "file": "cloud_memcache.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.memcache.v1beta2.ListInstancesResponse", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ListInstances", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } }, - "method": { - "shortName": "GetInstance", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.GetInstance", - "service": { - "shortName": "CloudMemcache", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" - } - } - } - }, - { - "regionTag": "memcache_v1beta2_generated_CloudMemcache_CreateInstance_async", - "title": "CloudMemcache createInstance Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Instance in a given location.", - "canonical": true, - "file": "cloud_memcache.create_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateInstance", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.CreateInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "instance_id", - "type": "TYPE_STRING" - }, - { - "name": "resource", - "type": ".google.cloud.memcache.v1beta2.Instance" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudMemcacheClient", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + "regionTag": "memcache_v1beta2_generated_CloudMemcache_GetInstance_async", + "title": "CloudMemcache getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Instance.", + "canonical": true, + "file": "cloud_memcache.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.memcache.v1beta2.Instance", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.GetInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } }, - "method": { - "shortName": "CreateInstance", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.CreateInstance", - "service": { - "shortName": "CloudMemcache", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" - } - } - } - }, - { - "regionTag": "memcache_v1beta2_generated_CloudMemcache_UpdateInstance_async", - "title": "CloudMemcache updateInstance Sample", - "origin": "API_DEFINITION", - "description": " Updates an existing Instance in a given project and location.", - "canonical": true, - "file": "cloud_memcache.update_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstance", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "resource", - "type": ".google.cloud.memcache.v1beta2.Instance" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudMemcacheClient", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + "regionTag": "memcache_v1beta2_generated_CloudMemcache_CreateInstance_async", + "title": "CloudMemcache createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Instance in a given location.", + "canonical": true, + "file": "cloud_memcache.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "resource", + "type": ".google.cloud.memcache.v1beta2.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.CreateInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } }, - "method": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstance", - "service": { - "shortName": "CloudMemcache", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" - } - } - } - }, - { - "regionTag": "memcache_v1beta2_generated_CloudMemcache_UpdateParameters_async", - "title": "CloudMemcache updateParameters Sample", - "origin": "API_DEFINITION", - "description": " Updates the defined Memcached parameters for an existing instance. This method only stages the parameters, it must be followed by `ApplyParameters` to apply the parameters to nodes of the Memcached instance.", - "canonical": true, - "file": "cloud_memcache.update_parameters.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateParameters", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.UpdateParameters", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "parameters", - "type": ".google.cloud.memcache.v1beta2.MemcacheParameters" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudMemcacheClient", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + "regionTag": "memcache_v1beta2_generated_CloudMemcache_UpdateInstance_async", + "title": "CloudMemcache updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing Instance in a given project and location.", + "canonical": true, + "file": "cloud_memcache.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "resource", + "type": ".google.cloud.memcache.v1beta2.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } }, - "method": { - "shortName": "UpdateParameters", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.UpdateParameters", - "service": { - "shortName": "CloudMemcache", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" - } - } - } - }, - { - "regionTag": "memcache_v1beta2_generated_CloudMemcache_DeleteInstance_async", - "title": "CloudMemcache deleteInstance Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Instance.", - "canonical": true, - "file": "cloud_memcache.delete_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudMemcacheClient", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + "regionTag": "memcache_v1beta2_generated_CloudMemcache_UpdateParameters_async", + "title": "CloudMemcache updateParameters Sample", + "origin": "API_DEFINITION", + "description": " Updates the defined Memcached parameters for an existing instance. This method only stages the parameters, it must be followed by `ApplyParameters` to apply the parameters to nodes of the Memcached instance.", + "canonical": true, + "file": "cloud_memcache.update_parameters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateParameters", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.UpdateParameters", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "parameters", + "type": ".google.cloud.memcache.v1beta2.MemcacheParameters" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "UpdateParameters", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.UpdateParameters", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } }, - "method": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstance", - "service": { - "shortName": "CloudMemcache", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" - } - } - } - }, - { - "regionTag": "memcache_v1beta2_generated_CloudMemcache_ApplyParameters_async", - "title": "CloudMemcache applyParameters Sample", - "origin": "API_DEFINITION", - "description": " `ApplyParameters` restarts the set of specified nodes in order to update them to the current set of parameters for the Memcached Instance.", - "canonical": true, - "file": "cloud_memcache.apply_parameters.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ApplyParameters", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ApplyParameters", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "node_ids", - "type": "TYPE_STRING[]" - }, - { - "name": "apply_all", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudMemcacheClient", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + "regionTag": "memcache_v1beta2_generated_CloudMemcache_DeleteInstance_async", + "title": "CloudMemcache deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Instance.", + "canonical": true, + "file": "cloud_memcache.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } }, - "method": { - "shortName": "ApplyParameters", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ApplyParameters", - "service": { - "shortName": "CloudMemcache", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" - } - } - } - }, - { - "regionTag": "memcache_v1beta2_generated_CloudMemcache_ApplySoftwareUpdate_async", - "title": "CloudMemcache applySoftwareUpdate Sample", - "origin": "API_DEFINITION", - "description": " Updates software on the selected nodes of the Instance.", - "canonical": true, - "file": "cloud_memcache.apply_software_update.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ApplySoftwareUpdate", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdate", - "async": true, - "parameters": [ - { - "name": "instance", - "type": "TYPE_STRING" - }, - { - "name": "node_ids", - "type": "TYPE_STRING[]" - }, - { - "name": "apply_all", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudMemcacheClient", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + "regionTag": "memcache_v1beta2_generated_CloudMemcache_ApplyParameters_async", + "title": "CloudMemcache applyParameters Sample", + "origin": "API_DEFINITION", + "description": " `ApplyParameters` restarts the set of specified nodes in order to update them to the current set of parameters for the Memcached Instance.", + "canonical": true, + "file": "cloud_memcache.apply_parameters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ApplyParameters", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ApplyParameters", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "node_ids", + "type": "TYPE_STRING[]" + }, + { + "name": "apply_all", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "ApplyParameters", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ApplyParameters", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } }, - "method": { - "shortName": "ApplySoftwareUpdate", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdate", - "service": { - "shortName": "CloudMemcache", - "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" - } + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_ApplySoftwareUpdate_async", + "title": "CloudMemcache applySoftwareUpdate Sample", + "origin": "API_DEFINITION", + "description": " Updates software on the selected nodes of the Instance.", + "canonical": true, + "file": "cloud_memcache.apply_software_update.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ApplySoftwareUpdate", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdate", + "async": true, + "parameters": [ + { + "name": "instance", + "type": "TYPE_STRING" + }, + { + "name": "node_ids", + "type": "TYPE_STRING[]" + }, + { + "name": "apply_all", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "ApplySoftwareUpdate", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdate", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file From 3bb59304f03d4dcfd4ec4920a8dabc4fabf28547 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 3 May 2022 02:28:31 +0200 Subject: [PATCH 121/152] chore(deps): update dependency @types/mocha to v9 (#191) 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/mocha](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^8.0.0` -> `^9.0.0`](https://renovatebot.com/diffs/npm/@types%2fmocha/8.2.3/9.1.1) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/compatibility-slim/8.2.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/confidence-slim/8.2.3)](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-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index ab6c382446d..d1386ed5176 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -30,7 +30,7 @@ "google-gax": "^2.24.1" }, "devDependencies": { - "@types/mocha": "^8.0.0", + "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", From 80abe904367b0c3c5f34f205960649b8e6f51f03 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 May 2022 17:36:30 +0200 Subject: [PATCH 122/152] chore(deps): update dependency sinon to v14 (#194) 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-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index d1386ed5176..2a5f31cd97a 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -42,7 +42,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^13.0.0", + "sinon": "^14.0.0", "ts-loader": "^9.0.0", "typescript": "~3.8.3", "webpack": "^5.0.0", From abb7a2bd35abc6ed264baccea1313abf4fb61654 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 16 May 2022 17:39:20 -0700 Subject: [PATCH 123/152] build!: update library to use Node 12 (#196) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat!: Update library to use Node 12 * 🦉 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 --- packages/google-cloud-memcache/package.json | 10 +++++----- packages/google-cloud-memcache/samples/package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 2a5f31cd97a..192f0c9bf7e 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -27,28 +27,28 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.24.1" + "google-gax": "^3.0.1" }, "devDependencies": { "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", - "gts": "^2.0.0", + "gts": "^3.1.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.0.4", - "mocha": "^8.0.0", + "mocha": "^9.2.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^14.0.0", "ts-loader": "^9.0.0", - "typescript": "~3.8.3", + "typescript": "^4.6.4", "webpack": "^5.0.0", "webpack-cli": "^4.0.0" }, "engines": { - "node": ">=10.0.0" + "node": ">=12.0.0" } } diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index 92d70f442d5..029a3ce1dea 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "files": [ "*.js" From 939b14f609aefef1aaa2545c6d60d42959767e2a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 May 2022 17:11:26 -0700 Subject: [PATCH 124/152] chore(main): release 2.0.0 (#197) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 2.0.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-memcache/CHANGELOG.md | 11 +++++++++++ packages/google-cloud-memcache/package.json | 2 +- .../v1/snippet_metadata.google.cloud.memcache.v1.json | 2 +- ...nippet_metadata.google.cloud.memcache.v1beta2.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index 50495448301..1c1a1b7dc52 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [2.0.0](https://github.com/googleapis/nodejs-memcache/compare/v1.5.1...v2.0.0) (2022-05-17) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#196) + +### Build System + +* update library to use Node 12 ([#196](https://github.com/googleapis/nodejs-memcache/issues/196)) ([776f934](https://github.com/googleapis/nodejs-memcache/commit/776f93402453fc1b33394d80e19f3478efca42b4)) + ### [1.5.1](https://www.github.com/googleapis/nodejs-memcache/compare/v1.5.0...v1.5.1) (2021-09-08) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 192f0c9bf7e..f8ce68cec9f 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "1.5.1", + "version": "2.0.0", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json index b05ee41af15..68e0736f360 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json +++ b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-memcache", - "version": "1.5.1", + "version": "2.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json index 6276a86e678..c6dcc27e3dc 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-memcache", - "version": "1.5.1", + "version": "2.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index 029a3ce1dea..e54f35c4d3d 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^1.5.1" + "@google-cloud/memcache": "^2.0.0" }, "devDependencies": { "c8": "^7.0.0", From ed7da9f5f62da7294f109902cea36955bd0da155 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 9 Jun 2022 22:16:20 +0200 Subject: [PATCH 125/152] chore(deps): update dependency jsdoc-region-tag to v2 (#200) 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.4` -> `^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-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index f8ce68cec9f..29ba33fe7a9 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -37,7 +37,7 @@ "gts": "^3.1.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", - "jsdoc-region-tag": "^1.0.4", + "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.0.4", "mocha": "^9.2.2", "null-loader": "^4.0.0", From ae33c79539f08d0926b79a32746c5f6ed48275e4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 9 Jun 2022 22:34:32 +0200 Subject: [PATCH 126/152] chore(deps): update dependency jsdoc-fresh to v2 (#199) 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-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 29ba33fe7a9..2ca97d2d322 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -36,7 +36,7 @@ "c8": "^7.1.0", "gts": "^3.1.0", "jsdoc": "^3.6.3", - "jsdoc-fresh": "^1.0.2", + "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.0.4", "mocha": "^9.2.2", From 47e26031a4903aa1d8712e8a7173fea2d06bd10f 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:42:24 -0700 Subject: [PATCH 127/152] feat: support regapic LRO (#201) 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_memcache_client.ts | 27 +++++----- .../src/v1beta2/cloud_memcache_client.ts | 53 ++++++++++++++----- 2 files changed, 56 insertions(+), 24 deletions(-) diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts index 52020f7f33e..d58a5b0e34c 100644 --- a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -86,7 +87,7 @@ export class CloudMemcacheClient { * * @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] @@ -109,11 +110,10 @@ export class CloudMemcacheClient { * 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. @@ -200,16 +200,19 @@ export class CloudMemcacheClient { }; 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 = []; + } 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.memcache.v1.Instance' diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index f4c21cd7344..2afc5d9bba4 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -86,7 +87,7 @@ export class CloudMemcacheClient { * * @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] @@ -109,11 +110,10 @@ export class CloudMemcacheClient { * 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. @@ -200,16 +200,45 @@ export class CloudMemcacheClient { }; 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: '/v1beta2/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1beta2/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1beta2/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta2/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta2/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta2/{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.memcache.v1beta2.Instance' From f95ba1598a80c5727dfe04a713be49b8b43a80bf 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:12:15 +0000 Subject: [PATCH 128/152] chore(main): release 2.1.0 (#202) :robot: I have created a release *beep* *boop* --- ## [2.1.0](https://github.com/googleapis/nodejs-memcache/compare/v2.0.0...v2.1.0) (2022-06-30) ### Features * support regapic LRO ([#201](https://github.com/googleapis/nodejs-memcache/issues/201)) ([2151fc9](https://github.com/googleapis/nodejs-memcache/commit/2151fc9b1524bd8f3eed8492dc7baeb26d2db3ed)) --- 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-memcache/CHANGELOG.md | 7 +++++++ packages/google-cloud-memcache/package.json | 2 +- .../v1/snippet_metadata.google.cloud.memcache.v1.json | 2 +- .../snippet_metadata.google.cloud.memcache.v1beta2.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index 1c1a1b7dc52..cdc67be2bee 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.1.0](https://github.com/googleapis/nodejs-memcache/compare/v2.0.0...v2.1.0) (2022-06-30) + + +### Features + +* support regapic LRO ([#201](https://github.com/googleapis/nodejs-memcache/issues/201)) ([2151fc9](https://github.com/googleapis/nodejs-memcache/commit/2151fc9b1524bd8f3eed8492dc7baeb26d2db3ed)) + ## [2.0.0](https://github.com/googleapis/nodejs-memcache/compare/v1.5.1...v2.0.0) (2022-05-17) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 2ca97d2d322..dba20ae732e 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "2.0.0", + "version": "2.1.0", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json index 68e0736f360..ba5d7b73084 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json +++ b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-memcache", - "version": "2.0.0", + "version": "2.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json index c6dcc27e3dc..9c13a43cdf1 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-memcache", - "version": "2.0.0", + "version": "2.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index e54f35c4d3d..a87bdd7a13d 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^2.0.0" + "@google-cloud/memcache": "^2.1.0" }, "devDependencies": { "c8": "^7.0.0", From a2a43ae2a35d8f2e6cb3366769fc25e00c7610c7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Jul 2022 22:50:20 +0200 Subject: [PATCH 129/152] chore(deps): update dependency linkinator to v4 (#205) 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.0.4` -> `^4.0.0`](https://renovatebot.com/diffs/npm/linkinator/2.16.2/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/compatibility-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/confidence-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
JustinBeckwith/linkinator ### [`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-memcache). --- packages/google-cloud-memcache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index dba20ae732e..4cec64c05e1 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -38,7 +38,7 @@ "jsdoc": "^3.6.3", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^2.0.4", + "linkinator": "^4.0.0", "mocha": "^9.2.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", From 58615ecdf3192da7d251c26d501cf5a5e75976b9 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:08:19 +0000 Subject: [PATCH 130/152] fix: better support for fallback mode (#209) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 468790263 Source-Link: https://github.com/googleapis/googleapis/commit/873ab456273d105245df0fb82a6c17a814553b80 Source-Link: https://github.com/googleapis/googleapis-gen/commit/cb6f37aeff2a3472e40a7bbace8c67d75e24bee5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2I2ZjM3YWVmZjJhMzQ3MmU0MGE3YmJhY2U4YzY3ZDc1ZTI0YmVlNSJ9 --- .../v1/cloud_memcache.apply_parameters.js | 3 + .../v1/cloud_memcache.create_instance.js | 3 + .../v1/cloud_memcache.delete_instance.js | 3 + .../v1/cloud_memcache.get_instance.js | 3 + .../v1/cloud_memcache.list_instances.js | 3 + .../v1/cloud_memcache.update_instance.js | 3 + .../v1/cloud_memcache.update_parameters.js | 3 + ...pet_metadata.google.cloud.memcache.v1.json | 14 +- .../cloud_memcache.apply_parameters.js | 3 + .../cloud_memcache.apply_software_update.js | 3 + .../v1beta2/cloud_memcache.create_instance.js | 3 + .../v1beta2/cloud_memcache.delete_instance.js | 3 + .../v1beta2/cloud_memcache.get_instance.js | 3 + .../v1beta2/cloud_memcache.list_instances.js | 3 + .../v1beta2/cloud_memcache.update_instance.js | 3 + .../cloud_memcache.update_parameters.js | 3 + ...etadata.google.cloud.memcache.v1beta2.json | 16 +- .../src/v1/cloud_memcache_client.ts | 18 +- .../src/v1beta2/cloud_memcache_client.ts | 20 +-- .../test/gapic_cloud_memcache_v1.ts | 158 ++++++++--------- .../test/gapic_cloud_memcache_v1beta2.ts | 160 +++++++++--------- 21 files changed, 241 insertions(+), 190 deletions(-) diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js index cab63971ab5..0ea4aa54a92 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js @@ -23,6 +23,9 @@ function main(name) { // [START memcache_v1_generated_CloudMemcache_ApplyParameters_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-memcache/samples/generated/v1/cloud_memcache.create_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js index fd5f2aa0b27..86daa874036 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js @@ -23,6 +23,9 @@ function main(parent, instanceId, instance) { // [START memcache_v1_generated_CloudMemcache_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-memcache/samples/generated/v1/cloud_memcache.delete_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js index 1f4c3fd63da..488f1e5b165 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START memcache_v1_generated_CloudMemcache_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-memcache/samples/generated/v1/cloud_memcache.get_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js index c9f947b1d19..800c25eb359 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START memcache_v1_generated_CloudMemcache_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-memcache/samples/generated/v1/cloud_memcache.list_instances.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js index 9c669cbd5a0..c0518a8c2f4 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js @@ -23,6 +23,9 @@ function main(parent) { // [START memcache_v1_generated_CloudMemcache_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-memcache/samples/generated/v1/cloud_memcache.update_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js index f97a14f0ec6..6aa546dd0bf 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js @@ -23,6 +23,9 @@ function main(updateMask, instance) { // [START memcache_v1_generated_CloudMemcache_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-memcache/samples/generated/v1/cloud_memcache.update_parameters.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js index 887d8f747dd..9557f67fa74 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js @@ -23,6 +23,9 @@ function main(name, updateMask) { // [START memcache_v1_generated_CloudMemcache_UpdateParameters_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-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json index ba5d7b73084..e76e5f45a0f 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json +++ b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 77, + "end": 80, "type": "FULL" } ], @@ -78,7 +78,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -118,7 +118,7 @@ "segments": [ { "start": 25, - "end": 70, + "end": 73, "type": "FULL" } ], @@ -166,7 +166,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 61, "type": "FULL" } ], @@ -210,7 +210,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -258,7 +258,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -298,7 +298,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js index 633ba79cb21..f09d814ae76 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js @@ -23,6 +23,9 @@ function main(name) { // [START memcache_v1beta2_generated_CloudMemcache_ApplyParameters_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-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js index 7c60dba7ea1..fe2719cea26 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js @@ -23,6 +23,9 @@ function main(instance) { // [START memcache_v1beta2_generated_CloudMemcache_ApplySoftwareUpdate_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-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js index e9d1ad7f37f..7da20192204 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js @@ -23,6 +23,9 @@ function main(parent, instanceId, resource) { // [START memcache_v1beta2_generated_CloudMemcache_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-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js index 665420df96a..941e43b132f 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START memcache_v1beta2_generated_CloudMemcache_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-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js index 4817ac6d81e..8f6b2939630 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START memcache_v1beta2_generated_CloudMemcache_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-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js index ba83c1d4221..ec3a3c75cbf 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js @@ -23,6 +23,9 @@ function main(parent) { // [START memcache_v1beta2_generated_CloudMemcache_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-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js index a87b8c2c293..881e0da669a 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js @@ -23,6 +23,9 @@ function main(updateMask, resource) { // [START memcache_v1beta2_generated_CloudMemcache_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-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js index e6fbba3a582..5563bc51310 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js @@ -23,6 +23,9 @@ function main(name, updateMask) { // [START memcache_v1beta2_generated_CloudMemcache_UpdateParameters_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-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json index 9c13a43cdf1..0ef2cc40f06 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 76, + "end": 79, "type": "FULL" } ], @@ -78,7 +78,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -118,7 +118,7 @@ "segments": [ { "start": 25, - "end": 70, + "end": 73, "type": "FULL" } ], @@ -166,7 +166,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 61, "type": "FULL" } ], @@ -210,7 +210,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -258,7 +258,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -298,7 +298,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -346,7 +346,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts index d58a5b0e34c..136647e2256 100644 --- a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_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'); /** @@ -353,7 +352,8 @@ export class CloudMemcacheClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -648,7 +648,7 @@ export class CloudMemcacheClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.memcache.v1.Instance, @@ -789,7 +789,7 @@ export class CloudMemcacheClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.memcache.v1.Instance, @@ -933,7 +933,7 @@ export class CloudMemcacheClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateParameters, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.memcache.v1.Instance, @@ -1072,7 +1072,7 @@ export class CloudMemcacheClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1217,7 +1217,7 @@ export class CloudMemcacheClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.applyParameters, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.memcache.v1.Instance, @@ -1383,7 +1383,7 @@ export class CloudMemcacheClient { 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 ); @@ -1445,7 +1445,7 @@ export class CloudMemcacheClient { this.initialize(); return this.descriptors.page.listInstances.asyncIterate( this.innerApiCalls['listInstances'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index 2afc5d9bba4..1dff9d7c8e2 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_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'); /** @@ -391,7 +390,8 @@ export class CloudMemcacheClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -692,7 +692,7 @@ export class CloudMemcacheClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.memcache.v1beta2.Instance, @@ -833,7 +833,7 @@ export class CloudMemcacheClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.memcache.v1beta2.Instance, @@ -978,7 +978,7 @@ export class CloudMemcacheClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateParameters, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.memcache.v1beta2.Instance, @@ -1117,7 +1117,7 @@ export class CloudMemcacheClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1262,7 +1262,7 @@ export class CloudMemcacheClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.applyParameters, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.memcache.v1beta2.Instance, @@ -1407,7 +1407,7 @@ export class CloudMemcacheClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.applySoftwareUpdate, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.memcache.v1beta2.Instance, @@ -1577,7 +1577,7 @@ export class CloudMemcacheClient { 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 ); @@ -1638,7 +1638,7 @@ export class CloudMemcacheClient { this.initialize(); return this.descriptors.page.listInstances.asyncIterate( this.innerApiCalls['listInstances'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts index 10a969d766b..1a943b358d9 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts @@ -145,99 +145,103 @@ function stubAsyncIterationCall( } describe('v1.CloudMemcacheClient', () => { - it('has servicePath', () => { - const servicePath = cloudmemcacheModule.v1.CloudMemcacheClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = cloudmemcacheModule.v1.CloudMemcacheClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = cloudmemcacheModule.v1.CloudMemcacheClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new cloudmemcacheModule.v1.CloudMemcacheClient(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + cloudmemcacheModule.v1.CloudMemcacheClient.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = + cloudmemcacheModule.v1.CloudMemcacheClient.apiEndpoint; + assert(apiEndpoint); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has port', () => { + const port = cloudmemcacheModule.v1.CloudMemcacheClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert.strictEqual(client.cloudMemcacheStub, undefined); - await client.initialize(); - assert(client.cloudMemcacheStub); - }); - it('has close method for the initialized client', done => { - const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient(); + assert(client); }); - client.initialize(); - assert(client.cloudMemcacheStub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + fallback: true, + }); + assert(client); }); - }); - it('has close method for the non-initialized client', done => { - const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has initialize method and supports deferred initialization', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudMemcacheStub, undefined); + await client.initialize(); + assert(client.cloudMemcacheStub); }); - assert.strictEqual(client.cloudMemcacheStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the initialized client', done => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.cloudMemcacheStub); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudMemcacheStub, undefined); + client.close().then(() => { + done(); + }); }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + 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-memcache/test/gapic_cloud_memcache_v1beta2.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts index 4904ba07f1f..976fdcce549 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts @@ -145,101 +145,103 @@ function stubAsyncIterationCall( } describe('v1beta2.CloudMemcacheClient', () => { - it('has servicePath', () => { - const servicePath = - cloudmemcacheModule.v1beta2.CloudMemcacheClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - cloudmemcacheModule.v1beta2.CloudMemcacheClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = cloudmemcacheModule.v1beta2.CloudMemcacheClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + cloudmemcacheModule.v1beta2.CloudMemcacheClient.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = + cloudmemcacheModule.v1beta2.CloudMemcacheClient.apiEndpoint; + assert(apiEndpoint); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has port', () => { + const port = cloudmemcacheModule.v1beta2.CloudMemcacheClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert.strictEqual(client.cloudMemcacheStub, undefined); - await client.initialize(); - assert(client.cloudMemcacheStub); - }); - it('has close method for the initialized client', done => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient(); + assert(client); }); - client.initialize(); - assert(client.cloudMemcacheStub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + fallback: true, + }); + assert(client); }); - }); - it('has close method for the non-initialized client', done => { - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has initialize method and supports deferred initialization', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudMemcacheStub, undefined); + await client.initialize(); + assert(client.cloudMemcacheStub); }); - assert.strictEqual(client.cloudMemcacheStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the initialized client', done => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.cloudMemcacheStub); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudMemcacheStub, undefined); + client.close().then(() => { + done(); + }); }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 6b6bd395d3811f8996ed7dd826929a92432691a6 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:32:17 +0000 Subject: [PATCH 131/152] fix: change import long to require (#211) Source-Link: https://github.com/googleapis/synthtool/commit/d229a1258999f599a90a9b674a1c5541e00db588 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e --- .../google-cloud-memcache/protos/protos.d.ts | 609 ++- .../google-cloud-memcache/protos/protos.js | 3901 ++++++++++++----- .../google-cloud-memcache/protos/protos.json | 24 + 3 files changed, 3343 insertions(+), 1191 deletions(-) diff --git a/packages/google-cloud-memcache/protos/protos.d.ts b/packages/google-cloud-memcache/protos/protos.d.ts index e2c6a8862bb..110c52d40b2 100644 --- a/packages/google-cloud-memcache/protos/protos.d.ts +++ b/packages/google-cloud-memcache/protos/protos.d.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import * as Long from "long"; +import Long = require("long"); import {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { @@ -148,49 +148,49 @@ export namespace google { namespace CloudMemcache { /** - * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#listInstances}. + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|listInstances}. * @param error Error, if any * @param [response] ListInstancesResponse */ type ListInstancesCallback = (error: (Error|null), response?: google.cloud.memcache.v1.ListInstancesResponse) => void; /** - * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#getInstance}. + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|getInstance}. * @param error Error, if any * @param [response] Instance */ type GetInstanceCallback = (error: (Error|null), response?: google.cloud.memcache.v1.Instance) => void; /** - * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#createInstance}. + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|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.memcache.v1.CloudMemcache#updateInstance}. + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|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.memcache.v1.CloudMemcache#updateParameters}. + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|updateParameters}. * @param error Error, if any * @param [response] Operation */ type UpdateParametersCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#deleteInstance}. + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|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.memcache.v1.CloudMemcache#applyParameters}. + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|applyParameters}. * @param error Error, if any * @param [response] Operation */ @@ -375,6 +375,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 { @@ -473,6 +480,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Node. */ @@ -593,6 +607,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Node + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Node { @@ -701,6 +722,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace InstanceMessage { @@ -834,6 +862,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. */ @@ -936,6 +971,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 GetInstanceRequest. */ @@ -1026,6 +1068,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateInstanceRequest. */ @@ -1128,6 +1177,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 an UpdateInstanceRequest. */ @@ -1224,6 +1280,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 DeleteInstanceRequest. */ @@ -1314,6 +1377,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an ApplyParametersRequest. */ @@ -1416,6 +1486,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplyParametersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateParametersRequest. */ @@ -1518,6 +1595,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateParametersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a MemcacheParameters. */ @@ -1614,6 +1698,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MemcacheParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an OperationMetadata. */ @@ -1740,6 +1831,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; } /** MemcacheVersion enum. */ @@ -1888,56 +1986,56 @@ export namespace google { namespace CloudMemcache { /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#listInstances}. + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|listInstances}. * @param error Error, if any * @param [response] ListInstancesResponse */ type ListInstancesCallback = (error: (Error|null), response?: google.cloud.memcache.v1beta2.ListInstancesResponse) => void; /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#getInstance}. + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|getInstance}. * @param error Error, if any * @param [response] Instance */ type GetInstanceCallback = (error: (Error|null), response?: google.cloud.memcache.v1beta2.Instance) => void; /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#createInstance}. + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|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.memcache.v1beta2.CloudMemcache#updateInstance}. + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|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.memcache.v1beta2.CloudMemcache#updateParameters}. + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|updateParameters}. * @param error Error, if any * @param [response] Operation */ type UpdateParametersCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#deleteInstance}. + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|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.memcache.v1beta2.CloudMemcache#applyParameters}. + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|applyParameters}. * @param error Error, if any * @param [response] Operation */ type ApplyParametersCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#applySoftwareUpdate}. + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|applySoftwareUpdate}. * @param error Error, if any * @param [response] Operation */ @@ -2128,6 +2226,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 { @@ -2226,6 +2331,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Node. */ @@ -2352,6 +2464,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Node + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Node { @@ -2460,6 +2579,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace InstanceMessage { @@ -2593,6 +2719,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. */ @@ -2695,6 +2828,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 GetInstanceRequest. */ @@ -2785,6 +2925,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateInstanceRequest. */ @@ -2887,6 +3034,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 an UpdateInstanceRequest. */ @@ -2983,6 +3137,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 DeleteInstanceRequest. */ @@ -3073,6 +3234,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an ApplyParametersRequest. */ @@ -3175,6 +3343,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplyParametersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateParametersRequest. */ @@ -3277,6 +3452,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateParametersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an ApplySoftwareUpdateRequest. */ @@ -3379,6 +3561,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplySoftwareUpdateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a MemcacheParameters. */ @@ -3475,6 +3664,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MemcacheParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an OperationMetadata. */ @@ -3601,6 +3797,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; } /** MemcacheVersion enum. */ @@ -3697,6 +3900,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ZoneMetadata. */ @@ -3781,6 +3991,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ZoneMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -3883,6 +4100,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. */ @@ -4030,6 +4254,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. */ @@ -4126,6 +4357,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** FieldBehavior enum. */ @@ -4264,6 +4502,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 { @@ -4376,6 +4621,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; } } @@ -4470,6 +4722,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. */ @@ -4510,6 +4769,9 @@ export namespace google { /** FileDescriptorProto syntax */ syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); } /** Represents a FileDescriptorProto. */ @@ -4557,6 +4819,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 @@ -4626,6 +4891,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. */ @@ -4770,6 +5042,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 { @@ -4874,6 +5153,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. */ @@ -4970,6 +5256,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; } } @@ -5061,6 +5354,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. */ @@ -5211,6 +5511,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 { @@ -5339,6 +5646,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. */ @@ -5453,6 +5767,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 { @@ -5551,6 +5872,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; } } @@ -5654,6 +5982,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. */ @@ -5756,6 +6091,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. */ @@ -5876,6 +6218,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. */ @@ -6089,6 +6438,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 { @@ -6216,6 +6572,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. */ @@ -6233,6 +6596,9 @@ export namespace google { /** FieldOptions lazy */ lazy?: (boolean|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + /** FieldOptions deprecated */ deprecated?: (boolean|null); @@ -6270,6 +6636,9 @@ export namespace google { /** FieldOptions lazy. */ public lazy: boolean; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + /** FieldOptions deprecated. */ public deprecated: boolean; @@ -6348,6 +6717,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 { @@ -6455,6 +6831,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. */ @@ -6557,6 +6940,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. */ @@ -6653,6 +7043,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. */ @@ -6755,6 +7152,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. */ @@ -6866,6 +7270,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 { @@ -7002,6 +7413,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 { @@ -7100,6 +7518,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; } } @@ -7191,6 +7616,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 { @@ -7307,6 +7739,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; } } @@ -7398,6 +7837,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 { @@ -7416,6 +7862,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. */ @@ -7439,6 +7888,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 @@ -7508,6 +7960,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 + } } } @@ -7605,6 +8074,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. */ @@ -7701,6 +8177,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. */ @@ -7785,6 +8268,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. */ @@ -7875,6 +8365,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Timestamp. */ @@ -7971,6 +8468,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; } } @@ -8071,35 +8575,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 */ @@ -8221,6 +8725,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. */ @@ -8311,6 +8822,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. */ @@ -8419,6 +8937,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. */ @@ -8515,6 +9040,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. */ @@ -8605,6 +9137,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. */ @@ -8695,6 +9234,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. */ @@ -8791,6 +9337,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. */ @@ -8887,6 +9440,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; } } @@ -8993,6 +9553,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-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index 39bc7154253..f564217308d 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/protos/protos.js @@ -99,7 +99,7 @@ }; /** - * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#listInstances}. + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|listInstances}. * @memberof google.cloud.memcache.v1.CloudMemcache * @typedef ListInstancesCallback * @type {function} @@ -132,7 +132,7 @@ */ /** - * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#getInstance}. + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|getInstance}. * @memberof google.cloud.memcache.v1.CloudMemcache * @typedef GetInstanceCallback * @type {function} @@ -165,7 +165,7 @@ */ /** - * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#createInstance}. + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|createInstance}. * @memberof google.cloud.memcache.v1.CloudMemcache * @typedef CreateInstanceCallback * @type {function} @@ -198,7 +198,7 @@ */ /** - * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#updateInstance}. + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|updateInstance}. * @memberof google.cloud.memcache.v1.CloudMemcache * @typedef UpdateInstanceCallback * @type {function} @@ -231,7 +231,7 @@ */ /** - * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#updateParameters}. + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|updateParameters}. * @memberof google.cloud.memcache.v1.CloudMemcache * @typedef UpdateParametersCallback * @type {function} @@ -264,7 +264,7 @@ */ /** - * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#deleteInstance}. + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|deleteInstance}. * @memberof google.cloud.memcache.v1.CloudMemcache * @typedef DeleteInstanceCallback * @type {function} @@ -297,7 +297,7 @@ */ /** - * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache#applyParameters}. + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|applyParameters}. * @memberof google.cloud.memcache.v1.CloudMemcache * @typedef ApplyParametersCallback * @type {function} @@ -597,79 +597,95 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - 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.displayName = reader.string(); + break; + } + case 3: { + 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 4: { + message.authorizedNetwork = reader.string(); + break; + } + case 5: { + if (!(message.zones && message.zones.length)) + message.zones = []; + message.zones.push(reader.string()); + break; + } + case 6: { + message.nodeCount = reader.int32(); + break; + } + case 7: { + message.nodeConfig = $root.google.cloud.memcache.v1.Instance.NodeConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.memcacheVersion = reader.int32(); + break; + } + case 11: { + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.decode(reader, reader.uint32()); + break; + } + case 12: { + if (!(message.memcacheNodes && message.memcacheNodes.length)) + message.memcacheNodes = []; + message.memcacheNodes.push($root.google.cloud.memcache.v1.Instance.Node.decode(reader, reader.uint32())); + break; + } + case 13: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.state = reader.int32(); + break; + } + case 18: { + message.memcacheFullVersion = reader.string(); + break; + } + case 19: { + if (!(message.instanceMessages && message.instanceMessages.length)) + message.instanceMessages = []; + message.instanceMessages.push($root.google.cloud.memcache.v1.Instance.InstanceMessage.decode(reader, reader.uint32())); + break; + } + case 20: { + message.discoveryEndpoint = reader.string(); + break; } - message.labels[key] = value; - break; - case 4: - message.authorizedNetwork = reader.string(); - break; - case 5: - if (!(message.zones && message.zones.length)) - message.zones = []; - message.zones.push(reader.string()); - break; - case 6: - message.nodeCount = reader.int32(); - break; - case 7: - message.nodeConfig = $root.google.cloud.memcache.v1.Instance.NodeConfig.decode(reader, reader.uint32()); - break; - case 9: - message.memcacheVersion = reader.int32(); - break; - case 11: - message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.decode(reader, reader.uint32()); - break; - case 12: - if (!(message.memcacheNodes && message.memcacheNodes.length)) - message.memcacheNodes = []; - message.memcacheNodes.push($root.google.cloud.memcache.v1.Instance.Node.decode(reader, reader.uint32())); - break; - case 13: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 14: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 15: - message.state = reader.int32(); - break; - case 18: - message.memcacheFullVersion = reader.string(); - break; - case 19: - if (!(message.instanceMessages && message.instanceMessages.length)) - message.instanceMessages = []; - message.instanceMessages.push($root.google.cloud.memcache.v1.Instance.InstanceMessage.decode(reader, reader.uint32())); - break; - case 20: - message.discoveryEndpoint = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -1004,6 +1020,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.memcache.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.memcache.v1.Instance"; + }; + Instance.NodeConfig = (function() { /** @@ -1107,12 +1138,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.cpuCount = reader.int32(); - break; - case 2: - message.memorySizeMb = reader.int32(); - break; + case 1: { + message.cpuCount = reader.int32(); + break; + } + case 2: { + message.memorySizeMb = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -1211,6 +1244,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for NodeConfig + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.Instance.NodeConfig"; + }; + return NodeConfig; })(); @@ -1361,24 +1409,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.nodeId = reader.string(); - break; - case 2: - message.zone = reader.string(); - break; - case 3: - message.state = reader.int32(); - break; - case 4: - message.host = reader.string(); - break; - case 5: - message.port = reader.int32(); - break; - case 6: - message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.decode(reader, reader.uint32()); - break; + case 1: { + message.nodeId = reader.string(); + break; + } + case 2: { + message.zone = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.host = reader.string(); + break; + } + case 5: { + message.port = reader.int32(); + break; + } + case 6: { + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -1542,6 +1596,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Node + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.Instance.Node"; + }; + /** * State enum. * @name google.cloud.memcache.v1.Instance.Node.State @@ -1668,12 +1737,14 @@ 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 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -1785,6 +1856,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for InstanceMessage + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.Instance.InstanceMessage"; + }; + /** * Code enum. * @name google.cloud.memcache.v1.Instance.InstanceMessage.Code @@ -1961,21 +2047,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - case 4: - message.filter = reader.string(); - break; - case 5: - message.orderBy = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -2098,6 +2189,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.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.memcache.v1.ListInstancesRequest"; + }; + return ListInstancesRequest; })(); @@ -2219,19 +2325,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.memcache.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.memcache.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; @@ -2368,6 +2477,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.memcache.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.memcache.v1.ListInstancesResponse"; + }; + return ListInstancesResponse; })(); @@ -2463,9 +2587,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; @@ -2555,6 +2680,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.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.memcache.v1.GetInstanceRequest"; + }; + return GetInstanceRequest; })(); @@ -2672,15 +2812,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.memcache.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.memcache.v1.Instance.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -2792,6 +2935,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.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.memcache.v1.CreateInstanceRequest"; + }; + return CreateInstanceRequest; })(); @@ -2898,12 +3056,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.memcache.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.memcache.v1.Instance.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3012,6 +3172,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.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.memcache.v1.UpdateInstanceRequest"; + }; + return UpdateInstanceRequest; })(); @@ -3107,9 +3282,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; @@ -3199,6 +3375,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.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.memcache.v1.DeleteInstanceRequest"; + }; + return DeleteInstanceRequest; })(); @@ -3318,17 +3509,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.nodeIds && message.nodeIds.length)) - message.nodeIds = []; - message.nodeIds.push(reader.string()); - break; - case 3: - message.applyAll = reader.bool(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.nodeIds && message.nodeIds.length)) + message.nodeIds = []; + message.nodeIds.push(reader.string()); + break; + } + case 3: { + message.applyAll = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -3448,6 +3642,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ApplyParametersRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplyParametersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.ApplyParametersRequest"; + }; + return ApplyParametersRequest; })(); @@ -3565,18 +3774,21 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 3: - message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; } } return message; @@ -3690,6 +3902,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateParametersRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateParametersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.UpdateParametersRequest"; + }; + return UpdateParametersRequest; })(); @@ -3798,31 +4025,33 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 3: - if (message.params === $util.emptyObject) - message.params = {}; - 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.id = reader.string(); + break; + } + case 3: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; } - message.params[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -3935,6 +4164,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MemcacheParameters + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MemcacheParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.MemcacheParameters"; + }; + return MemcacheParameters; })(); @@ -4096,27 +4340,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; @@ -4265,6 +4516,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.OperationMetadata"; + }; + return OperationMetadata; })(); @@ -4327,7 +4593,7 @@ }; /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#listInstances}. + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|listInstances}. * @memberof google.cloud.memcache.v1beta2.CloudMemcache * @typedef ListInstancesCallback * @type {function} @@ -4360,7 +4626,7 @@ */ /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#getInstance}. + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|getInstance}. * @memberof google.cloud.memcache.v1beta2.CloudMemcache * @typedef GetInstanceCallback * @type {function} @@ -4393,7 +4659,7 @@ */ /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#createInstance}. + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|createInstance}. * @memberof google.cloud.memcache.v1beta2.CloudMemcache * @typedef CreateInstanceCallback * @type {function} @@ -4426,7 +4692,7 @@ */ /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#updateInstance}. + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|updateInstance}. * @memberof google.cloud.memcache.v1beta2.CloudMemcache * @typedef UpdateInstanceCallback * @type {function} @@ -4459,7 +4725,7 @@ */ /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#updateParameters}. + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|updateParameters}. * @memberof google.cloud.memcache.v1beta2.CloudMemcache * @typedef UpdateParametersCallback * @type {function} @@ -4492,7 +4758,7 @@ */ /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#deleteInstance}. + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|deleteInstance}. * @memberof google.cloud.memcache.v1beta2.CloudMemcache * @typedef DeleteInstanceCallback * @type {function} @@ -4525,7 +4791,7 @@ */ /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#applyParameters}. + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|applyParameters}. * @memberof google.cloud.memcache.v1beta2.CloudMemcache * @typedef ApplyParametersCallback * @type {function} @@ -4558,7 +4824,7 @@ */ /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache#applySoftwareUpdate}. + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|applySoftwareUpdate}. * @memberof google.cloud.memcache.v1beta2.CloudMemcache * @typedef ApplySoftwareUpdateCallback * @type {function} @@ -4869,82 +5135,99 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - 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.displayName = reader.string(); + break; + } + case 3: { + 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 4: { + message.authorizedNetwork = reader.string(); + break; + } + case 5: { + if (!(message.zones && message.zones.length)) + message.zones = []; + message.zones.push(reader.string()); + break; + } + case 6: { + message.nodeCount = reader.int32(); + break; + } + case 7: { + message.nodeConfig = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.memcacheVersion = reader.int32(); + break; + } + case 11: { + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); + break; + } + case 12: { + if (!(message.memcacheNodes && message.memcacheNodes.length)) + message.memcacheNodes = []; + message.memcacheNodes.push($root.google.cloud.memcache.v1beta2.Instance.Node.decode(reader, reader.uint32())); + break; + } + case 13: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.state = reader.int32(); + break; + } + case 18: { + message.memcacheFullVersion = reader.string(); + break; + } + case 19: { + if (!(message.instanceMessages && message.instanceMessages.length)) + message.instanceMessages = []; + message.instanceMessages.push($root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.decode(reader, reader.uint32())); + break; + } + case 20: { + message.discoveryEndpoint = reader.string(); + break; + } + case 21: { + message.updateAvailable = reader.bool(); + break; } - message.labels[key] = value; - break; - case 4: - message.authorizedNetwork = reader.string(); - break; - case 5: - if (!(message.zones && message.zones.length)) - message.zones = []; - message.zones.push(reader.string()); - break; - case 6: - message.nodeCount = reader.int32(); - break; - case 7: - message.nodeConfig = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.decode(reader, reader.uint32()); - break; - case 9: - message.memcacheVersion = reader.int32(); - break; - case 11: - message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); - break; - case 12: - if (!(message.memcacheNodes && message.memcacheNodes.length)) - message.memcacheNodes = []; - message.memcacheNodes.push($root.google.cloud.memcache.v1beta2.Instance.Node.decode(reader, reader.uint32())); - break; - case 13: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 14: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 15: - message.state = reader.int32(); - break; - case 18: - message.memcacheFullVersion = reader.string(); - break; - case 19: - if (!(message.instanceMessages && message.instanceMessages.length)) - message.instanceMessages = []; - message.instanceMessages.push($root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.decode(reader, reader.uint32())); - break; - case 20: - message.discoveryEndpoint = reader.string(); - break; - case 21: - message.updateAvailable = reader.bool(); - break; default: reader.skipType(tag & 7); break; @@ -5287,6 +5570,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.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.memcache.v1beta2.Instance"; + }; + Instance.NodeConfig = (function() { /** @@ -5390,12 +5688,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.cpuCount = reader.int32(); - break; - case 2: - message.memorySizeMb = reader.int32(); - break; + case 1: { + message.cpuCount = reader.int32(); + break; + } + case 2: { + message.memorySizeMb = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -5494,6 +5794,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for NodeConfig + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.Instance.NodeConfig"; + }; + return NodeConfig; })(); @@ -5655,27 +5970,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.nodeId = reader.string(); - break; - case 2: - message.zone = reader.string(); - break; - case 3: - message.state = reader.int32(); - break; - case 4: - message.host = reader.string(); - break; - case 5: - message.port = reader.int32(); - break; - case 6: - message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); - break; - case 7: - message.updateAvailable = reader.bool(); - break; + case 1: { + message.nodeId = reader.string(); + break; + } + case 2: { + message.zone = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.host = reader.string(); + break; + } + case 5: { + message.port = reader.int32(); + break; + } + case 6: { + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateAvailable = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -5847,6 +6169,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Node + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.Instance.Node"; + }; + /** * State enum. * @name google.cloud.memcache.v1beta2.Instance.Node.State @@ -5973,12 +6310,14 @@ 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 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -6090,6 +6429,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for InstanceMessage + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.Instance.InstanceMessage"; + }; + /** * Code enum. * @name google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code @@ -6266,21 +6620,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - case 4: - message.filter = reader.string(); - break; - case 5: - message.orderBy = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -6403,6 +6762,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.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.memcache.v1beta2.ListInstancesRequest"; + }; + return ListInstancesRequest; })(); @@ -6524,19 +6898,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.resources && message.resources.length)) - message.resources = []; - message.resources.push($root.google.cloud.memcache.v1beta2.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.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.memcache.v1beta2.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; @@ -6673,6 +7050,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.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.memcache.v1beta2.ListInstancesResponse"; + }; + return ListInstancesResponse; })(); @@ -6768,9 +7160,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; @@ -6860,10 +7253,25 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetInstanceRequest; - })(); - - v1beta2.CreateInstanceRequest = (function() { + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.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.memcache.v1beta2.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v1beta2.CreateInstanceRequest = (function() { /** * Properties of a CreateInstanceRequest. @@ -6977,15 +7385,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.resource = $root.google.cloud.memcache.v1beta2.Instance.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.resource = $root.google.cloud.memcache.v1beta2.Instance.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7097,6 +7508,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.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.memcache.v1beta2.CreateInstanceRequest"; + }; + return CreateInstanceRequest; })(); @@ -7203,12 +7629,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.resource = $root.google.cloud.memcache.v1beta2.Instance.decode(reader, reader.uint32()); - break; + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.resource = $root.google.cloud.memcache.v1beta2.Instance.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7317,6 +7745,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.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.memcache.v1beta2.UpdateInstanceRequest"; + }; + return UpdateInstanceRequest; })(); @@ -7412,9 +7855,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; @@ -7504,6 +7948,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.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.memcache.v1beta2.DeleteInstanceRequest"; + }; + return DeleteInstanceRequest; })(); @@ -7623,17 +8082,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.nodeIds && message.nodeIds.length)) - message.nodeIds = []; - message.nodeIds.push(reader.string()); - break; - case 3: - message.applyAll = reader.bool(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.nodeIds && message.nodeIds.length)) + message.nodeIds = []; + message.nodeIds.push(reader.string()); + break; + } + case 3: { + message.applyAll = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -7753,6 +8215,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ApplyParametersRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplyParametersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.ApplyParametersRequest"; + }; + return ApplyParametersRequest; })(); @@ -7870,15 +8347,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 3: - message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7995,6 +8475,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateParametersRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateParametersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.UpdateParametersRequest"; + }; + return UpdateParametersRequest; })(); @@ -8114,17 +8609,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.instance = reader.string(); - break; - case 2: - if (!(message.nodeIds && message.nodeIds.length)) - message.nodeIds = []; - message.nodeIds.push(reader.string()); - break; - case 3: - message.applyAll = reader.bool(); - break; + case 1: { + message.instance = reader.string(); + break; + } + case 2: { + if (!(message.nodeIds && message.nodeIds.length)) + message.nodeIds = []; + message.nodeIds.push(reader.string()); + break; + } + case 3: { + message.applyAll = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -8244,6 +8742,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ApplySoftwareUpdateRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplySoftwareUpdateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest"; + }; + return ApplySoftwareUpdateRequest; })(); @@ -8352,31 +8865,33 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 3: - if (message.params === $util.emptyObject) - message.params = {}; - 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.id = reader.string(); + break; + } + case 3: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; } - message.params[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -8489,6 +9004,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MemcacheParameters + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MemcacheParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.MemcacheParameters"; + }; + return MemcacheParameters; })(); @@ -8650,27 +9180,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; @@ -8819,6 +9356,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.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.memcache.v1beta2.OperationMetadata"; + }; + return OperationMetadata; })(); @@ -8932,28 +9484,29 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (message.availableZones === $util.emptyObject) - message.availableZones = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.memcache.v1beta2.ZoneMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + if (message.availableZones === $util.emptyObject) + message.availableZones = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.memcache.v1beta2.ZoneMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.availableZones[key] = value; + break; } - message.availableZones[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -9062,6 +9615,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for LocationMetadata + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.LocationMetadata"; + }; + return LocationMetadata; })(); @@ -9222,6 +9790,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ZoneMetadata + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ZoneMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.ZoneMetadata"; + }; + return ZoneMetadata; })(); @@ -9348,14 +9931,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; @@ -9471,6 +10056,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; })(); @@ -9681,38 +10281,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; @@ -9934,6 +10544,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; })(); @@ -10040,12 +10665,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; @@ -10144,6 +10771,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; })(); @@ -10338,36 +10980,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; @@ -10565,6 +11214,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 @@ -10701,12 +11365,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; @@ -10805,6 +11471,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; })(); @@ -10914,11 +11595,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; @@ -11025,6 +11707,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + return FileDescriptorSet; })(); @@ -11046,6 +11743,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 */ /** @@ -11166,6 +11864,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 @@ -11221,6 +11927,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; }; @@ -11255,66 +11963,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; @@ -11426,6 +12150,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; }; @@ -11518,6 +12245,8 @@ } if (object.syntax != null) message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); return message; }; @@ -11549,6 +12278,7 @@ object.options = null; object.sourceCodeInfo = null; object.syntax = ""; + object.edition = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -11595,6 +12325,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; }; @@ -11609,6 +12341,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; })(); @@ -11819,52 +12566,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; @@ -12165,6 +12922,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() { /** @@ -12279,15 +13051,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; @@ -12399,6 +13174,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; })(); @@ -12505,12 +13295,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; @@ -12609,6 +13401,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; })(); @@ -12709,11 +13516,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; @@ -12820,6 +13628,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; })(); @@ -13025,39 +13848,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; @@ -13344,6 +14178,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 @@ -13512,12 +14361,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; @@ -13621,6 +14472,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; })(); @@ -13766,27 +14632,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; @@ -13962,6 +14833,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() { /** @@ -14065,12 +14951,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; @@ -14169,6 +15057,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; })(); @@ -14289,15 +15192,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; @@ -14409,6 +15315,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; })(); @@ -14528,17 +15449,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; @@ -14668,6 +15592,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; })(); @@ -14818,24 +15757,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; @@ -14971,6 +15916,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; })(); @@ -15301,76 +16261,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; @@ -15683,6 +16665,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 @@ -15851,26 +16848,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; @@ -16024,6 +17027,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; })(); @@ -16037,6 +17055,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 @@ -16093,6 +17112,14 @@ */ FieldOptions.prototype.lazy = false; + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + /** * FieldOptions deprecated. * @member {boolean} deprecated @@ -16169,6 +17196,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(); @@ -16214,42 +17243,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; @@ -16309,6 +17351,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"; @@ -16394,6 +17439,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) @@ -16481,6 +17528,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")) @@ -16495,6 +17543,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) @@ -16521,6 +17571,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 @@ -16650,11 +17715,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; @@ -16761,6 +17827,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; })(); @@ -16880,17 +17961,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; @@ -17015,6 +18099,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; })(); @@ -17123,14 +18222,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; @@ -17246,6 +18347,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; })(); @@ -17376,20 +18492,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; @@ -17522,6 +18642,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + return ServiceOptions; })(); @@ -17676,28 +18811,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; @@ -17887,6 +19028,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 @@ -18066,29 +19222,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; @@ -18201,7 +19364,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); @@ -18282,6 +19445,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() { /** @@ -18383,12 +19561,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; @@ -18489,6 +19669,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; })(); @@ -18589,11 +19784,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; @@ -18700,6 +19896,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() { /** @@ -18848,37 +20059,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; @@ -19039,6 +20255,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; })(); @@ -19139,11 +20370,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; @@ -19250,6 +20482,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() { /** @@ -19260,6 +20507,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 */ /** @@ -19310,6 +20558,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 @@ -19346,6 +20602,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; }; @@ -19379,26 +20637,34 @@ 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) + 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()); - } 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; @@ -19450,6 +20716,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; }; @@ -19478,6 +20753,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; }; @@ -19500,6 +20789,7 @@ object.sourceFile = ""; object.begin = 0; object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; @@ -19512,6 +20802,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; }; @@ -19526,6 +20818,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; })(); @@ -19635,12 +20958,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; @@ -19702,7 +21027,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; }; @@ -19748,6 +21073,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; })(); @@ -19854,12 +21194,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; @@ -19972,6 +21314,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; })(); @@ -20132,6 +21489,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; })(); @@ -20229,11 +21601,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -20335,6 +21708,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; })(); @@ -20441,12 +21829,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; @@ -20559,6 +21949,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; })(); @@ -20607,7 +22012,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} @@ -20640,7 +22045,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} @@ -20673,7 +22078,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} @@ -20706,7 +22111,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} @@ -20739,7 +22144,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} @@ -20924,21 +22329,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; @@ -21089,6 +22499,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; })(); @@ -21184,9 +22609,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; @@ -21276,6 +22702,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; })(); @@ -21404,18 +22845,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; @@ -21530,6 +22975,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; })(); @@ -21638,14 +23098,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; @@ -21761,6 +23223,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; })(); @@ -21856,9 +23333,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; @@ -21948,6 +23426,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; })(); @@ -22043,9 +23536,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; @@ -22135,6 +23629,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; })(); @@ -22241,12 +23750,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; @@ -22350,6 +23861,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; })(); @@ -22456,12 +23982,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; @@ -22560,6 +24088,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; })(); @@ -22691,17 +24234,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; @@ -22826,6 +24372,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-memcache/protos/protos.json b/packages/google-cloud-memcache/protos/protos.json index 23c51758194..c2caeed30cd 100644 --- a/packages/google-cloud-memcache/protos/protos.json +++ b/packages/google-cloud-memcache/protos/protos.json @@ -1642,6 +1642,10 @@ "syntax": { "type": "string", "id": 12 + }, + "edition": { + "type": "string", + "id": 13 } } }, @@ -2170,6 +2174,13 @@ "default": false } }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, "deprecated": { "type": "bool", "id": 3, @@ -2462,6 +2473,19 @@ "end": { "type": "int32", "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } } } } From 516a281b28747389da2586c09397f2a172b5ef33 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 05:08:19 +0000 Subject: [PATCH 132/152] fix: do not import the whole google-gax from proto JS (#1553) (#215) 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-memcache/package.json | 2 +- packages/google-cloud-memcache/protos/protos.d.ts | 2 +- packages/google-cloud-memcache/protos/protos.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 4cec64c05e1..0d1e9af5106 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^3.0.1" + "google-gax": "^3.3.0" }, "devDependencies": { "@types/mocha": "^9.0.0", diff --git a/packages/google-cloud-memcache/protos/protos.d.ts b/packages/google-cloud-memcache/protos/protos.d.ts index 110c52d40b2..2c69b262247 100644 --- a/packages/google-cloud-memcache/protos/protos.d.ts +++ b/packages/google-cloud-memcache/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-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index f564217308d..1bfd3472dea 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/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 a90daab6adc4deb9e18b5f1b3fe04e9d8eb2c5df Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 8 Sep 2022 16:52:03 -0400 Subject: [PATCH 133/152] chore(main): release 2.1.1 (#212) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 2.1.1 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-memcache/CHANGELOG.md | 11 +++++++++++ packages/google-cloud-memcache/package.json | 2 +- .../v1/snippet_metadata.google.cloud.memcache.v1.json | 2 +- ...nippet_metadata.google.cloud.memcache.v1beta2.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index cdc67be2bee..948c4b8c46d 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [2.1.1](https://github.com/googleapis/nodejs-memcache/compare/v2.1.0...v2.1.1) (2022-08-27) + + +### Bug Fixes + +* better support for fallback mode ([#209](https://github.com/googleapis/nodejs-memcache/issues/209)) ([8398c52](https://github.com/googleapis/nodejs-memcache/commit/8398c52666aca0a251852edc3b3d341bdfa11902)) +* change import long to require ([#211](https://github.com/googleapis/nodejs-memcache/issues/211)) ([9139124](https://github.com/googleapis/nodejs-memcache/commit/91391240a20101ef11b1805973bd772fda8edabe)) +* do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-memcache/issues/1553)) ([#215](https://github.com/googleapis/nodejs-memcache/issues/215)) ([12ee008](https://github.com/googleapis/nodejs-memcache/commit/12ee00812abedba79271ea2dd97e042e1cab22bf)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-memcache/issues/1546)) ([#214](https://github.com/googleapis/nodejs-memcache/issues/214)) ([35b9a7b](https://github.com/googleapis/nodejs-memcache/commit/35b9a7bef37482d3f7209c16b6cd87fab0f72ea8)) +* use google-gax v3.3.0 ([12ee008](https://github.com/googleapis/nodejs-memcache/commit/12ee00812abedba79271ea2dd97e042e1cab22bf)) + ## [2.1.0](https://github.com/googleapis/nodejs-memcache/compare/v2.0.0...v2.1.0) (2022-06-30) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 0d1e9af5106..8bd98389877 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "2.1.0", + "version": "2.1.1", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json index e76e5f45a0f..6d739e2e85b 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json +++ b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-memcache", - "version": "2.1.0", + "version": "2.1.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json index 0ef2cc40f06..eb679216554 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-memcache", - "version": "2.1.0", + "version": "2.1.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index a87bdd7a13d..66377fa000f 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^2.1.0" + "@google-cloud/memcache": "^2.1.1" }, "devDependencies": { "c8": "^7.0.0", From 470bcecc8c190c3a9d38bafc4726724c541c7c84 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 8 Sep 2022 14:42:56 -0700 Subject: [PATCH 134/152] fix: allow passing gax instance to client constructor (#216) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: use _gaxModule when accessing gax for bundling 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 * 🦉 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 Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> Co-authored-by: Benjamin E. Coe --- .../src/v1/cloud_memcache_client.ts | 90 +++++++++------- .../src/v1beta2/cloud_memcache_client.ts | 101 +++++++++++------- 2 files changed, 114 insertions(+), 77 deletions(-) diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts index 136647e2256..510c6d29597 100644 --- a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_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_memcache_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -113,8 +111,18 @@ export class CloudMemcacheClient { * 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 CloudMemcacheClient({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 CloudMemcacheClient; const servicePath = @@ -134,8 +142,13 @@ export class CloudMemcacheClient { 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); @@ -286,7 +299,7 @@ export class CloudMemcacheClient { 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; } /** @@ -496,7 +509,7 @@ export class CloudMemcacheClient { 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(); @@ -615,7 +628,7 @@ export class CloudMemcacheClient { 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(); @@ -641,11 +654,12 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings() @@ -756,7 +770,7 @@ export class CloudMemcacheClient { 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(); @@ -782,11 +796,12 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings() @@ -900,7 +915,7 @@ export class CloudMemcacheClient { 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(); @@ -926,11 +941,12 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.updateParameters, this._gaxModule.createDefaultBackoffSettings() @@ -1039,7 +1055,7 @@ export class CloudMemcacheClient { 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(); @@ -1065,11 +1081,12 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.deleteInstance, this._gaxModule.createDefaultBackoffSettings() @@ -1184,7 +1201,7 @@ export class CloudMemcacheClient { 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(); @@ -1210,11 +1227,12 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.applyParameters, this._gaxModule.createDefaultBackoffSettings() @@ -1324,7 +1342,7 @@ export class CloudMemcacheClient { 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(); @@ -1376,7 +1394,7 @@ export class CloudMemcacheClient { 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']; @@ -1437,7 +1455,7 @@ export class CloudMemcacheClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listInstances']; diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index 1dff9d7c8e2..ef200e6c44e 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_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_memcache_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -113,8 +111,18 @@ export class CloudMemcacheClient { * 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 CloudMemcacheClient({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 CloudMemcacheClient; const servicePath = @@ -134,8 +142,13 @@ export class CloudMemcacheClient { 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); @@ -323,7 +336,7 @@ export class CloudMemcacheClient { 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; } /** @@ -540,7 +553,7 @@ export class CloudMemcacheClient { 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(); @@ -659,7 +672,7 @@ export class CloudMemcacheClient { 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(); @@ -685,11 +698,12 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1beta2.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() @@ -800,7 +814,7 @@ export class CloudMemcacheClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'resource.name': request.resource!.name || '', }); this.initialize(); @@ -826,11 +840,12 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1beta2.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() @@ -945,7 +960,7 @@ export class CloudMemcacheClient { 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(); @@ -971,11 +986,12 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1beta2.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.updateParameters, this._gaxModule.createDefaultBackoffSettings() @@ -1084,7 +1100,7 @@ export class CloudMemcacheClient { 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(); @@ -1110,11 +1126,12 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1beta2.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() @@ -1229,7 +1246,7 @@ export class CloudMemcacheClient { 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(); @@ -1255,11 +1272,12 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1beta2.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.applyParameters, this._gaxModule.createDefaultBackoffSettings() @@ -1374,7 +1392,7 @@ export class CloudMemcacheClient { 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: request.instance || '', }); this.initialize(); @@ -1400,11 +1418,12 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1beta2.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.applySoftwareUpdate, this._gaxModule.createDefaultBackoffSettings() @@ -1519,7 +1538,7 @@ export class CloudMemcacheClient { 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(); @@ -1570,7 +1589,7 @@ export class CloudMemcacheClient { 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']; @@ -1630,7 +1649,7 @@ export class CloudMemcacheClient { 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']; From fd0ff8ac2bfc02ea54bb723b4afe16c13a0d27ad Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 21 Sep 2022 10:18:51 -0700 Subject: [PATCH 135/152] fix: preserve default values in x-goog-request-params header (#218) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-typescript v2.17.0 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 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 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 --- .../src/v1/cloud_memcache_client.ts | 18 +- .../src/v1beta2/cloud_memcache_client.ts | 20 +- .../test/gapic_cloud_memcache_v1.ts | 833 +++++++-------- .../test/gapic_cloud_memcache_v1beta2.ts | 945 +++++++++--------- 4 files changed, 947 insertions(+), 869 deletions(-) diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts index 510c6d29597..00f877309a4 100644 --- a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts @@ -510,7 +510,7 @@ export class CloudMemcacheClient { 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); @@ -629,7 +629,7 @@ export class CloudMemcacheClient { 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); @@ -771,7 +771,7 @@ export class CloudMemcacheClient { 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); @@ -916,7 +916,7 @@ export class CloudMemcacheClient { 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.updateParameters(request, options, callback); @@ -1056,7 +1056,7 @@ export class CloudMemcacheClient { 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); @@ -1202,7 +1202,7 @@ export class CloudMemcacheClient { 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.applyParameters(request, options, callback); @@ -1343,7 +1343,7 @@ export class CloudMemcacheClient { 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); @@ -1395,7 +1395,7 @@ export class CloudMemcacheClient { 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); @@ -1456,7 +1456,7 @@ export class CloudMemcacheClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index ef200e6c44e..4f1dbf3c923 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -554,7 +554,7 @@ export class CloudMemcacheClient { 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); @@ -673,7 +673,7 @@ export class CloudMemcacheClient { 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); @@ -815,7 +815,7 @@ export class CloudMemcacheClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'resource.name': request.resource!.name || '', + 'resource.name': request.resource!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateInstance(request, options, callback); @@ -961,7 +961,7 @@ export class CloudMemcacheClient { 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.updateParameters(request, options, callback); @@ -1101,7 +1101,7 @@ export class CloudMemcacheClient { 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); @@ -1247,7 +1247,7 @@ export class CloudMemcacheClient { 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.applyParameters(request, options, callback); @@ -1393,7 +1393,7 @@ export class CloudMemcacheClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - instance: request.instance || '', + instance: request.instance ?? '', }); this.initialize(); return this.innerApiCalls.applySoftwareUpdate(request, options, callback); @@ -1539,7 +1539,7 @@ export class CloudMemcacheClient { 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); @@ -1590,7 +1590,7 @@ export class CloudMemcacheClient { 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); @@ -1650,7 +1650,7 @@ export class CloudMemcacheClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts index 1a943b358d9..16220391357 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_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 @@ -254,26 +269,26 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.GetInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.memcache.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 () => { @@ -285,15 +300,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.GetInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.memcache.v1.Instance() ); @@ -316,11 +328,14 @@ describe('v1.CloudMemcacheClient', () => { }); 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 () => { @@ -332,26 +347,26 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.GetInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.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 () => { @@ -363,7 +378,11 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.GetInstanceRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getInstance(request), expectedError); @@ -380,15 +399,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.CreateInstanceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -397,11 +413,14 @@ describe('v1.CloudMemcacheClient', () => { 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 () => { @@ -413,15 +432,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.CreateInstanceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -451,11 +467,14 @@ describe('v1.CloudMemcacheClient', () => { >; 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 () => { @@ -467,26 +486,26 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.CreateInstanceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.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 () => { @@ -498,15 +517,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.CreateInstanceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createInstance = stubLongRunningCall( undefined, @@ -515,11 +531,14 @@ describe('v1.CloudMemcacheClient', () => { ); 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 () => { @@ -574,16 +593,13 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.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( + '.google.cloud.memcache.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -592,11 +608,14 @@ describe('v1.CloudMemcacheClient', () => { 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 () => { @@ -608,16 +627,13 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.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( + '.google.cloud.memcache.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -647,11 +663,14 @@ describe('v1.CloudMemcacheClient', () => { >; 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 () => { @@ -663,27 +682,27 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.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( + '.google.cloud.memcache.v1.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 () => { @@ -695,16 +714,13 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.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( + '.google.cloud.memcache.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, @@ -713,11 +729,14 @@ describe('v1.CloudMemcacheClient', () => { ); 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 () => { @@ -772,15 +791,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.UpdateParametersRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.UpdateParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -789,11 +805,14 @@ describe('v1.CloudMemcacheClient', () => { const [operation] = await client.updateParameters(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateParameters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateParameters without error using callback', async () => { @@ -805,15 +824,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.UpdateParametersRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.UpdateParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -843,11 +859,14 @@ describe('v1.CloudMemcacheClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateParameters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateParameters with call error', async () => { @@ -859,26 +878,26 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.UpdateParametersRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.UpdateParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateParameters = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.updateParameters(request), expectedError); - assert( - (client.innerApiCalls.updateParameters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateParameters with LRO error', async () => { @@ -890,15 +909,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.UpdateParametersRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.UpdateParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateParameters = stubLongRunningCall( undefined, @@ -907,11 +923,14 @@ describe('v1.CloudMemcacheClient', () => { ); const [operation] = await client.updateParameters(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateParameters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateParametersProgress without error', async () => { @@ -966,15 +985,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.DeleteInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -983,11 +999,14 @@ describe('v1.CloudMemcacheClient', () => { 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 () => { @@ -999,15 +1018,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.DeleteInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1037,11 +1053,14 @@ describe('v1.CloudMemcacheClient', () => { >; 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 () => { @@ -1053,26 +1072,26 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.DeleteInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.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 () => { @@ -1084,15 +1103,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.DeleteInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, @@ -1101,11 +1117,14 @@ describe('v1.CloudMemcacheClient', () => { ); 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 () => { @@ -1160,15 +1179,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.ApplyParametersRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ApplyParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1177,11 +1193,14 @@ describe('v1.CloudMemcacheClient', () => { const [operation] = await client.applyParameters(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.applyParameters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes applyParameters without error using callback', async () => { @@ -1193,15 +1212,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.ApplyParametersRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ApplyParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1231,11 +1247,14 @@ describe('v1.CloudMemcacheClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.applyParameters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes applyParameters with call error', async () => { @@ -1247,26 +1266,26 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.ApplyParametersRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ApplyParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.applyParameters = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.applyParameters(request), expectedError); - assert( - (client.innerApiCalls.applyParameters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes applyParameters with LRO error', async () => { @@ -1278,15 +1297,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.ApplyParametersRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ApplyParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.applyParameters = stubLongRunningCall( undefined, @@ -1295,11 +1311,14 @@ describe('v1.CloudMemcacheClient', () => { ); const [operation] = await client.applyParameters(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.applyParameters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkApplyParametersProgress without error', async () => { @@ -1354,15 +1373,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), @@ -1371,11 +1387,14 @@ describe('v1.CloudMemcacheClient', () => { 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 () => { @@ -1387,15 +1406,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), @@ -1420,11 +1436,14 @@ describe('v1.CloudMemcacheClient', () => { }); 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 () => { @@ -1436,26 +1455,26 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.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 () => { @@ -1467,8 +1486,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), @@ -1499,11 +1522,12 @@ describe('v1.CloudMemcacheClient', () => { .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 + ) ); }); @@ -1516,8 +1540,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1543,11 +1571,12 @@ describe('v1.CloudMemcacheClient', () => { .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 + ) ); }); @@ -1560,8 +1589,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), @@ -1581,11 +1614,12 @@ describe('v1.CloudMemcacheClient', () => { ).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 + ) ); }); @@ -1598,8 +1632,12 @@ describe('v1.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1616,11 +1654,12 @@ describe('v1.CloudMemcacheClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listInstances.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts index 976fdcce549..d6c1f112fdf 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.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 @@ -254,26 +269,26 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.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 () => { @@ -285,15 +300,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.Instance() ); @@ -316,11 +328,14 @@ describe('v1beta2.CloudMemcacheClient', () => { }); 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 () => { @@ -332,26 +347,26 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.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 () => { @@ -363,7 +378,11 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getInstance(request), expectedError); @@ -380,15 +399,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.CreateInstanceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -397,11 +413,14 @@ describe('v1beta2.CloudMemcacheClient', () => { 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 () => { @@ -413,15 +432,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.CreateInstanceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -451,11 +467,14 @@ describe('v1beta2.CloudMemcacheClient', () => { >; 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 () => { @@ -467,26 +486,26 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.CreateInstanceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.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 () => { @@ -498,15 +517,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.CreateInstanceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createInstance = stubLongRunningCall( undefined, @@ -515,11 +531,14 @@ describe('v1beta2.CloudMemcacheClient', () => { ); 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 () => { @@ -574,16 +593,13 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() ); - request.resource = {}; - request.resource.name = ''; - const expectedHeaderRequestParams = 'resource.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.resource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.UpdateInstanceRequest', + ['resource', 'name'] + ); + request.resource.name = defaultValue1; + const expectedHeaderRequestParams = `resource.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -592,11 +608,14 @@ describe('v1beta2.CloudMemcacheClient', () => { 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 () => { @@ -608,16 +627,13 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() ); - request.resource = {}; - request.resource.name = ''; - const expectedHeaderRequestParams = 'resource.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.resource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.UpdateInstanceRequest', + ['resource', 'name'] + ); + request.resource.name = defaultValue1; + const expectedHeaderRequestParams = `resource.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -647,11 +663,14 @@ describe('v1beta2.CloudMemcacheClient', () => { >; 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 () => { @@ -663,27 +682,27 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() ); - request.resource = {}; - request.resource.name = ''; - const expectedHeaderRequestParams = 'resource.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.resource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.UpdateInstanceRequest', + ['resource', 'name'] + ); + request.resource.name = defaultValue1; + const expectedHeaderRequestParams = `resource.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 () => { @@ -695,16 +714,13 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() ); - request.resource = {}; - request.resource.name = ''; - const expectedHeaderRequestParams = 'resource.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.resource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.UpdateInstanceRequest', + ['resource', 'name'] + ); + request.resource.name = defaultValue1; + const expectedHeaderRequestParams = `resource.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, @@ -713,11 +729,14 @@ describe('v1beta2.CloudMemcacheClient', () => { ); 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 () => { @@ -772,15 +791,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.UpdateParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -789,11 +805,14 @@ describe('v1beta2.CloudMemcacheClient', () => { const [operation] = await client.updateParameters(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateParameters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateParameters without error using callback', async () => { @@ -805,15 +824,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.UpdateParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -843,11 +859,14 @@ describe('v1beta2.CloudMemcacheClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateParameters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateParameters with call error', async () => { @@ -859,26 +878,26 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.UpdateParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateParameters = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.updateParameters(request), expectedError); - assert( - (client.innerApiCalls.updateParameters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateParameters with LRO error', async () => { @@ -890,15 +909,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.UpdateParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateParameters = stubLongRunningCall( undefined, @@ -907,11 +923,14 @@ describe('v1beta2.CloudMemcacheClient', () => { ); const [operation] = await client.updateParameters(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateParameters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateParametersProgress without error', async () => { @@ -966,15 +985,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.DeleteInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -983,11 +999,14 @@ describe('v1beta2.CloudMemcacheClient', () => { 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 () => { @@ -999,15 +1018,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.DeleteInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1037,11 +1053,14 @@ describe('v1beta2.CloudMemcacheClient', () => { >; 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 () => { @@ -1053,26 +1072,26 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.DeleteInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.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 () => { @@ -1084,15 +1103,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.DeleteInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, @@ -1101,11 +1117,14 @@ describe('v1beta2.CloudMemcacheClient', () => { ); 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 () => { @@ -1160,15 +1179,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ApplyParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1177,11 +1193,14 @@ describe('v1beta2.CloudMemcacheClient', () => { const [operation] = await client.applyParameters(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.applyParameters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes applyParameters without error using callback', async () => { @@ -1193,15 +1212,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ApplyParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1231,11 +1247,14 @@ describe('v1beta2.CloudMemcacheClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.applyParameters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes applyParameters with call error', async () => { @@ -1247,26 +1266,26 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ApplyParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.applyParameters = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.applyParameters(request), expectedError); - assert( - (client.innerApiCalls.applyParameters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes applyParameters with LRO error', async () => { @@ -1278,15 +1297,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ApplyParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.applyParameters = stubLongRunningCall( undefined, @@ -1295,11 +1311,14 @@ describe('v1beta2.CloudMemcacheClient', () => { ); const [operation] = await client.applyParameters(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.applyParameters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkApplyParametersProgress without error', async () => { @@ -1354,15 +1373,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest() ); - request.instance = ''; - const expectedHeaderRequestParams = 'instance='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest', + ['instance'] + ); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1371,11 +1387,14 @@ describe('v1beta2.CloudMemcacheClient', () => { const [operation] = await client.applySoftwareUpdate(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.applySoftwareUpdate as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.applySoftwareUpdate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applySoftwareUpdate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes applySoftwareUpdate without error using callback', async () => { @@ -1387,15 +1406,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest() ); - request.instance = ''; - const expectedHeaderRequestParams = 'instance='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest', + ['instance'] + ); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1425,11 +1441,14 @@ describe('v1beta2.CloudMemcacheClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.applySoftwareUpdate as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.applySoftwareUpdate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applySoftwareUpdate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes applySoftwareUpdate with call error', async () => { @@ -1441,26 +1460,26 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest() ); - request.instance = ''; - const expectedHeaderRequestParams = 'instance='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest', + ['instance'] + ); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.applySoftwareUpdate = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.applySoftwareUpdate(request), expectedError); - assert( - (client.innerApiCalls.applySoftwareUpdate as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.applySoftwareUpdate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applySoftwareUpdate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes applySoftwareUpdate with LRO error', async () => { @@ -1472,15 +1491,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest() ); - request.instance = ''; - const expectedHeaderRequestParams = 'instance='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest', + ['instance'] + ); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.applySoftwareUpdate = stubLongRunningCall( undefined, @@ -1489,11 +1505,14 @@ describe('v1beta2.CloudMemcacheClient', () => { ); const [operation] = await client.applySoftwareUpdate(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.applySoftwareUpdate as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.applySoftwareUpdate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applySoftwareUpdate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkApplySoftwareUpdateProgress without error', async () => { @@ -1548,15 +1567,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.memcache.v1beta2.Instance() @@ -1571,11 +1587,14 @@ describe('v1beta2.CloudMemcacheClient', () => { 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 () => { @@ -1587,15 +1606,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.memcache.v1beta2.Instance() @@ -1626,11 +1642,14 @@ describe('v1beta2.CloudMemcacheClient', () => { }); 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 () => { @@ -1642,26 +1661,26 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.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 () => { @@ -1673,8 +1692,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.memcache.v1beta2.Instance() @@ -1711,11 +1734,12 @@ describe('v1beta2.CloudMemcacheClient', () => { .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 + ) ); }); @@ -1728,8 +1752,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1755,11 +1783,12 @@ describe('v1beta2.CloudMemcacheClient', () => { .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 + ) ); }); @@ -1772,8 +1801,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.memcache.v1beta2.Instance() @@ -1799,11 +1832,12 @@ describe('v1beta2.CloudMemcacheClient', () => { ).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 + ) ); }); @@ -1816,8 +1850,12 @@ describe('v1beta2.CloudMemcacheClient', () => { const request = generateSampleMessage( new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1834,11 +1872,12 @@ describe('v1beta2.CloudMemcacheClient', () => { ).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 + ) ); }); }); From ee9bafa5bfb1951d160ec96630f2f6270f2f0bfc Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 14:49:48 -0700 Subject: [PATCH 136/152] chore(main): release 2.1.2 (#217) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 2.1.2 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-memcache/CHANGELOG.md | 8 ++++++++ packages/google-cloud-memcache/package.json | 2 +- .../v1/snippet_metadata.google.cloud.memcache.v1.json | 2 +- .../snippet_metadata.google.cloud.memcache.v1beta2.json | 2 +- packages/google-cloud-memcache/samples/package.json | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md index 948c4b8c46d..4cb7bd0d31c 100644 --- a/packages/google-cloud-memcache/CHANGELOG.md +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.1.2](https://github.com/googleapis/nodejs-memcache/compare/v2.1.1...v2.1.2) (2022-09-21) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#216](https://github.com/googleapis/nodejs-memcache/issues/216)) ([6d5a65a](https://github.com/googleapis/nodejs-memcache/commit/6d5a65a5fd0881e38d72083aefc614bdd2360f19)) +* Preserve default values in x-goog-request-params header ([#218](https://github.com/googleapis/nodejs-memcache/issues/218)) ([8d8c968](https://github.com/googleapis/nodejs-memcache/commit/8d8c96866345800625f01edee0c42a675710fa22)) + ## [2.1.1](https://github.com/googleapis/nodejs-memcache/compare/v2.1.0...v2.1.1) (2022-08-27) diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 8bd98389877..71d2163e57f 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/memcache", - "version": "2.1.1", + "version": "2.1.2", "description": "Memcache client for Node.js", "repository": "googleapis/nodejs-memcache", "license": "Apache-2.0", diff --git a/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json index 6d739e2e85b..1f01c932f6d 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json +++ b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-memcache", - "version": "2.1.1", + "version": "2.1.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json index eb679216554..54f71cd0a47 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-memcache", - "version": "2.1.1", + "version": "2.1.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json index 66377fa000f..f1d56b70aca 100644 --- a/packages/google-cloud-memcache/samples/package.json +++ b/packages/google-cloud-memcache/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/memcache": "^2.1.1" + "@google-cloud/memcache": "^2.1.2" }, "devDependencies": { "c8": "^7.0.0", From cc0c739456e5c46c969de1773b814c786e2983d2 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Wed, 12 Oct 2022 21:19:07 -0700 Subject: [PATCH 137/152] build: add release-please config, fix owlbot-config --- .release-please-manifest.json | 1 + .../{.github => }/.OwlBot.yaml | 6 +- packages/google-cloud-memcache/.mocharc.js | 2 +- packages/google-cloud-memcache/.prettierrc.js | 2 +- .../google-cloud-memcache/.repo-metadata.json | 2 +- packages/google-cloud-memcache/README.md | 30 +- packages/google-cloud-memcache/package.json | 4 +- .../google-cloud-memcache/samples/README.md | 300 +++++++++++++++++- packages/google-cloud-memcache/src/index.ts | 2 +- release-please-config.json | 1 + 10 files changed, 327 insertions(+), 23 deletions(-) rename packages/google-cloud-memcache/{.github => }/.OwlBot.yaml (81%) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 78516e1997d..504bf435411 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -12,6 +12,7 @@ "packages/google-cloud-bigquery-datatransfer": "3.1.3", "packages/google-cloud-gkemulticloud": "0.1.2", "packages/google-cloud-language": "5.1.0", + "packages/google-cloud-memcache": "2.1.2", "packages/google-cloud-oslogin": "4.0.2", "packages/google-cloud-phishingprotection": "3.0.4", "packages/google-cloud-redis": "3.1.3", diff --git a/packages/google-cloud-memcache/.github/.OwlBot.yaml b/packages/google-cloud-memcache/.OwlBot.yaml similarity index 81% rename from packages/google-cloud-memcache/.github/.OwlBot.yaml rename to packages/google-cloud-memcache/.OwlBot.yaml index 108d0937087..071e80b2305 100644 --- a/packages/google-cloud-memcache/.github/.OwlBot.yaml +++ b/packages/google-cloud-memcache/.OwlBot.yaml @@ -11,15 +11,13 @@ # WITHOUT 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/memcache/(.*)/.*-nodejs/(.*) - dest: /owl-bot-staging/$1/$2 + - source: /google/cloud/memcache/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-memcache/$1 begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b diff --git a/packages/google-cloud-memcache/.mocharc.js b/packages/google-cloud-memcache/.mocharc.js index 0b600509bed..cdb7b752160 100644 --- a/packages/google-cloud-memcache/.mocharc.js +++ b/packages/google-cloud-memcache/.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-memcache/.prettierrc.js b/packages/google-cloud-memcache/.prettierrc.js index d1b95106f4c..d546a4ad546 100644 --- a/packages/google-cloud-memcache/.prettierrc.js +++ b/packages/google-cloud-memcache/.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-memcache/.repo-metadata.json b/packages/google-cloud-memcache/.repo-metadata.json index ec1bfcc3c0f..bcb231300c6 100644 --- a/packages/google-cloud-memcache/.repo-metadata.json +++ b/packages/google-cloud-memcache/.repo-metadata.json @@ -2,7 +2,7 @@ "language": "nodejs", "requires_billing": true, "product_documentation": "https://cloud.google.com/memorystore/docs/memcached", - "repo": "googleapis/nodejs-memcache", + "repo": "googleapis/google-cloud-node", "default_version": "v1", "name_pretty": "Memorystore for Memcached", "release_level": "stable", diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md index e48609eac17..ee985683edf 100644 --- a/packages/google-cloud-memcache/README.md +++ b/packages/google-cloud-memcache/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Memorystore for Memcached: Node.js Client](https://github.com/googleapis/nodejs-memcache) +# [Memorystore for Memcached: 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/memcache.svg)](https://www.npmjs.org/package/@google-cloud/memcache) @@ -14,11 +14,11 @@ Memcache client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-memcache/blob/main/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). * [Memorystore for Memcached Node.js Client API Reference][client-docs] * [Memorystore for Memcached Documentation][product-docs] -* [github.com/googleapis/nodejs-memcache](https://github.com/googleapis/nodejs-memcache) +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in [Client Libraries Explained][explained]. @@ -71,11 +71,27 @@ console.info(cmc); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-memcache/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-memcache/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-memcache&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Cloud_memcache.apply_parameters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js) | [![Open in Cloud 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-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js,samples/README.md) | +| Cloud_memcache.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.create_instance.js,samples/README.md) | +| Cloud_memcache.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.delete_instance.js,samples/README.md) | +| Cloud_memcache.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.get_instance.js,samples/README.md) | +| Cloud_memcache.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.list_instances.js,samples/README.md) | +| Cloud_memcache.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.update_instance.js,samples/README.md) | +| Cloud_memcache.update_parameters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js) | [![Open in Cloud 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-memcache/samples/generated/v1/cloud_memcache.update_parameters.js,samples/README.md) | +| Cloud_memcache.apply_parameters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js) | [![Open in Cloud 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-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js,samples/README.md) | +| Cloud_memcache.apply_software_update | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js) | [![Open in Cloud 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-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js,samples/README.md) | +| Cloud_memcache.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js,samples/README.md) | +| Cloud_memcache.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js,samples/README.md) | +| Cloud_memcache.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js,samples/README.md) | +| Cloud_memcache.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js,samples/README.md) | +| Cloud_memcache.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js,samples/README.md) | +| Cloud_memcache.update_parameters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js) | [![Open in Cloud 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-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/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-memcache/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/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-memcache/samples/test/quickstart.js,samples/README.md) | @@ -125,7 +141,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-memcache/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`) @@ -137,7 +153,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-memcache/blob/main/LICENSE) +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/memcache/latest [product-docs]: https://cloud.google.com/memorystore/docs/memcached diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json index 71d2163e57f..9f8a5a44eae 100644 --- a/packages/google-cloud-memcache/package.json +++ b/packages/google-cloud-memcache/package.json @@ -21,8 +21,8 @@ "lint": "gts check", "prelint": "cd samples; npm link ../; npm install", "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", "precompile": "gts clean" }, diff --git a/packages/google-cloud-memcache/samples/README.md b/packages/google-cloud-memcache/samples/README.md index 9e90121f898..e063dd9547e 100644 --- a/packages/google-cloud-memcache/samples/README.md +++ b/packages/google-cloud-memcache/samples/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Memorystore for Memcached: Node.js Samples](https://github.com/googleapis/nodejs-memcache) +# [Memorystore for Memcached: Node.js Samples](https://github.com/googleapis/google-cloud-node) [![Open in Cloud Shell][shell_img]][shell_link] @@ -12,12 +12,28 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Cloud_memcache.apply_parameters](#cloud_memcache.apply_parameters) + * [Cloud_memcache.create_instance](#cloud_memcache.create_instance) + * [Cloud_memcache.delete_instance](#cloud_memcache.delete_instance) + * [Cloud_memcache.get_instance](#cloud_memcache.get_instance) + * [Cloud_memcache.list_instances](#cloud_memcache.list_instances) + * [Cloud_memcache.update_instance](#cloud_memcache.update_instance) + * [Cloud_memcache.update_parameters](#cloud_memcache.update_parameters) + * [Cloud_memcache.apply_parameters](#cloud_memcache.apply_parameters) + * [Cloud_memcache.apply_software_update](#cloud_memcache.apply_software_update) + * [Cloud_memcache.create_instance](#cloud_memcache.create_instance) + * [Cloud_memcache.delete_instance](#cloud_memcache.delete_instance) + * [Cloud_memcache.get_instance](#cloud_memcache.get_instance) + * [Cloud_memcache.list_instances](#cloud_memcache.list_instances) + * [Cloud_memcache.update_instance](#cloud_memcache.update_instance) + * [Cloud_memcache.update_parameters](#cloud_memcache.update_parameters) + * [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-memcache#using-the-client-library). +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). `cd samples` @@ -29,16 +45,288 @@ Before running the samples, make sure you've followed the steps outlined in +### Cloud_memcache.apply_parameters + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js). + +[![Open in Cloud 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-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js` + + +----- + + + + +### Cloud_memcache.create_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.create_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js` + + +----- + + + + +### Cloud_memcache.delete_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.delete_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js` + + +----- + + + + +### Cloud_memcache.get_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.get_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js` + + +----- + + + + +### Cloud_memcache.list_instances + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.list_instances.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js` + + +----- + + + + +### Cloud_memcache.update_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.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-memcache/samples/generated/v1/cloud_memcache.update_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js` + + +----- + + + + +### Cloud_memcache.update_parameters + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js). + +[![Open in Cloud 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-memcache/samples/generated/v1/cloud_memcache.update_parameters.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js` + + +----- + + + + +### Cloud_memcache.apply_parameters + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js). + +[![Open in Cloud 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-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js` + + +----- + + + + +### Cloud_memcache.apply_software_update + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js). + +[![Open in Cloud 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-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js` + + +----- + + + + +### Cloud_memcache.create_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js` + + +----- + + + + +### Cloud_memcache.delete_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js` + + +----- + + + + +### Cloud_memcache.get_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js` + + +----- + + + + +### Cloud_memcache.list_instances + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js` + + +----- + + + + +### Cloud_memcache.update_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.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-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js` + + +----- + + + + +### Cloud_memcache.update_parameters + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js). + +[![Open in Cloud 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-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/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-memcache/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/quickstart.js` + + +----- + + + + ### Quickstart -View the [source code](https://github.com/googleapis/nodejs-memcache/blob/main/samples/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/test/quickstart.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-memcache&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=packages/google-cloud-memcache/samples/test/quickstart.js,samples/README.md) __Usage:__ -`node samples/quickstart.js` +`node packages/google-cloud-memcache/samples/test/quickstart.js` @@ -46,5 +334,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-memcache&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/memorystore/docs/memcached diff --git a/packages/google-cloud-memcache/src/index.ts b/packages/google-cloud-memcache/src/index.ts index 24e7272ecd0..dea7e54d1be 100644 --- a/packages/google-cloud-memcache/src/index.ts +++ b/packages/google-cloud-memcache/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 4a265d93a7e..7241fc9e5a3 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -12,6 +12,7 @@ "packages/google-cloud-bigquery-datatransfer": {}, "packages/google-cloud-gkemulticloud": {}, "packages/google-cloud-language": {}, + "packages/google-cloud-memcache": {}, "packages/google-cloud-oslogin": {}, "packages/google-cloud-phishingprotection": {}, "packages/google-cloud-redis": {}, From 13ab9fa4791e1804e02e7f26e972ef4667b6df68 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Wed, 12 Oct 2022 21:26:27 -0700 Subject: [PATCH 138/152] Update quickstart.js --- .../samples/test/quickstart.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-memcache/samples/test/quickstart.js b/packages/google-cloud-memcache/samples/test/quickstart.js index 79f96109e2a..b86b9f91320 100644 --- a/packages/google-cloud-memcache/samples/test/quickstart.js +++ b/packages/google-cloud-memcache/samples/test/quickstart.js @@ -19,20 +19,24 @@ const path = require('path'); // const {assert} = require('chai'); const cp = require('child_process'); const {describe, it} = require('mocha'); - +const { assert } = require('console'); +const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; +const memcacheClient = new CloudMemcacheClient(); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const cwd = path.join(__dirname, '..'); -const PROJECT_ID = process.env.GCLOUD_PROJECT; - describe('Sample Integration Tests', () => { + let projectId; + before(() => { + projectId = memcacheClient.projectId(); + }) it('should run quickstart.js', async () => { - const stdout = execSync(`node ./quickstart.js ${PROJECT_ID}`, { + const stdout = execSync(`node ./quickstart.js ${projectId}`, { cwd, }); - // build should have exited with success status. - // assert.include(stdout, '...'); - console.info(stdout); + + assert(stdout !== null) }); }); + From 779af7e17c77dfcd37641127938812a2bef7edd4 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Wed, 12 Oct 2022 21:27:05 -0700 Subject: [PATCH 139/152] Update quickstart.js --- .../samples/quickstart.js | 77 ++++++++++++++++--- 1 file changed, 67 insertions(+), 10 deletions(-) diff --git a/packages/google-cloud-memcache/samples/quickstart.js b/packages/google-cloud-memcache/samples/quickstart.js index 7f01ca4e961..79f99af4536 100644 --- a/packages/google-cloud-memcache/samples/quickstart.js +++ b/packages/google-cloud-memcache/samples/quickstart.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. @@ -12,20 +12,77 @@ // 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'; -async function quickstart() { +function main(parent) { // [START memcache_quickstart] - // Imports the Google Cloud client library - const {CloudMemcacheClient} = require('@google-cloud/memcache'); + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * next_page_token CloudMemcache.ListInstancesResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, + * if any. + */ + // const pageToken = 'abc123' + /** + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying "name != my-instance". + */ + // const filter = 'abc123' + /** + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + */ + // const orderBy = 'abc123' + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callListInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await memcacheClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } - // Creates a client - const cmc = new CloudMemcacheClient(); - console.info(cmc); - // project = 'my-project' + callListInstances(); // [END memcache_quickstart] } -const args = process.argv.slice(2); -quickstart(...args).catch(console.error); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); From 042503f925ab18692742d3922c0cb9062edef3e9 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Wed, 12 Oct 2022 21:29:36 -0700 Subject: [PATCH 140/152] Update quickstart.js --- packages/google-cloud-memcache/samples/test/quickstart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/samples/test/quickstart.js b/packages/google-cloud-memcache/samples/test/quickstart.js index b86b9f91320..c45774e6c4d 100644 --- a/packages/google-cloud-memcache/samples/test/quickstart.js +++ b/packages/google-cloud-memcache/samples/test/quickstart.js @@ -18,7 +18,7 @@ const path = require('path'); // const {assert} = require('chai'); const cp = require('child_process'); -const {describe, it} = require('mocha'); +const {before, describe, it} = require('mocha'); const { assert } = require('console'); const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; const memcacheClient = new CloudMemcacheClient(); From 23df0266ddce1079345ac9e1d540f613be7590ea Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Wed, 12 Oct 2022 21:32:28 -0700 Subject: [PATCH 141/152] Update quickstart.js --- packages/google-cloud-memcache/samples/test/quickstart.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/samples/test/quickstart.js b/packages/google-cloud-memcache/samples/test/quickstart.js index c45774e6c4d..4edf1477e79 100644 --- a/packages/google-cloud-memcache/samples/test/quickstart.js +++ b/packages/google-cloud-memcache/samples/test/quickstart.js @@ -16,10 +16,9 @@ 'use strict'; const path = require('path'); -// const {assert} = require('chai'); +const {assert} = require('chai'); const cp = require('child_process'); const {before, describe, it} = require('mocha'); -const { assert } = require('console'); const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; const memcacheClient = new CloudMemcacheClient(); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); From d8cd5a13efe83efd80e954e3adab343bea3220d6 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Wed, 12 Oct 2022 21:39:26 -0700 Subject: [PATCH 142/152] lint --- packages/google-cloud-memcache/samples/quickstart.js | 6 ++---- packages/google-cloud-memcache/samples/test/quickstart.js | 7 +++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-memcache/samples/quickstart.js b/packages/google-cloud-memcache/samples/quickstart.js index 79f99af4536..035dfa83565 100644 --- a/packages/google-cloud-memcache/samples/quickstart.js +++ b/packages/google-cloud-memcache/samples/quickstart.js @@ -16,8 +16,6 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** - - 'use strict'; function main(parent) { @@ -39,7 +37,7 @@ function main(parent) { * If not specified, a default value of 1000 will be used by the service. * Regardless of the page_size value, the response may include a partial list * and a caller should only rely on response's - * next_page_token CloudMemcache.ListInstancesResponse.next_page_token + * next_page_token CloudMemcache.ListInstancesResponse.next_page_token * to determine if there are more instances left to be queried. */ // const pageSize = 1234 @@ -73,7 +71,7 @@ function main(parent) { // Run request const iterable = await memcacheClient.listInstancesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-memcache/samples/test/quickstart.js b/packages/google-cloud-memcache/samples/test/quickstart.js index 4edf1477e79..83178d5e3f6 100644 --- a/packages/google-cloud-memcache/samples/test/quickstart.js +++ b/packages/google-cloud-memcache/samples/test/quickstart.js @@ -29,13 +29,12 @@ describe('Sample Integration Tests', () => { let projectId; before(() => { projectId = memcacheClient.projectId(); - }) + }); it('should run quickstart.js', async () => { const stdout = execSync(`node ./quickstart.js ${projectId}`, { cwd, }); - - assert(stdout !== null) + + assert(stdout !== null); }); }); - From b786c9ad079f34fa0b10fadf7198271d77c64ae2 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 13 Oct 2022 04:43:47 +0000 Subject: [PATCH 143/152] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= =?UTF-8?q?=20post-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-memcache/README.md | 63 ++++++++++++++++--- .../samples/quickstart.js | 6 +- .../samples/test/quickstart.js | 7 +-- 3 files changed, 61 insertions(+), 15 deletions(-) diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md index ee985683edf..d370777964f 100644 --- a/packages/google-cloud-memcache/README.md +++ b/packages/google-cloud-memcache/README.md @@ -57,13 +57,62 @@ npm install @google-cloud/memcache ### Using the client library ```javascript -// Imports the Google Cloud client library -const {CloudMemcacheClient} = require('@google-cloud/memcache'); - -// Creates a client -const cmc = new CloudMemcacheClient(); -console.info(cmc); -// project = 'my-project' +/** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ +/** + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + */ +// const parent = 'abc123' +/** + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * next_page_token CloudMemcache.ListInstancesResponse.next_page_token + * to determine if there are more instances left to be queried. + */ +// const pageSize = 1234 +/** + * The next_page_token value returned from a previous List request, + * if any. + */ +// const pageToken = 'abc123' +/** + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying "name != my-instance". + */ +// const filter = 'abc123' +/** + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + */ +// const orderBy = 'abc123' + +// Imports the Memcache library +const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + +// Instantiates a client +const memcacheClient = new CloudMemcacheClient(); + +async function callListInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await memcacheClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } +} + +callListInstances(); ``` diff --git a/packages/google-cloud-memcache/samples/quickstart.js b/packages/google-cloud-memcache/samples/quickstart.js index 79f99af4536..035dfa83565 100644 --- a/packages/google-cloud-memcache/samples/quickstart.js +++ b/packages/google-cloud-memcache/samples/quickstart.js @@ -16,8 +16,6 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** - - 'use strict'; function main(parent) { @@ -39,7 +37,7 @@ function main(parent) { * If not specified, a default value of 1000 will be used by the service. * Regardless of the page_size value, the response may include a partial list * and a caller should only rely on response's - * next_page_token CloudMemcache.ListInstancesResponse.next_page_token + * next_page_token CloudMemcache.ListInstancesResponse.next_page_token * to determine if there are more instances left to be queried. */ // const pageSize = 1234 @@ -73,7 +71,7 @@ function main(parent) { // Run request const iterable = await memcacheClient.listInstancesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-memcache/samples/test/quickstart.js b/packages/google-cloud-memcache/samples/test/quickstart.js index 4edf1477e79..83178d5e3f6 100644 --- a/packages/google-cloud-memcache/samples/test/quickstart.js +++ b/packages/google-cloud-memcache/samples/test/quickstart.js @@ -29,13 +29,12 @@ describe('Sample Integration Tests', () => { let projectId; before(() => { projectId = memcacheClient.projectId(); - }) + }); it('should run quickstart.js', async () => { const stdout = execSync(`node ./quickstart.js ${projectId}`, { cwd, }); - - assert(stdout !== null) + + assert(stdout !== null); }); }); - From 72c9f462adb4b29862b04f365ef8eb131b1e4543 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 13 Oct 2022 04:54:40 +0000 Subject: [PATCH 144/152] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= =?UTF-8?q?=20post-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-memcache/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md index d370777964f..4ddb4f15d90 100644 --- a/packages/google-cloud-memcache/README.md +++ b/packages/google-cloud-memcache/README.md @@ -74,7 +74,7 @@ npm install @google-cloud/memcache * If not specified, a default value of 1000 will be used by the service. * Regardless of the page_size value, the response may include a partial list * and a caller should only rely on response's - * next_page_token CloudMemcache.ListInstancesResponse.next_page_token + * next_page_token CloudMemcache.ListInstancesResponse.next_page_token * to determine if there are more instances left to be queried. */ // const pageSize = 1234 @@ -108,7 +108,7 @@ async function callListInstances() { // Run request const iterable = await memcacheClient.listInstancesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } From bf58f155011f77a3fd33d466483b76083e3b98a3 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Wed, 12 Oct 2022 22:54:45 -0700 Subject: [PATCH 145/152] Update quickstart.js --- packages/google-cloud-memcache/samples/test/quickstart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/samples/test/quickstart.js b/packages/google-cloud-memcache/samples/test/quickstart.js index 83178d5e3f6..0043564b7c5 100644 --- a/packages/google-cloud-memcache/samples/test/quickstart.js +++ b/packages/google-cloud-memcache/samples/test/quickstart.js @@ -28,7 +28,7 @@ const cwd = path.join(__dirname, '..'); describe('Sample Integration Tests', () => { let projectId; before(() => { - projectId = memcacheClient.projectId(); + projectId = memcacheClient.getProjectId(); }); it('should run quickstart.js', async () => { const stdout = execSync(`node ./quickstart.js ${projectId}`, { From 33573a13141620c07e068d7c14a2f373047d3aac Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Thu, 13 Oct 2022 00:05:42 -0700 Subject: [PATCH 146/152] fix sample test --- packages/google-cloud-memcache/samples/test/quickstart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/samples/test/quickstart.js b/packages/google-cloud-memcache/samples/test/quickstart.js index 0043564b7c5..3fbed54ab2d 100644 --- a/packages/google-cloud-memcache/samples/test/quickstart.js +++ b/packages/google-cloud-memcache/samples/test/quickstart.js @@ -31,7 +31,7 @@ describe('Sample Integration Tests', () => { projectId = memcacheClient.getProjectId(); }); it('should run quickstart.js', async () => { - const stdout = execSync(`node ./quickstart.js ${projectId}`, { + const stdout = execSync(`node ./quickstart.js projects/${projectId}/locations/us-central1`, { cwd, }); From 988bf87f56b304aeecdda89b27a56f392cdea98c Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Thu, 13 Oct 2022 00:09:51 -0700 Subject: [PATCH 147/152] run lint --- .../google-cloud-memcache/samples/test/quickstart.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-memcache/samples/test/quickstart.js b/packages/google-cloud-memcache/samples/test/quickstart.js index 3fbed54ab2d..34c2c353ff6 100644 --- a/packages/google-cloud-memcache/samples/test/quickstart.js +++ b/packages/google-cloud-memcache/samples/test/quickstart.js @@ -31,9 +31,12 @@ describe('Sample Integration Tests', () => { projectId = memcacheClient.getProjectId(); }); it('should run quickstart.js', async () => { - const stdout = execSync(`node ./quickstart.js projects/${projectId}/locations/us-central1`, { - cwd, - }); + const stdout = execSync( + `node ./quickstart.js projects/${projectId}/locations/us-central1`, + { + cwd, + } + ); assert(stdout !== null); }); From 0d0b9dbfacd45faff49c3895f232e1a97e46eb3f Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Thu, 13 Oct 2022 00:16:40 -0700 Subject: [PATCH 148/152] Update quickstart.js --- packages/google-cloud-memcache/samples/test/quickstart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/samples/test/quickstart.js b/packages/google-cloud-memcache/samples/test/quickstart.js index 34c2c353ff6..fe0e659f180 100644 --- a/packages/google-cloud-memcache/samples/test/quickstart.js +++ b/packages/google-cloud-memcache/samples/test/quickstart.js @@ -28,7 +28,7 @@ const cwd = path.join(__dirname, '..'); describe('Sample Integration Tests', () => { let projectId; before(() => { - projectId = memcacheClient.getProjectId(); + projectId = await memcacheClient.getProjectId(); }); it('should run quickstart.js', async () => { const stdout = execSync( From 6d81389f11362c08e71c276db54acccd54748fbc Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 13 Oct 2022 07:20:23 +0000 Subject: [PATCH 149/152] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= =?UTF-8?q?=20post-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 --- .../google-cloud-memcache/samples/test/quickstart.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-memcache/samples/test/quickstart.js b/packages/google-cloud-memcache/samples/test/quickstart.js index 3fbed54ab2d..34c2c353ff6 100644 --- a/packages/google-cloud-memcache/samples/test/quickstart.js +++ b/packages/google-cloud-memcache/samples/test/quickstart.js @@ -31,9 +31,12 @@ describe('Sample Integration Tests', () => { projectId = memcacheClient.getProjectId(); }); it('should run quickstart.js', async () => { - const stdout = execSync(`node ./quickstart.js projects/${projectId}/locations/us-central1`, { - cwd, - }); + const stdout = execSync( + `node ./quickstart.js projects/${projectId}/locations/us-central1`, + { + cwd, + } + ); assert(stdout !== null); }); From ef3d3143aa27bff1f9eca31bd263c032d789a477 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Thu, 13 Oct 2022 00:37:17 -0700 Subject: [PATCH 150/152] run lint --- packages/google-cloud-memcache/samples/test/quickstart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-memcache/samples/test/quickstart.js b/packages/google-cloud-memcache/samples/test/quickstart.js index fe0e659f180..ba4902cd315 100644 --- a/packages/google-cloud-memcache/samples/test/quickstart.js +++ b/packages/google-cloud-memcache/samples/test/quickstart.js @@ -27,7 +27,7 @@ const cwd = path.join(__dirname, '..'); describe('Sample Integration Tests', () => { let projectId; - before(() => { + before(async () => { projectId = await memcacheClient.getProjectId(); }); it('should run quickstart.js', async () => { From 7faca667000b9ff9826cae7667a5f3129c9bc772 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 13 Oct 2022 07:42:44 +0000 Subject: [PATCH 151/152] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= =?UTF-8?q?=20post-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-bigquery-dataexchange/README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-bigquery-dataexchange/README.md b/packages/google-cloud-bigquery-dataexchange/README.md index 65b66e7eb39..6d5368f71cc 100644 --- a/packages/google-cloud-bigquery-dataexchange/README.md +++ b/packages/google-cloud-bigquery-dataexchange/README.md @@ -4,7 +4,7 @@ # [Analytics Hub API: Node.js Client](https://github.com/googleapis/google-cloud-node) -[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/bigquery-data-exchange.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-data-exchange) @@ -159,13 +159,12 @@ This library follows [Semantic Versioning](http://semver.org/). -This library is considered to be in **beta**. This means it is expected to be -mostly stable while we work toward a general availability release; however, -complete stability is not guaranteed. We will address issues and requests -against beta libraries with a high priority. +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. More Information: [Google Cloud Platform Launch Stages][launch_stages] From d74f6a7cd91dfb8ee51086f20ae0a64726b3b64a Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 13 Oct 2022 07:49:28 +0000 Subject: [PATCH 152/152] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= =?UTF-8?q?=20post-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-bigquery-dataexchange/README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-bigquery-dataexchange/README.md b/packages/google-cloud-bigquery-dataexchange/README.md index 65b66e7eb39..6d5368f71cc 100644 --- a/packages/google-cloud-bigquery-dataexchange/README.md +++ b/packages/google-cloud-bigquery-dataexchange/README.md @@ -4,7 +4,7 @@ # [Analytics Hub API: Node.js Client](https://github.com/googleapis/google-cloud-node) -[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/bigquery-data-exchange.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-data-exchange) @@ -159,13 +159,12 @@ This library follows [Semantic Versioning](http://semver.org/). -This library is considered to be in **beta**. This means it is expected to be -mostly stable while we work toward a general availability release; however, -complete stability is not guaranteed. We will address issues and requests -against beta libraries with a high priority. +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. More Information: [Google Cloud Platform Launch Stages][launch_stages]