From d48aacc7748c4915a8bfe6266596f61d3009f485 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 25 Apr 2019 14:52:46 -0700 Subject: [PATCH 001/253] initial commit --- .../.eslintignore | 4 + .../.eslintrc.yml | 15 + .../.gitignore | 12 + .../.jsdoc.js | 45 + .../google-cloud-recaptchaenterprise/.nycrc | 28 + .../.prettierignore | 3 + .../.prettierrc | 8 + .../.repo-metadata.json | 13 + .../CODE_OF_CONDUCT.md | 43 + .../CONTRIBUTING.md | 55 + .../google-cloud-recaptchaenterprise/LICENSE | 202 ++ .../README.md | 94 + .../__pycache__/synth.cpython-36.pyc | Bin 0 -> 698 bytes .../codecov.yaml | 4 + .../package-lock.json | 2253 +++++++++++++++++ .../package.json | 56 + .../v1beta1/recaptchaenterprise.proto | 183 ++ .../src/index.js | 79 + .../v1beta1/doc_recaptchaenterprise.js | 254 ++ .../doc/google/protobuf/doc_timestamp.js | 117 + .../src/v1beta1/index.js | 19 + ...tcha_enterprise_service_v1_beta1_client.js | 389 +++ ...rprise_service_v1_beta1_client_config.json | 36 + .../synth.metadata | 38 + .../google-cloud-recaptchaenterprise/synth.py | 39 + .../test/gapic-v1beta1.js | 166 ++ 26 files changed, 4155 insertions(+) create mode 100644 packages/google-cloud-recaptchaenterprise/.eslintignore create mode 100644 packages/google-cloud-recaptchaenterprise/.eslintrc.yml create mode 100644 packages/google-cloud-recaptchaenterprise/.gitignore create mode 100644 packages/google-cloud-recaptchaenterprise/.jsdoc.js create mode 100644 packages/google-cloud-recaptchaenterprise/.nycrc create mode 100644 packages/google-cloud-recaptchaenterprise/.prettierignore create mode 100644 packages/google-cloud-recaptchaenterprise/.prettierrc create mode 100644 packages/google-cloud-recaptchaenterprise/.repo-metadata.json create mode 100644 packages/google-cloud-recaptchaenterprise/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-recaptchaenterprise/CONTRIBUTING.md create mode 100644 packages/google-cloud-recaptchaenterprise/LICENSE create mode 100644 packages/google-cloud-recaptchaenterprise/README.md create mode 100644 packages/google-cloud-recaptchaenterprise/__pycache__/synth.cpython-36.pyc create mode 100644 packages/google-cloud-recaptchaenterprise/codecov.yaml create mode 100644 packages/google-cloud-recaptchaenterprise/package-lock.json create mode 100644 packages/google-cloud-recaptchaenterprise/package.json create mode 100644 packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto create mode 100644 packages/google-cloud-recaptchaenterprise/src/index.js create mode 100644 packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/cloud/recaptchaenterprise/v1beta1/doc_recaptchaenterprise.js create mode 100644 packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_timestamp.js create mode 100644 packages/google-cloud-recaptchaenterprise/src/v1beta1/index.js create mode 100644 packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js create mode 100644 packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json create mode 100644 packages/google-cloud-recaptchaenterprise/synth.metadata create mode 100644 packages/google-cloud-recaptchaenterprise/synth.py create mode 100644 packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js diff --git a/packages/google-cloud-recaptchaenterprise/.eslintignore b/packages/google-cloud-recaptchaenterprise/.eslintignore new file mode 100644 index 00000000000..f0c7aead4bf --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/.eslintignore @@ -0,0 +1,4 @@ +**/node_modules +src/**/doc/* +build/ +docs/ diff --git a/packages/google-cloud-recaptchaenterprise/.eslintrc.yml b/packages/google-cloud-recaptchaenterprise/.eslintrc.yml new file mode 100644 index 00000000000..73eeec27612 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/.eslintrc.yml @@ -0,0 +1,15 @@ +--- +extends: + - 'eslint:recommended' + - 'plugin:node/recommended' + - prettier +plugins: + - node + - prettier +rules: + prettier/prettier: error + block-scoped-var: error + eqeqeq: error + no-warning-comments: warn + no-var: error + prefer-const: error diff --git a/packages/google-cloud-recaptchaenterprise/.gitignore b/packages/google-cloud-recaptchaenterprise/.gitignore new file mode 100644 index 00000000000..97cdf45ca3b --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/.gitignore @@ -0,0 +1,12 @@ +**/*.log +**/node_modules +.coverage +.nyc_output +docs/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +**/package-lock.json +.DS_Store +__pycache__ diff --git a/packages/google-cloud-recaptchaenterprise/.jsdoc.js b/packages/google-cloud-recaptchaenterprise/.jsdoc.js new file mode 100644 index 00000000000..72be72958b2 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/.jsdoc.js @@ -0,0 +1,45 @@ +/*! + * Copyright 2018 Google LLC. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.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'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-baseline', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'src' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2018 Google, LLC.', + includeDate: false, + sourceFiles: false, + systemName: 'recaptchaenterprise', + theme: 'lumen' + } +}; diff --git a/packages/google-cloud-recaptchaenterprise/.nycrc b/packages/google-cloud-recaptchaenterprise/.nycrc new file mode 100644 index 00000000000..88b001cb587 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/.nycrc @@ -0,0 +1,28 @@ +{ + "report-dir": "./.coverage", + "reporter": "lcov", + "exclude": [ + "src/*{/*,/**/*}.js", + "src/*/v*/*.js", + "test/**/*.js", + "build/test" + ], + "watermarks": { + "branches": [ + 95, + 100 + ], + "functions": [ + 95, + 100 + ], + "lines": [ + 95, + 100 + ], + "statements": [ + 95, + 100 + ] + } +} diff --git a/packages/google-cloud-recaptchaenterprise/.prettierignore b/packages/google-cloud-recaptchaenterprise/.prettierignore new file mode 100644 index 00000000000..f6fac98b0a8 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/.prettierignore @@ -0,0 +1,3 @@ +node_modules/* +samples/node_modules/* +src/**/doc/* diff --git a/packages/google-cloud-recaptchaenterprise/.prettierrc b/packages/google-cloud-recaptchaenterprise/.prettierrc new file mode 100644 index 00000000000..df6eac07446 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/.prettierrc @@ -0,0 +1,8 @@ +--- +bracketSpacing: false +printWidth: 80 +semi: true +singleQuote: true +tabWidth: 2 +trailingComma: es5 +useTabs: false diff --git a/packages/google-cloud-recaptchaenterprise/.repo-metadata.json b/packages/google-cloud-recaptchaenterprise/.repo-metadata.json new file mode 100644 index 00000000000..bbd5da72abb --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/.repo-metadata.json @@ -0,0 +1,13 @@ +{ + "name": "recaptcha-enterprise", + "name_pretty": "Google Cloud reCAPTCHA Enterprise", + "product_documentation": "https://cloud.google.com/recaptcha-enterprise/docs/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/recaptcha-enterprise/latest/", + "issue_tracker": "", + "release_level": "alpha", + "language": "nodejs", + "repo": "googleapis/nodejs-recaptcha-enterprise", + "distribution_name": "@google-cloud/recaptcha-enterprise", + "api_id": "recaptchaenterprise.googleapis.com", + "requires_billing": true +} diff --git a/packages/google-cloud-recaptchaenterprise/CODE_OF_CONDUCT.md b/packages/google-cloud-recaptchaenterprise/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..46b2a08ea6d --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/CONTRIBUTING.md b/packages/google-cloud-recaptchaenterprise/CONTRIBUTING.md new file mode 100644 index 00000000000..78aaa61b269 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/CONTRIBUTING.md @@ -0,0 +1,55 @@ +# 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. 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: + + npm 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-recaptchaenterprise/LICENSE b/packages/google-cloud-recaptchaenterprise/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md new file mode 100644 index 00000000000..4ecf89c51cc --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -0,0 +1,94 @@ +[//]: # "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 + +# [Google Cloud reCAPTCHA Enterprise: Node.js Client](https://github.com/googleapis/nodejs-recaptcha-enterprise) + +[![release level](https://img.shields.io/badge/release%20level-alpha-orange.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/recaptchaenterprise.svg)](https://www.npmjs.org/package/recaptchaenterprise) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-recaptcha-enterprise/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-recaptcha-enterprise) + + + + +reCAPTCHA Enterprise API client for Node.js + + +* [Google Cloud reCAPTCHA Enterprise Node.js Client API Reference][client-docs] +* [Google Cloud reCAPTCHA Enterprise Documentation][product-docs] +* [github.com/googleapis/nodejs-recaptcha-enterprise](https://github.com/googleapis/nodejs-recaptcha-enterprise) + +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 Google Cloud reCAPTCHA Enterprise 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 recaptchaenterprise +``` + + + + + +The [Google Cloud reCAPTCHA Enterprise Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + +This library is considered to be in **alpha**. 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] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-recaptcha-enterprise/blob/master/CONTRIBUTING.md). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-recaptcha-enterprise/blob/master/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/recaptcha-enterprise/latest/ +[product-docs]: https://cloud.google.com/recaptcha-enterprise/docs/ +[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=recaptchaenterprise.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/__pycache__/synth.cpython-36.pyc b/packages/google-cloud-recaptchaenterprise/__pycache__/synth.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f929592ab1d6b80ed99f0dd346bad743c0220d0b GIT binary patch literal 698 zcmYjP&5qMB5RUWHr0L)OJwU{1d)QVh4qOmox2*~X5Q1GHS)eG5r>UdF4z^RZz4pBC z0k6Oj@f5jo;uSdIgsQA1&-cyP-;8JEr@fy4{qo1BpSEHAG9E2Q^Ot(dui6j;8w3$E zL)dK4N^NX6%)w5BE!=`u>gw$g>j5DH?6kc%uutp+;m+m~I#c6wfV<$QJ>o!jZ{j|f z=>Ynql_26in8^6@>SL`t(YjMOO?w*8nmcFvI-`@G6OXhL^O5J1PGZ$QF+Ui??(X(( zMP(pkK?@aVR!Sg&;(^>UwE{_Z5G24rL`uhtNGKWbWuR(NMi(Ly+tF{`vGI0@DkpZl9NpYT4NaEhn8zpgpEo~}amWx907^JM+j3)_YN!3|IlExFx zmNcoH>FoA?j{EbQcdsY&e~od0og^w~jJ-7oNjcN%1H)a$3517Mv3nqu9rI#~2NRy> zoZUfQWO_gnpTtcdRL4mBNJafcz8PYmp)r4+jqjx{I8Hf>)GA_GNyl}$R9+n?clCdC tqQddNo}^31;Fp_b-0GBsXkPoG$Q^cRgZ&SwAs literal 0 HcmV?d00001 diff --git a/packages/google-cloud-recaptchaenterprise/codecov.yaml b/packages/google-cloud-recaptchaenterprise/codecov.yaml new file mode 100644 index 00000000000..5724ea9478d --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/packages/google-cloud-recaptchaenterprise/package-lock.json b/packages/google-cloud-recaptchaenterprise/package-lock.json new file mode 100644 index 00000000000..d42e66e6349 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/package-lock.json @@ -0,0 +1,2253 @@ +{ + "name": "@google-cloud/recaptcha-enterprise", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@google-cloud/promisify": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-0.4.0.tgz", + "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==" + }, + "@grpc/grpc-js": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.3.6.tgz", + "integrity": "sha512-SmLNuPGlUur64bNS9aHZguqWDVQ8+Df1CGn+xsh7l6T2wiP5ArOMlywZ3TZo6z/rwKtGQgUJY9ZrPYUmHEXd/Q==", + "requires": { + "semver": "^5.5.0" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + } + } + }, + "@grpc/proto-loader": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.4.0.tgz", + "integrity": "sha512-Jm6o+75uWT7E6+lt8edg4J1F/9+BedOjaMgwE14pxS/AO43/0ZqK+rCLVVrXLoExwSAZvgvOD2B0ivy3Spsspw==", + "requires": { + "lodash.camelcase": "^4.3.0", + "protobufjs": "^6.8.6" + } + }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "requires": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + }, + "@types/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", + "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" + }, + "@types/node": { + "version": "10.14.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.5.tgz", + "integrity": "sha512-Ja7d4s0qyGFxjGeDq5S7Si25OFibSAHUi6i17UWnwNnpitADN7hah9q0Tl25gxuV5R1u2Bx+np6w4LHXfHyj/g==" + }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, + "acorn": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", + "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", + "dev": true + }, + "acorn-jsx": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", + "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", + "dev": true + }, + "agent-base": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", + "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", + "requires": { + "es6-promisify": "^5.0.0" + } + }, + "ajv": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "ascli": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.1.tgz", + "integrity": "sha1-vPpZdKYvGOgcq660lzKrSoj5Brw=", + "requires": { + "colour": "~0.7.1", + "optjs": "~3.2.2" + } + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base64-js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==" + }, + "bignumber.js": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", + "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "bytebuffer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz", + "integrity": "sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=", + "requires": { + "long": "~3" + }, + "dependencies": { + "long": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", + "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" + } + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colour": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/colour/-/colour-0.7.1.tgz", + "integrity": "sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g=" + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + } + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "requires": { + "once": "^1.4.0" + } + }, + "es6-promise": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz", + "integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==" + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "requires": { + "es6-promise": "^4.0.3" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", + "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.9.1", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.3", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.1", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.2.2", + "js-yaml": "^3.13.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "eslint-config-prettier": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-4.2.0.tgz", + "integrity": "sha512-y0uWc/FRfrHhpPZCYflWC8aE0KRJRY04rdZVfl8cL3sEZmOYyaBdhdlQPjKZBnuRMyLVK+JUZr7HaZFClQiH4w==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + } + }, + "eslint-plugin-es": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.4.0.tgz", + "integrity": "sha512-XfFmgFdIUDgvaRAlaXUkxrRg5JSADoRC8IkKLc/cISeR3yHVMefFHQZpcyXXEUUPHfy5DwviBcrfqlyqEwlQVw==", + "dev": true, + "requires": { + "eslint-utils": "^1.3.0", + "regexpp": "^2.0.1" + } + }, + "eslint-plugin-node": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-8.0.1.tgz", + "integrity": "sha512-ZjOjbjEi6jd82rIpFSgagv4CHWzG9xsQAVp1ZPlhRnnYxcTgENUVBvhYmkQ7GvT1QFijUSo69RaiOJKhMu6i8w==", + "dev": true, + "requires": { + "eslint-plugin-es": "^1.3.1", + "eslint-utils": "^1.3.1", + "ignore": "^5.0.2", + "minimatch": "^3.0.4", + "resolve": "^1.8.1", + "semver": "^5.5.0" + }, + "dependencies": { + "ignore": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.1.tgz", + "integrity": "sha512-DWjnQIFLenVrwyRCKZT+7a7/U4Cqgar4WG8V++K3hw+lrW1hc/SIwdiGmtxKCVACmHULTuGeBbHJmbwW7/sAvA==", + "dev": true + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + } + } + }, + "eslint-plugin-prettier": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.1.tgz", + "integrity": "sha512-/PMttrarPAY78PLvV3xfWibMOdMDl57hmlQ2XqFeA37wd+CJ7WSxV7txqjVPHi/AAFKd2lX0ZqfsOc/i5yFCSQ==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", + "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", + "dev": true + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "dev": true, + "requires": { + "acorn": "^6.0.7", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "external-editor": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fast-text-encoding": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.0.tgz", + "integrity": "sha512-R9bHCvweUxxwkDwhjav5vxpFvdPGlVngtqmx4pIZfSUhM/Q4NiIUHB456BAf+Q1Nwu3HEZYONtu+Rya+af4jiQ==" + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.0.tgz", + "integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gaxios": { + "version": "1.8.4", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-1.8.4.tgz", + "integrity": "sha512-BoENMnu1Gav18HcpV9IleMPZ9exM+AvUjrAOV4Mzs/vfz2Lu/ABv451iEXByKiMPn2M140uul1txXCg83sAENw==", + "requires": { + "abort-controller": "^3.0.0", + "extend": "^3.0.2", + "https-proxy-agent": "^2.2.1", + "node-fetch": "^2.3.0" + } + }, + "gcp-metadata": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-1.0.0.tgz", + "integrity": "sha512-Q6HrgfrCQeEircnNP3rCcEgiDv7eF9+1B+1MMgpE190+/+0mjQR8PxeOaRgxZWmdDAF9EIryHB9g1moPiw1SbQ==", + "requires": { + "gaxios": "^1.0.2", + "json-bigint": "^0.3.0" + } + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "globals": { + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", + "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", + "dev": true + }, + "google-auth-library": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-3.1.2.tgz", + "integrity": "sha512-cDQMzTotwyWMrg5jRO7q0A4TL/3GWBgO7I7q5xGKNiiFf9SmGY/OJ1YsLMgI2MVHHsEGyrqYnbnmV1AE+Z6DnQ==", + "requires": { + "base64-js": "^1.3.0", + "fast-text-encoding": "^1.0.0", + "gaxios": "^1.2.1", + "gcp-metadata": "^1.0.0", + "gtoken": "^2.3.2", + "https-proxy-agent": "^2.2.1", + "jws": "^3.1.5", + "lru-cache": "^5.0.0", + "semver": "^5.5.0" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + } + } + }, + "google-gax": { + "version": "0.25.6", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-0.25.6.tgz", + "integrity": "sha512-+CVtOSLQt42mwVvJJirhBiAvWsp8zKeb9zW5Wy3wyvb3VG9OugHzZpwvYO9D4yNPPspe7L9CpIs80I5nUJlS8w==", + "requires": { + "@grpc/grpc-js": "^0.3.0", + "@grpc/proto-loader": "^0.4.0", + "duplexify": "^3.6.0", + "google-auth-library": "^3.0.0", + "google-proto-files": "^0.20.0", + "grpc": "^1.16.0", + "grpc-gcp": "^0.1.1", + "is-stream-ended": "^0.1.4", + "lodash.at": "^4.6.0", + "lodash.has": "^4.5.2", + "protobufjs": "^6.8.8", + "retry-request": "^4.0.0", + "semver": "^6.0.0", + "walkdir": "^0.3.2" + } + }, + "google-p12-pem": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.4.tgz", + "integrity": "sha512-SwLAUJqUfTB2iS+wFfSS/G9p7bt4eWcc2LyfvmUXe7cWp6p3mpxDo6LLI29MXdU6wvPcQ/up298X7GMC5ylAlA==", + "requires": { + "node-forge": "^0.8.0", + "pify": "^4.0.0" + } + }, + "google-proto-files": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/google-proto-files/-/google-proto-files-0.20.0.tgz", + "integrity": "sha512-ORU+XhOeDv/UPtnCYLkO1ItmfhRCRPR3ZoeVQ7GfVzEs7PVitPIhsYlY5ZzG8XXnsdmtK27ENurfQ1jhAWpZHg==", + "requires": { + "@google-cloud/promisify": "^0.4.0", + "protobufjs": "^6.8.0", + "walkdir": "^0.3.0" + } + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "grpc": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.20.0.tgz", + "integrity": "sha512-HgYuJzRomkBlJAfC/78epuWzwMiByxgj4JsO6G6dHXXNfARTsUqpM/FmPSJJNFGvzCev0g6tn33CE7nWEmhDEg==", + "requires": { + "lodash.camelcase": "^4.3.0", + "lodash.clone": "^4.5.0", + "nan": "^2.0.0", + "node-pre-gyp": "^0.12.0", + "protobufjs": "^5.0.3" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.1", + "bundled": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true + }, + "iconv-lite": { + "version": "0.4.23", + "bundled": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "ini": { + "version": "1.3.5", + "bundled": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.0", + "bundled": true + }, + "minipass": { + "version": "2.3.5", + "bundled": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.1.1", + "bundled": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "bundled": true + } + } + }, + "ms": { + "version": "2.0.0", + "bundled": true + }, + "needle": { + "version": "2.2.4", + "bundled": true, + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.12.0", + "bundled": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.5", + "bundled": true + }, + "npm-packlist": { + "version": "1.1.12", + "bundled": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true + }, + "protobufjs": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.3.tgz", + "integrity": "sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA==", + "requires": { + "ascli": "~1", + "bytebuffer": "~5", + "glob": "^7.0.5", + "yargs": "^3.10.0" + } + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true + }, + "sax": { + "version": "1.2.4", + "bundled": true + }, + "semver": { + "version": "5.6.0", + "bundled": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true + }, + "tar": { + "version": "4.4.8", + "bundled": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + }, + "yallist": { + "version": "3.0.3", + "bundled": true + } + } + }, + "grpc-gcp": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/grpc-gcp/-/grpc-gcp-0.1.1.tgz", + "integrity": "sha512-MAt0Ae9QuL2Lbbt2d+kDta5AxqRD1JVXtBcJuQKp9GeFL5TxPw/hxIyDNyivPjKEXjbG3cBGwSE3CXq6a3KHEQ==", + "requires": { + "grpc": "^1.16.0", + "protobufjs": "^6.8.8" + } + }, + "gtoken": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.3.tgz", + "integrity": "sha512-EaB49bu/TCoNeQjhCYKI/CurooBKkGxIqFHsWABW0b25fobBYVTMe84A8EBVVZhl8emiUdNypil9huMOTmyAnw==", + "requires": { + "gaxios": "^1.0.4", + "google-p12-pem": "^1.0.0", + "jws": "^3.1.5", + "mime": "^2.2.0", + "pify": "^4.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "https-proxy-agent": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", + "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "requires": { + "agent-base": "^4.1.0", + "debug": "^3.1.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", + "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "inquirer": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz", + "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==", + "dev": true, + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.11", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + } + } + } + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-stream-ended": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", + "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-bigint": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-0.3.0.tgz", + "integrity": "sha1-DM2RLEuCcNBfBW+9E4FLU9OCWx4=", + "requires": { + "bignumber.js": "^7.0.0" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "^1.0.0" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "lodash.at": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.at/-/lodash.at-4.6.0.tgz", + "integrity": "sha1-k83OZk8KGZTqM9181A4jr9EbD/g=" + }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" + }, + "lodash.clone": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.5.0.tgz", + "integrity": "sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y=" + }, + "lodash.has": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.has/-/lodash.has-4.5.2.tgz", + "integrity": "sha1-0Z9NwQlQWMzL4rDN9O4P5Ko3yGI=" + }, + "lodash.merge": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", + "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" + }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } + }, + "mime": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.2.tgz", + "integrity": "sha512-zJBfZDkwRu+j3Pdd2aHsR5GfH2jIWhmL1ZzBoc+X+3JEti2hbArWcyJ+1laC1D2/U/W1a/+Cegj0/OnEU2ybjg==" + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "nan": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-fetch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz", + "integrity": "sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA==" + }, + "node-forge": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.8.2.tgz", + "integrity": "sha512-mXQ9GBq1N3uDCyV1pdSzgIguwgtVpM7f5/5J4ipz12PKWElmPpVWLDuWl8iXmhysr21+WmX/OJ5UKx82wjomgg==" + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + } + }, + "optjs": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz", + "integrity": "sha1-aabOicRCpEQDFBrS+bNwvVu29O4=" + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "requires": { + "lcid": "^1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "protobufjs": { + "version": "6.8.8", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz", + "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.0", + "@types/node": "^10.1.0", + "long": "^4.0.0" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, + "resolve": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz", + "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "retry-request": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.0.0.tgz", + "integrity": "sha512-S4HNLaWcMP6r8E4TMH52Y7/pM8uNayOcTDDQNBwsCccL1uI+Ol2TljxRDPzaNfbhOB30+XWP5NnZkB3LiJxi1w==", + "requires": { + "through2": "^2.0.0" + } + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rxjs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.1.tgz", + "integrity": "sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "semver": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", + "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==" + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/table/-/table-5.2.3.tgz", + "integrity": "sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ==", + "dev": true, + "requires": { + "ajv": "^6.9.1", + "lodash": "^4.17.11", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "walkdir": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.3.2.tgz", + "integrity": "sha512-0Twghia4Z5wDGDYWURlhZmI47GvERMCsXIu0QZWVVZyW9ZjpbbZvD9Zy9M6cWiQQRRbAcYajIyKNavaZZDt1Uw==" + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "window-size": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", + "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=" + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + }, + "yargs": { + "version": "3.32.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", + "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", + "requires": { + "camelcase": "^2.0.1", + "cliui": "^3.0.3", + "decamelize": "^1.1.1", + "os-locale": "^1.4.0", + "string-width": "^1.0.1", + "window-size": "^0.1.4", + "y18n": "^3.2.0" + } + } + } +} diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json new file mode 100644 index 00000000000..b35ba2cf424 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -0,0 +1,56 @@ +{ + "repository": "googleapis/nodejs-recaptcha-enterprise", + "name": "@google-cloud/recaptcha-enterprise", + "version": "0.1.0", + "author": "Google LLC", + "description": "reCAPTCHA Enterprise API client for Node.js", + "main": "src/index.js", + "files": [ + "protos", + "src", + "AUTHORS", + "COPYING" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google recaptchaenterprise", + "recaptchaenterprise", + "reCAPTCHA Enterprise API" + ], + "dependencies": { + "google-gax": "^0.25.3", + "lodash.merge": "^4.6.0" + }, + "devDependencies": { + "mocha": "^5.2.0", + "through2": "^2.0.3", + "eslint": "^5.1.0", + "eslint-config-prettier": "^4.0.0", + "eslint-plugin-node": "^8.0.0", + "eslint-plugin-prettier": "^3.0.0" + }, + "scripts": { + "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", + "docs": "jsdoc -c .jsdoc.js", + "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", + "lint": "eslint '**/*.js'", + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "system-test": "mocha system-test/*.js smoke-test/*.js --timeout 600000", + "test-no-cover": "mocha test/*.js", + "test": "npm run cover", + "fix": "eslint --fix '**/*.js'", + "docs-test": "linkinator docs -r --skip www.googleapis.com", + "predocs-test": "npm run docs" + }, + "license": "Apache-2.0", + "engines": { + "node": ">=6.0.0" + } +} diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto new file mode 100644 index 00000000000..188f99f6f77 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto @@ -0,0 +1,183 @@ +// 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.recaptchaenterprise.v1beta1; + +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.RecaptchaEnterprise.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1beta1;recaptchaenterprise"; +option java_multiple_files = true; +option java_outer_classname = "RecaptchaEnterpriseProto"; +option java_package = "com.google.recaptchaenterprise.v1beta1"; +option objc_class_prefix = "GCRE"; +option php_namespace = "Google\\Cloud\\RecaptchaEnterprise\\V1beta1"; + + +// Service to determine the likelihood an event is legitimate. +service RecaptchaEnterpriseServiceV1Beta1 { + // Creates an Assessment of the likelihood an event is legitimate. + rpc CreateAssessment(CreateAssessmentRequest) returns (Assessment) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/assessments" + body: "assessment" + }; + } + + // Annotates a previously created Assessment to provide additional information + // on whether the event turned out to be authentic or fradulent. + rpc AnnotateAssessment(AnnotateAssessmentRequest) returns (AnnotateAssessmentResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/assessments/*}:annotate" + body: "*" + }; + } +} + +// The create assessment request message. +message CreateAssessmentRequest { + // Required. The name of the project in which the assessment will be created, + // in the format "projects/{project_number}". + string parent = 1; + + // The asessment details. + Assessment assessment = 2; +} + +// The request message to annotate an Assessment. +message AnnotateAssessmentRequest { + // Enum that reprensents the types of annotations. + enum Annotation { + // Default unspecified type. + ANNOTATION_UNSPECIFIED = 0; + + // Provides information that the event turned out to be legitimate. + LEGITIMATE = 1; + + // Provides information that the event turned out to be fraudulent. + FRAUDULENT = 2; + } + + // Required. The resource name of the Assessment, in the format + // "projects/{project_number}/assessments/{assessment_id}". + string name = 1; + + // The annotation that will be assigned to the Event. + Annotation annotation = 2; +} + +// Empty response for AnnotateAssessment. +message AnnotateAssessmentResponse { + +} + +// A recaptcha assessment resource. +message Assessment { + // LINT.IfChange(classification_reason) + // Reasons contributing to the risk analysis verdict. + enum ClassificationReason { + // Default unspecified type. + CLASSIFICATION_REASON_UNSPECIFIED = 0; + + // The event appeared to be automated. + AUTOMATION = 1; + + // The event was not made from the proper context on the real site. + UNEXPECTED_ENVIRONMENT = 2; + + // Browsing behavior leading up to the event was generated was out of the + // ordinary. + UNEXPECTED_USAGE_PATTERNS = 4; + + // Too little traffic has been received from this site thus far to generate + // quality risk analysis. + PROVISIONAL_RISK_ANALYSIS = 5; + } + + // Output only. The resource name for the Assessment in the format + // "projects/{project_number}/assessments/{assessment_id}". + string name = 1; + + // The event being assessed. + Event event = 2; + + // Output only. Legitimate event score from 0.0 to 1.0. + // (1.0 means very likely legitimate traffic while 0.0 means very likely + // non-legitimate traffic). + float score = 3; + + // Output only. Properties of the provided event token. + TokenProperties token_properties = 4; + + // Output only. Reasons contributing to the risk analysis verdict. + repeated ClassificationReason reasons = 5; +} + +message Event { + // The user response token provided by the reCAPTCHA client-side integration + // on your site. + string token = 1; + + // The site key that was used to invoke reCAPTCHA on your site and generate + // the token. + string site_key = 2; +} + +message TokenProperties { + // Enum that represents the types of invalid token reasons. + enum InvalidReason { + // Default unspecified type. + INVALID_REASON_UNSPECIFIED = 0; + + // If the failure reason was not accounted for. + UNKNOWN_INVALID_REASON = 1; + + // The provided user verification token was malformed. + MALFORMED = 2; + + // The user verification token had expired. + EXPIRED = 3; + + // The user verification had already been seen. + DUPE = 4; + + // The user verification token did not match the provided site secret. + // This may be a configuration error (e.g. development keys used in + // production) or end users trying to use verification tokens from other + // sites. + SITE_MISMATCH = 5; + + // The user verification token was not present. It is a required input. + MISSING = 6; + } + + // Output only. Whether the provided user response token is valid. + bool valid = 1; + + // Output only. Reason associated with the response when valid = false. + InvalidReason invalid_reason = 2; + + // Output only. The timestamp corresponding to the generation of the token. + google.protobuf.Timestamp create_time = 3; + + // Output only. The hostname of the page on which the token was generated. + string hostname = 4; + + // Output only. Action name provided at token generation. + string action = 5; +} diff --git a/packages/google-cloud-recaptchaenterprise/src/index.js b/packages/google-cloud-recaptchaenterprise/src/index.js new file mode 100644 index 00000000000..07be1de2f7a --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/index.js @@ -0,0 +1,79 @@ +// 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 +// +// 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. + +/** + * @namespace google + */ +/** + * @namespace google.cloud + */ +/** + * @namespace google.cloud.recaptchaenterprise + */ +/** + * @namespace google.cloud.recaptchaenterprise.v1beta1 + */ + +'use strict'; + +// Import the clients for each version supported by this package. +const gapic = Object.freeze({ + v1beta1: require('./v1beta1'), +}); + +/** + * The `recaptchaenterprise` package has the following named exports: + * + * - `RecaptchaEnterpriseServiceV1Beta1Client` - Reference to + * {@link v1beta1.RecaptchaEnterpriseServiceV1Beta1Client} + * - `v1beta1` - This is used for selecting or pinning a + * particular backend service version. It exports: + * - `RecaptchaEnterpriseServiceV1Beta1Client` - Reference to + * {@link v1beta1.RecaptchaEnterpriseServiceV1Beta1Client} + * + * @module {object} recaptchaenterprise + * @alias nodejs-recaptchaenterprise + * + * @example Install the client library with npm: + * npm install --save recaptchaenterprise + * + * @example Import the client library: + * const recaptchaenterprise = require('recaptchaenterprise'); + * + * @example Create a client that uses Application Default Credentials (ADC): + * const client = new recaptchaenterprise.RecaptchaEnterpriseServiceV1Beta1Client(); + * + * @example Create a client with explicit credentials: + * const client = new recaptchaenterprise.RecaptchaEnterpriseServiceV1Beta1Client({ + * projectId: 'your-project-id', + * keyFilename: '/path/to/keyfile.json', + * }); + */ + +/** + * @type {object} + * @property {constructor} RecaptchaEnterpriseServiceV1Beta1Client + * Reference to {@link v1beta1.RecaptchaEnterpriseServiceV1Beta1Client} + */ +module.exports = gapic.v1beta1; + +/** + * @type {object} + * @property {constructor} RecaptchaEnterpriseServiceV1Beta1Client + * Reference to {@link v1beta1.RecaptchaEnterpriseServiceV1Beta1Client} + */ +module.exports.v1beta1 = gapic.v1beta1; + +// Alias `module.exports` as `module.exports.default`, for future-proofing. +module.exports.default = Object.assign({}, module.exports); diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/cloud/recaptchaenterprise/v1beta1/doc_recaptchaenterprise.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/cloud/recaptchaenterprise/v1beta1/doc_recaptchaenterprise.js new file mode 100644 index 00000000000..178aab3b3da --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/cloud/recaptchaenterprise/v1beta1/doc_recaptchaenterprise.js @@ -0,0 +1,254 @@ +// 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 +// +// 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * The create assessment request message. + * + * @property {string} parent + * Required. The name of the project in which the assessment will be created, + * in the format "projects/{project_number}". + * + * @property {Object} assessment + * The asessment details. + * + * This object should have the same structure as [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment} + * + * @typedef CreateAssessmentRequest + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @see [google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} + */ +const CreateAssessmentRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The request message to annotate an Assessment. + * + * @property {string} name + * Required. The resource name of the Assessment, in the format + * "projects/{project_number}/assessments/{assessment_id}". + * + * @property {number} annotation + * The annotation that will be assigned to the Event. + * + * The number should be among the values of [Annotation]{@link google.cloud.recaptchaenterprise.v1beta1.Annotation} + * + * @typedef AnnotateAssessmentRequest + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @see [google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} + */ +const AnnotateAssessmentRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Enum that reprensents the types of annotations. + * + * @enum {number} + * @memberof google.cloud.recaptchaenterprise.v1beta1 + */ + Annotation: { + + /** + * Default unspecified type. + */ + ANNOTATION_UNSPECIFIED: 0, + + /** + * Provides information that the event turned out to be legitimate. + */ + LEGITIMATE: 1, + + /** + * Provides information that the event turned out to be fraudulent. + */ + FRAUDULENT: 2 + } +}; + +/** + * Empty response for AnnotateAssessment. + * @typedef AnnotateAssessmentResponse + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @see [google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} + */ +const AnnotateAssessmentResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * A recaptcha assessment resource. + * + * @property {string} name + * Output only. The resource name for the Assessment in the format + * "projects/{project_number}/assessments/{assessment_id}". + * + * @property {Object} event + * The event being assessed. + * + * This object should have the same structure as [Event]{@link google.cloud.recaptchaenterprise.v1beta1.Event} + * + * @property {number} score + * Output only. Legitimate event score from 0.0 to 1.0. + * (1.0 means very likely legitimate traffic while 0.0 means very likely + * non-legitimate traffic). + * + * @property {Object} tokenProperties + * Output only. Properties of the provided event token. + * + * This object should have the same structure as [TokenProperties]{@link google.cloud.recaptchaenterprise.v1beta1.TokenProperties} + * + * @property {number[]} reasons + * Output only. Reasons contributing to the risk analysis verdict. + * + * The number should be among the values of [ClassificationReason]{@link google.cloud.recaptchaenterprise.v1beta1.ClassificationReason} + * + * @typedef Assessment + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @see [google.cloud.recaptchaenterprise.v1beta1.Assessment definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} + */ +const Assessment = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * LINT.IfChange(classification_reason) + * Reasons contributing to the risk analysis verdict. + * + * @enum {number} + * @memberof google.cloud.recaptchaenterprise.v1beta1 + */ + ClassificationReason: { + + /** + * Default unspecified type. + */ + CLASSIFICATION_REASON_UNSPECIFIED: 0, + + /** + * The event appeared to be automated. + */ + AUTOMATION: 1, + + /** + * The event was not made from the proper context on the real site. + */ + UNEXPECTED_ENVIRONMENT: 2, + + /** + * Browsing behavior leading up to the event was generated was out of the + * ordinary. + */ + UNEXPECTED_USAGE_PATTERNS: 4, + + /** + * Too little traffic has been received from this site thus far to generate + * quality risk analysis. + */ + PROVISIONAL_RISK_ANALYSIS: 5 + } +}; + +/** + * @property {string} token + * The user response token provided by the reCAPTCHA client-side integration + * on your site. + * + * @property {string} siteKey + * The site key that was used to invoke reCAPTCHA on your site and generate + * the token. + * + * @typedef Event + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @see [google.cloud.recaptchaenterprise.v1beta1.Event definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} + */ +const Event = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * @property {boolean} valid + * Output only. Whether the provided user response token is valid. + * + * @property {number} invalidReason + * Output only. Reason associated with the response when valid = false. + * + * The number should be among the values of [InvalidReason]{@link google.cloud.recaptchaenterprise.v1beta1.InvalidReason} + * + * @property {Object} createTime + * Output only. The timestamp corresponding to the generation of the token. + * + * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} + * + * @property {string} hostname + * Output only. The hostname of the page on which the token was generated. + * + * @property {string} action + * Output only. Action name provided at token generation. + * + * @typedef TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @see [google.cloud.recaptchaenterprise.v1beta1.TokenProperties definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} + */ +const TokenProperties = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Enum that represents the types of invalid token reasons. + * + * @enum {number} + * @memberof google.cloud.recaptchaenterprise.v1beta1 + */ + InvalidReason: { + + /** + * Default unspecified type. + */ + INVALID_REASON_UNSPECIFIED: 0, + + /** + * If the failure reason was not accounted for. + */ + UNKNOWN_INVALID_REASON: 1, + + /** + * The provided user verification token was malformed. + */ + MALFORMED: 2, + + /** + * The user verification token had expired. + */ + EXPIRED: 3, + + /** + * The user verification had already been seen. + */ + DUPE: 4, + + /** + * The user verification token did not match the provided site secret. + * This may be a configuration error (e.g. development keys used in + * production) or end users trying to use verification tokens from other + * sites. + */ + SITE_MISMATCH: 5, + + /** + * The user verification token was not present. It is a required input. + */ + MISSING: 6 + } +}; \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_timestamp.js new file mode 100644 index 00000000000..b643b2d6c1e --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -0,0 +1,117 @@ +// 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 +// +// 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) + * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://cloud.google.com + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) to obtain a formatter capable of generating timestamps in this format. + * + * @property {number} seconds + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + * + * @property {number} nanos + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + * + * @typedef Timestamp + * @memberof google.protobuf + * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} + */ +const Timestamp = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/index.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/index.js new file mode 100644 index 00000000000..69dd8e4eced --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/index.js @@ -0,0 +1,19 @@ +// 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 +// +// 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 RecaptchaEnterpriseServiceV1Beta1Client = require('./recaptcha_enterprise_service_v1_beta1_client'); + +module.exports.RecaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client; diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js new file mode 100644 index 00000000000..19c6790ee90 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js @@ -0,0 +1,389 @@ +// 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 +// +// 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 gapicConfig = require('./recaptcha_enterprise_service_v1_beta1_client_config.json'); +const gax = require('google-gax'); +const merge = require('lodash.merge'); +const path = require('path'); + +const VERSION = require('../../package.json').version; + +/** + * Service to determine the likelihood an event is legitimate. + * + * @class + * @memberof v1beta1 + */ +class RecaptchaEnterpriseServiceV1Beta1Client { + /** + * Construct an instance of RecaptchaEnterpriseServiceV1Beta1Client. + * + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.servicePath] - The domain name of the + * API remote host. + */ + constructor(opts) { + this._descriptors = {}; + + // Ensure that options include the service address and port. + opts = Object.assign( + { + clientConfig: {}, + port: this.constructor.port, + servicePath: this.constructor.servicePath, + }, + opts + ); + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = this.constructor.scopes; + const gaxGrpc = new gax.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth; + + // Determine the client header string. + const clientHeader = [ + `gl-node/${process.version}`, + `grpc/${gaxGrpc.grpcVersion}`, + `gax/${gax.version}`, + `gapic/${VERSION}`, + ]; + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + + // Load the applicable protos. + const protos = merge( + {}, + gaxGrpc.loadProto( + path.join(__dirname, '..', '..', 'protos'), + 'google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto' + ) + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + assessmentPathTemplate: new gax.PathTemplate( + 'projects/{project}/assessments/{assessment}' + ), + projectPathTemplate: new gax.PathTemplate( + 'projects/{project}' + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1', + gapicConfig, + 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 = {}; + + // Put together the "service stub" for + // google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1. + const recaptchaEnterpriseServiceV1Beta1Stub = gaxGrpc.createStub( + protos.google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1, + opts + ); + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const recaptchaEnterpriseServiceV1Beta1StubMethods = [ + 'createAssessment', + 'annotateAssessment', + ]; + for (const methodName of recaptchaEnterpriseServiceV1Beta1StubMethods) { + this._innerApiCalls[methodName] = gax.createApiCall( + recaptchaEnterpriseServiceV1Beta1Stub.then( + stub => + function() { + const args = Array.prototype.slice.call(arguments, 0); + return stub[methodName].apply(stub, args); + }, + err => + function() { + throw err; + } + ), + defaults[methodName], + null + ); + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'recaptchaenterprise.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', + ]; + } + + /** + * 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) { + return this.auth.getProjectId(callback); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * Creates an Assessment of the likelihood an event is legitimate. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the assessment will be created, + * in the format "projects/{project_number}". + * @param {Object} request.assessment + * The asessment details. + * + * This object should have the same structure as [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const recaptchaenterprise = require('recaptchaenterprise.v1beta1'); + * + * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.projectPath('[PROJECT]'); + * const assessment = {}; + * const request = { + * parent: formattedParent, + * assessment: assessment, + * }; + * client.createAssessment(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + createAssessment(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + 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 + }); + + return this._innerApiCalls.createAssessment(request, options, callback); + } + + /** + * Annotates a previously created Assessment to provide additional information + * on whether the event turned out to be authentic or fradulent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Assessment, in the format + * "projects/{project_number}/assessments/{assessment_id}". + * @param {number} request.annotation + * The annotation that will be assigned to the Event. + * + * The number should be among the values of [Annotation]{@link google.cloud.recaptchaenterprise.v1beta1.Annotation} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const recaptchaenterprise = require('recaptchaenterprise.v1beta1'); + * + * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + * // optional auth parameters. + * }); + * + * const formattedName = client.assessmentPath('[PROJECT]', '[ASSESSMENT]'); + * const annotation = 'ANNOTATION_UNSPECIFIED'; + * const request = { + * name: formattedName, + * annotation: annotation, + * }; + * client.annotateAssessment(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + annotateAssessment(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + 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 + }); + + return this._innerApiCalls.annotateAssessment(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified assessment resource name string. + * + * @param {String} project + * @param {String} assessment + * @returns {String} + */ + assessmentPath(project, assessment) { + return this._pathTemplates.assessmentPathTemplate.render({ + project: project, + assessment: assessment, + }); + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {String} project + * @returns {String} + */ + projectPath(project) { + return this._pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the assessmentName from a assessment resource. + * + * @param {String} assessmentName + * A fully-qualified path representing a assessment resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromAssessmentName(assessmentName) { + return this._pathTemplates.assessmentPathTemplate + .match(assessmentName) + .project; + } + + /** + * Parse the assessmentName from a assessment resource. + * + * @param {String} assessmentName + * A fully-qualified path representing a assessment resources. + * @returns {String} - A string representing the assessment. + */ + matchAssessmentFromAssessmentName(assessmentName) { + return this._pathTemplates.assessmentPathTemplate + .match(assessmentName) + .assessment; + } + + /** + * Parse the projectName from a project resource. + * + * @param {String} projectName + * A fully-qualified path representing a project resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromProjectName(projectName) { + return this._pathTemplates.projectPathTemplate + .match(projectName) + .project; + } +} + + +module.exports = RecaptchaEnterpriseServiceV1Beta1Client; diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json new file mode 100644 index 00000000000..0c189d6150b --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateAssessment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AnnotateAssessment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata new file mode 100644 index 00000000000..080a1487126 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -0,0 +1,38 @@ +{ + "updateTime": "2019-04-25T21:40:12.006533Z", + "sources": [ + { + "generator": { + "name": "artman", + "version": "0.17.0", + "dockerImage": "googleapis/artman@sha256:c58f4ec3838eb4e0718eb1bccc6512bd6850feaa85a360a9e38f6f848ec73bc2" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "9855995ff904c3c83a84415c00b91612ee5da4b2" + } + }, + { + "template": { + "name": "node_library", + "origin": "synthtool.gcp", + "version": "2019.2.26" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "recaptchaenterprise", + "apiVersion": "v1beta1", + "language": "nodejs", + "generator": "gapic", + "config": "google/cloud/recaptchaenterprise/artman_recaptchaenterprise_v1beta1.yaml" + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/synth.py b/packages/google-cloud-recaptchaenterprise/synth.py new file mode 100644 index 00000000000..3f6e0aa3ad5 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/synth.py @@ -0,0 +1,39 @@ +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.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.GAPICGenerator() +versions = ['v1beta1'] +for version in versions: + library = gapic.node_library( + 'recaptchaenterprise', + version) + s.copy(library, excludes=['README.md']) + +# Copy common templates +common_templates = gcp.CommonTemplates() +templates = common_templates.node_library() +s.copy(templates) + +# Node.js specific cleanup +subprocess.run(['npm', 'install']) +subprocess.run(['npm', 'run', 'fix']) diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js b/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js new file mode 100644 index 00000000000..33f92f4cc83 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js @@ -0,0 +1,166 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +const assert = require('assert'); + +const recaptchaenterpriseModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +const error = new Error(); +error.code = FAKE_STATUS_CODE; + +describe('RecaptchaEnterpriseServiceV1Beta1Client', () => { + describe('createAssessment', () => { + it('invokes createAssessment without error', done => { + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.projectPath('[PROJECT]'); + const assessment = {}; + const request = { + parent: formattedParent, + assessment: assessment, + }; + + // Mock response + const name = 'name3373707'; + const score = 1.0926453E7; + const expectedResponse = { + name: name, + score: score, + }; + + // Mock Grpc layer + client._innerApiCalls.createAssessment = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.createAssessment(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createAssessment with error', done => { + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.projectPath('[PROJECT]'); + const assessment = {}; + const request = { + parent: formattedParent, + assessment: assessment, + }; + + // Mock Grpc layer + client._innerApiCalls.createAssessment = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.createAssessment(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('annotateAssessment', () => { + it('invokes annotateAssessment without error', done => { + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.assessmentPath('[PROJECT]', '[ASSESSMENT]'); + const annotation = 'ANNOTATION_UNSPECIFIED'; + const request = { + name: formattedName, + annotation: annotation, + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.annotateAssessment = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.annotateAssessment(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes annotateAssessment with error', done => { + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.assessmentPath('[PROJECT]', '[ASSESSMENT]'); + const annotation = 'ANNOTATION_UNSPECIFIED'; + const request = { + name: formattedName, + annotation: annotation, + }; + + // Mock Grpc layer + client._innerApiCalls.annotateAssessment = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.annotateAssessment(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + +}); + +function mockSimpleGrpcMethod(expectedRequest, response, error) { + return function(actualRequest, options, callback) { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} From e6846f2f3e792528d2539041882f1ed7edff97d4 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 25 Apr 2019 14:56:08 -0700 Subject: [PATCH 002/253] ignore --- packages/google-cloud-recaptchaenterprise/synth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.py b/packages/google-cloud-recaptchaenterprise/synth.py index 3f6e0aa3ad5..af3a48bf52d 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.py +++ b/packages/google-cloud-recaptchaenterprise/synth.py @@ -27,7 +27,7 @@ library = gapic.node_library( 'recaptchaenterprise', version) - s.copy(library, excludes=['README.md']) + s.copy(library, excludes=['README.md', 'package.json', 'src/index.js']) # Copy common templates common_templates = gcp.CommonTemplates() From 7894164f5414feee9ed43270045b3c51b55d7639 Mon Sep 17 00:00:00 2001 From: Jonathan Lui Date: Thu, 25 Apr 2019 15:04:31 -0700 Subject: [PATCH 003/253] update templates --- packages/google-cloud-recaptchaenterprise/.jsdoc.js | 2 +- packages/google-cloud-recaptchaenterprise/README.md | 4 ++-- packages/google-cloud-recaptchaenterprise/synth.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.jsdoc.js b/packages/google-cloud-recaptchaenterprise/.jsdoc.js index 72be72958b2..6589a5d8e58 100644 --- a/packages/google-cloud-recaptchaenterprise/.jsdoc.js +++ b/packages/google-cloud-recaptchaenterprise/.jsdoc.js @@ -39,7 +39,7 @@ module.exports = { copyright: 'Copyright 2018 Google, LLC.', includeDate: false, sourceFiles: false, - systemName: 'recaptchaenterprise', + systemName: '@google-cloud/recaptcha-enterprise', theme: 'lumen' } }; diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index 4ecf89c51cc..8478bd5fc73 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -5,7 +5,7 @@ # [Google Cloud reCAPTCHA Enterprise: Node.js Client](https://github.com/googleapis/nodejs-recaptcha-enterprise) [![release level](https://img.shields.io/badge/release%20level-alpha-orange.svg?style=flat)](https://cloud.google.com/terms/launch-stages) -[![npm version](https://img.shields.io/npm/v/recaptchaenterprise.svg)](https://www.npmjs.org/package/recaptchaenterprise) +[![npm version](https://img.shields.io/npm/v/@google-cloud/recaptcha-enterprise.svg)](https://www.npmjs.org/package/@google-cloud/recaptcha-enterprise) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-recaptcha-enterprise/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-recaptcha-enterprise) @@ -48,7 +48,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. ### Installing the client library ```bash -npm install recaptchaenterprise +npm install @google-cloud/recaptcha-enterprise ``` diff --git a/packages/google-cloud-recaptchaenterprise/synth.py b/packages/google-cloud-recaptchaenterprise/synth.py index af3a48bf52d..36abf1900fc 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.py +++ b/packages/google-cloud-recaptchaenterprise/synth.py @@ -27,7 +27,7 @@ library = gapic.node_library( 'recaptchaenterprise', version) - s.copy(library, excludes=['README.md', 'package.json', 'src/index.js']) + s.copy(library, excludes=['package.json', 'src/index.js']) # Copy common templates common_templates = gcp.CommonTemplates() From ec6cc10e55ff10d614398a74a4475e676927893a Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 2 May 2019 11:31:11 -0700 Subject: [PATCH 004/253] build!: upgrade engines field to >=8.10.0 (#2) --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index b35ba2cf424..e766c9adf37 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -51,6 +51,6 @@ }, "license": "Apache-2.0", "engines": { - "node": ">=6.0.0" + "node": ">=8.10.0" } } From ae236fc3289bf60bbe1e330f50e1ae0dd0cce005 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 7 May 2019 16:21:26 -0700 Subject: [PATCH 005/253] build: nyc config with --all enabled (#1) --- .../google-cloud-recaptchaenterprise/.nycrc | 40 ++++++++---------- .../__pycache__/synth.cpython-36.pyc | Bin 698 -> 708 bytes .../synth.metadata | 11 ++--- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.nycrc b/packages/google-cloud-recaptchaenterprise/.nycrc index 88b001cb587..bfe4073a6ab 100644 --- a/packages/google-cloud-recaptchaenterprise/.nycrc +++ b/packages/google-cloud-recaptchaenterprise/.nycrc @@ -1,28 +1,22 @@ { "report-dir": "./.coverage", - "reporter": "lcov", + "reporter": ["text", "lcov"], "exclude": [ - "src/*{/*,/**/*}.js", - "src/*/v*/*.js", - "test/**/*.js", - "build/test" + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/docs", + "**/samples", + "**/scripts", + "**/src/**/v*/**/*.js", + "**/test", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" ], - "watermarks": { - "branches": [ - 95, - 100 - ], - "functions": [ - 95, - 100 - ], - "lines": [ - 95, - 100 - ], - "statements": [ - 95, - 100 - ] - } + "exclude-after-remap": false, + "all": true } diff --git a/packages/google-cloud-recaptchaenterprise/__pycache__/synth.cpython-36.pyc b/packages/google-cloud-recaptchaenterprise/__pycache__/synth.cpython-36.pyc index f929592ab1d6b80ed99f0dd346bad743c0220d0b..391ad5195ec17e1e0eab07181dfe128fc49b47f6 100644 GIT binary patch delta 186 zcmdnRdW2Qkn3tDp!NpTC*I5`C9y1^TRv_B}h>KTERCZ(6O67K8h*g?cAjX!$p3aoQ zF|kWso->6jovE3Tks*~eOE`ryg*$~Oof*VWVG3r@XZ2mo%UFsuLo delta 176 zcmX@Yx{FoWn3tDpm&T!(BPp!kNz0%*e=)%9D?cx>BqK2|r!-SPFFz$Ut5~-vH94`MBsn8dH#M&$wWy#dvp98f8 Date: Wed, 8 May 2019 13:29:38 -0700 Subject: [PATCH 006/253] fix: do not retry request on DEADLINE_EXCEEDED --- .../__pycache__/synth.cpython-36.pyc | Bin 708 -> 708 bytes ...terprise_service_v1_beta1_client_config.json | 1 - .../synth.metadata | 12 ++++++------ 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/__pycache__/synth.cpython-36.pyc b/packages/google-cloud-recaptchaenterprise/__pycache__/synth.cpython-36.pyc index 391ad5195ec17e1e0eab07181dfe128fc49b47f6..72132e1112872252c3980de2c0a3fd17e9de768e 100644 GIT binary patch delta 16 YcmX@YdW4nTn3tF9($PyB+4nL504^&9(EtDd delta 16 YcmX@YdW4nTn3tDp!NpS>+4nL504(hVqW}N^ diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json index 0c189d6150b..300aeb77aa6 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json @@ -3,7 +3,6 @@ "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1": { "retry_codes": { "idempotent": [ - "DEADLINE_EXCEEDED", "UNAVAILABLE" ], "non_idempotent": [] diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 19cb7e4d733..8a51f8b44cb 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-05-02T11:17:02.972911Z", + "updateTime": "2019-05-08T12:04:49.887264Z", "sources": [ { "generator": { "name": "artman", - "version": "0.17.1", - "dockerImage": "googleapis/artman@sha256:a40ca4dd4ef031c0ded4df4909ffdf7b3f20d29b23e682ef991eb60ba0ca6025" + "version": "0.19.0", + "dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "dd42335a9a8613072bef9cbda2725e84631d7043", - "internalRef": "246232940" + "sha": "51145ff7812d2bb44c1219d0b76dac92a8bd94b2", + "internalRef": "247143125" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.4.10" + "version": "2019.5.2" } } ], From 4c1c49c0f46c05d08e199aee5e76bc750f8dec22 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 9 May 2019 21:40:38 +0000 Subject: [PATCH 007/253] chore: remove __pycache__ (#9) --- .../__pycache__/synth.cpython-36.pyc | Bin 708 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 packages/google-cloud-recaptchaenterprise/__pycache__/synth.cpython-36.pyc diff --git a/packages/google-cloud-recaptchaenterprise/__pycache__/synth.cpython-36.pyc b/packages/google-cloud-recaptchaenterprise/__pycache__/synth.cpython-36.pyc deleted file mode 100644 index 72132e1112872252c3980de2c0a3fd17e9de768e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 708 zcmYjP&5qMB5RUWHr2qSaI7fRchgK`DXa(Cvg$qJr5t0RpQhVw;o7%>9OWSMD`ylWh zyueo=tPdcbY^}yM?LIOMEw$B zzs8^laagkmM>RHZ0~$r_ETO?YLLP)gbLZg}4H?4i^)qPScwa7X2UW4BFf5D|+m6v>#07=5)2>7UYf>&L7#s+- zsA4XR&C9Y1^itqp#@B-!hv&D%Pgl#O9IAJaVZ(& zf>rHlZa5iBG2^U?ZeCx1oZ#N%)%&;O$^S{E#u3XECpcMwHe3pqePFmFB!%oSJB|;e z3W-!3+#k!uLW)~hsM2lB;1f~@GJA|Pk5un}&38}t9n|jcaAX&1W=8v^Fm6Zr(#m?O z(Ko5@T<@6%B}a8=s5VvdVj=0WgsYw_VJ@5t{RFj8f)c+MB&gwdh Date: Fri, 10 May 2019 15:31:23 -0700 Subject: [PATCH 008/253] fix: DEADLINE_EXCEEDED retry code is idempotent (#10) --- ...recaptcha_enterprise_service_v1_beta1_client_config.json | 1 + packages/google-cloud-recaptchaenterprise/synth.metadata | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json index 300aeb77aa6..0c189d6150b 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json @@ -3,6 +3,7 @@ "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1": { "retry_codes": { "idempotent": [ + "DEADLINE_EXCEEDED", "UNAVAILABLE" ], "non_idempotent": [] diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 8a51f8b44cb..dd1b7d50d66 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-05-08T12:04:49.887264Z", + "updateTime": "2019-05-10T12:09:57.214799Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "51145ff7812d2bb44c1219d0b76dac92a8bd94b2", - "internalRef": "247143125" + "sha": "07883be5bf3c3233095e99d8e92b8094f5d7084a", + "internalRef": "247530843" } }, { From 1cd07e80fc2e0b776b569aec73ff4c277ee0014b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 14 May 2019 08:48:50 -0700 Subject: [PATCH 009/253] fix(deps): update dependency google-gax to v1 (#17) --- .../package-lock.json | 718 ++---------------- .../package.json | 2 +- 2 files changed, 48 insertions(+), 672 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/package-lock.json b/packages/google-cloud-recaptchaenterprise/package-lock.json index d42e66e6349..c14dd8b73f3 100644 --- a/packages/google-cloud-recaptchaenterprise/package-lock.json +++ b/packages/google-cloud-recaptchaenterprise/package-lock.json @@ -24,30 +24,18 @@ "js-tokens": "^4.0.0" } }, - "@google-cloud/promisify": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-0.4.0.tgz", - "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==" - }, "@grpc/grpc-js": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.3.6.tgz", - "integrity": "sha512-SmLNuPGlUur64bNS9aHZguqWDVQ8+Df1CGn+xsh7l6T2wiP5ArOMlywZ3TZo6z/rwKtGQgUJY9ZrPYUmHEXd/Q==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.4.0.tgz", + "integrity": "sha512-UbGDPnstJamJrSiHzCSwSavIX260IfLOZLRJYDqRKJA/jmVZa3hPMWDjhFrcCKDq2MLc/O/nauFED3r4khcZrA==", "requires": { - "semver": "^5.5.0" - }, - "dependencies": { - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" - } + "semver": "^6.0.0" } }, "@grpc/proto-loader": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.4.0.tgz", - "integrity": "sha512-Jm6o+75uWT7E6+lt8edg4J1F/9+BedOjaMgwE14pxS/AO43/0ZqK+rCLVVrXLoExwSAZvgvOD2B0ivy3Spsspw==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.5.0.tgz", + "integrity": "sha512-kF5toaC4A7PRjAuIxE0fYAv8WarJ6JELYlmHpkoo4EGTFvXUsQwVfyj2bgPV2023M77s2TtDn36wPMJB0sz8nA==", "requires": { "lodash.camelcase": "^4.3.0", "protobufjs": "^6.8.6" @@ -113,9 +101,9 @@ "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" }, "@types/node": { - "version": "10.14.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.5.tgz", - "integrity": "sha512-Ja7d4s0qyGFxjGeDq5S7Si25OFibSAHUi6i17UWnwNnpitADN7hah9q0Tl25gxuV5R1u2Bx+np6w4LHXfHyj/g==" + "version": "10.14.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.6.tgz", + "integrity": "sha512-Fvm24+u85lGmV4hT5G++aht2C5I4Z4dYlWZIh62FAfFO/TfzXtPpoLI6I7AuBWkIFqZCnhFOoTT7RjjaIL5Fjg==" }, "abort-controller": { "version": "3.0.0", @@ -163,11 +151,6 @@ "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", "dev": true }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -186,14 +169,10 @@ "sprintf-js": "~1.0.2" } }, - "ascli": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.1.tgz", - "integrity": "sha1-vPpZdKYvGOgcq660lzKrSoj5Brw=", - "requires": { - "colour": "~0.7.1", - "optjs": "~3.2.2" - } + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" }, "astral-regex": { "version": "1.0.0", @@ -238,32 +217,12 @@ "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" }, - "bytebuffer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz", - "integrity": "sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=", - "requires": { - "long": "~3" - }, - "dependencies": { - "long": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", - "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" - } - } - }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" - }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -296,21 +255,6 @@ "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -326,11 +270,6 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "colour": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/colour/-/colour-0.7.1.tgz", - "integrity": "sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g=" - }, "commander": { "version": "2.15.1", "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", @@ -377,11 +316,6 @@ "ms": "^2.1.1" } }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -754,9 +688,9 @@ "dev": true }, "gaxios": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-1.8.4.tgz", - "integrity": "sha512-BoENMnu1Gav18HcpV9IleMPZ9exM+AvUjrAOV4Mzs/vfz2Lu/ABv451iEXByKiMPn2M140uul1txXCg83sAENw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-2.0.1.tgz", + "integrity": "sha512-c1NXovTxkgRJTIgB2FrFmOFg4YIV6N/bAa4f/FZ4jIw13Ql9ya/82x69CswvotJhbV3DiGnlTZwoq2NVXk2Irg==", "requires": { "abort-controller": "^3.0.0", "extend": "^3.0.2", @@ -765,11 +699,11 @@ } }, "gcp-metadata": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-1.0.0.tgz", - "integrity": "sha512-Q6HrgfrCQeEircnNP3rCcEgiDv7eF9+1B+1MMgpE190+/+0mjQR8PxeOaRgxZWmdDAF9EIryHB9g1moPiw1SbQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-2.0.0.tgz", + "integrity": "sha512-BN6KUUWo6WLkDRst+Y7bqpXq1PYMrKUecNLRdZESp7oYtMjWcZdAM0UYvcip8wb0GXNO/j8Z8HTccK4iYtMvyQ==", "requires": { - "gaxios": "^1.0.2", + "gaxios": "^2.0.0", "json-bigint": "^0.3.0" } }, @@ -800,40 +734,30 @@ "dev": true }, "google-auth-library": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-3.1.2.tgz", - "integrity": "sha512-cDQMzTotwyWMrg5jRO7q0A4TL/3GWBgO7I7q5xGKNiiFf9SmGY/OJ1YsLMgI2MVHHsEGyrqYnbnmV1AE+Z6DnQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-4.0.0.tgz", + "integrity": "sha512-yyxl74G16GjKLevccXK3/DYEXphtI9Q2Qw3Eh7y8scjBKNL0IbAZF1mi999gC0tkfG6J23sCbd9tMEbNYeWfJQ==", "requires": { + "arrify": "^2.0.0", "base64-js": "^1.3.0", "fast-text-encoding": "^1.0.0", - "gaxios": "^1.2.1", - "gcp-metadata": "^1.0.0", - "gtoken": "^2.3.2", - "https-proxy-agent": "^2.2.1", + "gaxios": "^2.0.0", + "gcp-metadata": "^2.0.0", + "gtoken": "^3.0.0", "jws": "^3.1.5", "lru-cache": "^5.0.0", - "semver": "^5.5.0" - }, - "dependencies": { - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" - } + "semver": "^6.0.0" } }, "google-gax": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-0.25.6.tgz", - "integrity": "sha512-+CVtOSLQt42mwVvJJirhBiAvWsp8zKeb9zW5Wy3wyvb3VG9OugHzZpwvYO9D4yNPPspe7L9CpIs80I5nUJlS8w==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-1.0.0.tgz", + "integrity": "sha512-Mb6bYacr9NkDMfEhm736ZfPJiUwnQs7X9Wudy8vj+mvNoO1Ei+5SYw21igrf40rzNl3TuzR9rQNg9FXB912fiA==", "requires": { - "@grpc/grpc-js": "^0.3.0", - "@grpc/proto-loader": "^0.4.0", + "@grpc/grpc-js": "^0.4.0", + "@grpc/proto-loader": "^0.5.0", "duplexify": "^3.6.0", - "google-auth-library": "^3.0.0", - "google-proto-files": "^0.20.0", - "grpc": "^1.16.0", - "grpc-gcp": "^0.1.1", + "google-auth-library": "^4.0.0", "is-stream-ended": "^0.1.4", "lodash.at": "^4.6.0", "lodash.has": "^4.5.2", @@ -844,22 +768,11 @@ } }, "google-p12-pem": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.4.tgz", - "integrity": "sha512-SwLAUJqUfTB2iS+wFfSS/G9p7bt4eWcc2LyfvmUXe7cWp6p3mpxDo6LLI29MXdU6wvPcQ/up298X7GMC5ylAlA==", - "requires": { - "node-forge": "^0.8.0", - "pify": "^4.0.0" - } - }, - "google-proto-files": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/google-proto-files/-/google-proto-files-0.20.0.tgz", - "integrity": "sha512-ORU+XhOeDv/UPtnCYLkO1ItmfhRCRPR3ZoeVQ7GfVzEs7PVitPIhsYlY5ZzG8XXnsdmtK27ENurfQ1jhAWpZHg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-2.0.0.tgz", + "integrity": "sha512-n8eGSKzWOb9/EmSBIh81sPvsQM939QlpHMXahTZDzuRIpCu09x3Oaqz+mXGjL4TeCvSbcnOC0YZRvjkJ9s9lnA==", "requires": { - "@google-cloud/promisify": "^0.4.0", - "protobufjs": "^6.8.0", - "walkdir": "^0.3.0" + "node-forge": "^0.8.0" } }, "growl": { @@ -868,450 +781,13 @@ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, - "grpc": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.20.0.tgz", - "integrity": "sha512-HgYuJzRomkBlJAfC/78epuWzwMiByxgj4JsO6G6dHXXNfARTsUqpM/FmPSJJNFGvzCev0g6tn33CE7nWEmhDEg==", - "requires": { - "lodash.camelcase": "^4.3.0", - "lodash.clone": "^4.5.0", - "nan": "^2.0.0", - "node-pre-gyp": "^0.12.0", - "protobufjs": "^5.0.3" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true - }, - "iconv-lite": { - "version": "0.4.23", - "bundled": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true - }, - "ini": { - "version": "1.3.5", - "bundled": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.0", - "bundled": true - }, - "minipass": { - "version": "2.3.5", - "bundled": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.1.1", - "bundled": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "bundled": true - } - } - }, - "ms": { - "version": "2.0.0", - "bundled": true - }, - "needle": { - "version": "2.2.4", - "bundled": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.12.0", - "bundled": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.5", - "bundled": true - }, - "npm-packlist": { - "version": "1.1.12", - "bundled": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true - }, - "protobufjs": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.3.tgz", - "integrity": "sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA==", - "requires": { - "ascli": "~1", - "bytebuffer": "~5", - "glob": "^7.0.5", - "yargs": "^3.10.0" - } - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true - }, - "sax": { - "version": "1.2.4", - "bundled": true - }, - "semver": { - "version": "5.6.0", - "bundled": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true - }, - "yallist": { - "version": "3.0.3", - "bundled": true - } - } - }, - "grpc-gcp": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/grpc-gcp/-/grpc-gcp-0.1.1.tgz", - "integrity": "sha512-MAt0Ae9QuL2Lbbt2d+kDta5AxqRD1JVXtBcJuQKp9GeFL5TxPw/hxIyDNyivPjKEXjbG3cBGwSE3CXq6a3KHEQ==", - "requires": { - "grpc": "^1.16.0", - "protobufjs": "^6.8.8" - } - }, "gtoken": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.3.tgz", - "integrity": "sha512-EaB49bu/TCoNeQjhCYKI/CurooBKkGxIqFHsWABW0b25fobBYVTMe84A8EBVVZhl8emiUdNypil9huMOTmyAnw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-3.0.0.tgz", + "integrity": "sha512-IY9HVi78D4ykVHn+ThI7rlcpdFtKyo9e9YLim9S9T3rp6fEnfeTexcrqzSpExVshPofsdauLKIa8dEnzX7ZLfQ==", "requires": { - "gaxios": "^1.0.4", - "google-p12-pem": "^1.0.0", + "gaxios": "^2.0.0", + "google-p12-pem": "^2.0.0", "jws": "^3.1.5", "mime": "^2.2.0", "pify": "^4.0.0" @@ -1457,19 +933,6 @@ } } }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", @@ -1547,14 +1010,6 @@ "safe-buffer": "^5.0.1" } }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "requires": { - "invert-kv": "^1.0.0" - } - }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -1581,11 +1036,6 @@ "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" }, - "lodash.clone": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.5.0.tgz", - "integrity": "sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y=" - }, "lodash.has": { "version": "4.5.2", "resolved": "https://registry.npmjs.org/lodash.has/-/lodash.has-4.5.2.tgz", @@ -1691,11 +1141,6 @@ "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "dev": true }, - "nan": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", - "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" - }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -1709,20 +1154,15 @@ "dev": true }, "node-fetch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz", - "integrity": "sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.5.0.tgz", + "integrity": "sha512-YuZKluhWGJwCcUu4RlZstdAxr8bFfOVHakc1mplwHkk8J+tqM1Y5yraYvIUpeX8aY7+crCwiELJq7Vl0o0LWXw==" }, "node-forge": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.8.2.tgz", "integrity": "sha512-mXQ9GBq1N3uDCyV1pdSzgIguwgtVpM7f5/5J4ipz12PKWElmPpVWLDuWl8iXmhysr21+WmX/OJ5UKx82wjomgg==" }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1754,19 +1194,6 @@ "wordwrap": "~1.0.0" } }, - "optjs": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz", - "integrity": "sha1-aabOicRCpEQDFBrS+bNwvVu29O4=" - }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "requires": { - "lcid": "^1.0.0" - } - }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -2026,16 +1453,6 @@ "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -2044,14 +1461,6 @@ "safe-buffer": "~5.1.0" } }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -2186,26 +1595,12 @@ "isexe": "^2.0.0" } }, - "window-size": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", - "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=" - }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -2225,29 +1620,10 @@ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" - }, "yallist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" - }, - "yargs": { - "version": "3.32.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", - "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", - "requires": { - "camelcase": "^2.0.1", - "cliui": "^3.0.3", - "decamelize": "^1.1.1", - "os-locale": "^1.4.0", - "string-width": "^1.0.1", - "window-size": "^0.1.4", - "y18n": "^3.2.0" - } } } } diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index e766c9adf37..bdfad4117ff 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -25,7 +25,7 @@ "reCAPTCHA Enterprise API" ], "dependencies": { - "google-gax": "^0.25.3", + "google-gax": "^1.0.0", "lodash.merge": "^4.6.0" }, "devDependencies": { From cbd1277e7b50a7f72b2684a210356f4b54ac617d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 14 May 2019 08:52:17 -0700 Subject: [PATCH 010/253] chore(deps): update dependency through2 to v3 (#16) --- .../package-lock.json | 20 ++++++------------- .../package.json | 2 +- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/package-lock.json b/packages/google-cloud-recaptchaenterprise/package-lock.json index c14dd8b73f3..760eca330c0 100644 --- a/packages/google-cloud-recaptchaenterprise/package-lock.json +++ b/packages/google-cloud-recaptchaenterprise/package-lock.json @@ -1338,10 +1338,7 @@ "retry-request": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.0.0.tgz", - "integrity": "sha512-S4HNLaWcMP6r8E4TMH52Y7/pM8uNayOcTDDQNBwsCccL1uI+Ol2TljxRDPzaNfbhOB30+XWP5NnZkB3LiJxi1w==", - "requires": { - "through2": "^2.0.0" - } + "integrity": "sha512-S4HNLaWcMP6r8E4TMH52Y7/pM8uNayOcTDDQNBwsCccL1uI+Ol2TljxRDPzaNfbhOB30+XWP5NnZkB3LiJxi1w==" }, "rimraf": { "version": "2.6.3", @@ -1535,12 +1532,12 @@ "dev": true }, "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", + "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "dev": true, "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" + "readable-stream": "2 || 3" } }, "tmp": { @@ -1615,11 +1612,6 @@ "mkdirp": "^0.5.1" } }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - }, "yallist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index bdfad4117ff..ce2979e7d28 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -30,7 +30,7 @@ }, "devDependencies": { "mocha": "^5.2.0", - "through2": "^2.0.3", + "through2": "^3.0.0", "eslint": "^5.1.0", "eslint-config-prettier": "^4.0.0", "eslint-plugin-node": "^8.0.0", From d2b91185771e85eafa964af2b36045badc811e0c Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 14 May 2019 13:05:10 -0700 Subject: [PATCH 011/253] chore(boostrapping): bootstrapping tests, samples, and docs (#11) --- .../.gitignore | 1 + .../README.md | 44 +- .../package-lock.json | 1621 ----------------- .../package.json | 16 +- .../samples/README.md | 44 + .../samples/package.json | 23 + .../samples/quickstart.js | 48 + .../src/index.js | 3 + ...tcha_enterprise_service_v1_beta1_client.js | 40 +- .../synth.metadata | 8 +- .../system-test/.eslintrc | 3 + .../system-test/test.js | 23 + .../test/.eslintrc | 3 + .../test/gapic-v1beta1.js | 43 +- 14 files changed, 246 insertions(+), 1674 deletions(-) delete mode 100644 packages/google-cloud-recaptchaenterprise/package-lock.json create mode 100644 packages/google-cloud-recaptchaenterprise/samples/README.md create mode 100644 packages/google-cloud-recaptchaenterprise/samples/package.json create mode 100644 packages/google-cloud-recaptchaenterprise/samples/quickstart.js create mode 100644 packages/google-cloud-recaptchaenterprise/system-test/.eslintrc create mode 100644 packages/google-cloud-recaptchaenterprise/system-test/test.js create mode 100644 packages/google-cloud-recaptchaenterprise/test/.eslintrc diff --git a/packages/google-cloud-recaptchaenterprise/.gitignore b/packages/google-cloud-recaptchaenterprise/.gitignore index 97cdf45ca3b..b1b074b5cd2 100644 --- a/packages/google-cloud-recaptchaenterprise/.gitignore +++ b/packages/google-cloud-recaptchaenterprise/.gitignore @@ -10,3 +10,4 @@ system-test/*key.json **/package-lock.json .DS_Store __pycache__ +package-lock.json diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index 8478bd5fc73..2230d009cf2 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/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,46 @@ npm install @google-cloud/recaptcha-enterprise ``` +### Using the client library + +```javascript +/** + * Instantiate the reCAPTCHA Enterprise client and make request. + * @param {string} projectNumber The project number to use when making requests. + */ +async function main(projectNumber) { + // Create the reCAPTCHA client library. + const { + RecaptchaEnterpriseServiceV1Beta1Client, + } = require('@google-cloud/recaptcha-enterprise'); + const client = new RecaptchaEnterpriseServiceV1Beta1Client(); + + // format the path to the project (it should be prefaced with projects/). + const formattedParent = client.projectPath(projectNumber); + // assessment should contain event with RESPONSE_TOKEN and RECAPTCHA_SITE_KEY: + // "{'event': {'token': 'RESPONSE_TOKEN', 'siteKey': 'RECAPTCHA_SITE_KEY'}}" + const assessment = {}; + + const request = { + parent: formattedParent, + assessment: assessment, + }; + + await client.createAssessment(request); +} + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-recaptcha-enterprise/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-recaptcha-enterprise/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-recaptcha-enterprise&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | diff --git a/packages/google-cloud-recaptchaenterprise/package-lock.json b/packages/google-cloud-recaptchaenterprise/package-lock.json deleted file mode 100644 index 760eca330c0..00000000000 --- a/packages/google-cloud-recaptchaenterprise/package-lock.json +++ /dev/null @@ -1,1621 +0,0 @@ -{ - "name": "@google-cloud/recaptcha-enterprise", - "version": "0.1.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/highlight": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", - "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@grpc/grpc-js": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.4.0.tgz", - "integrity": "sha512-UbGDPnstJamJrSiHzCSwSavIX260IfLOZLRJYDqRKJA/jmVZa3hPMWDjhFrcCKDq2MLc/O/nauFED3r4khcZrA==", - "requires": { - "semver": "^6.0.0" - } - }, - "@grpc/proto-loader": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.5.0.tgz", - "integrity": "sha512-kF5toaC4A7PRjAuIxE0fYAv8WarJ6JELYlmHpkoo4EGTFvXUsQwVfyj2bgPV2023M77s2TtDn36wPMJB0sz8nA==", - "requires": { - "lodash.camelcase": "^4.3.0", - "protobufjs": "^6.8.6" - } - }, - "@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" - }, - "@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" - }, - "@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", - "requires": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" - }, - "@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" - }, - "@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" - }, - "@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" - }, - "@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" - }, - "@types/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", - "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" - }, - "@types/node": { - "version": "10.14.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.6.tgz", - "integrity": "sha512-Fvm24+u85lGmV4hT5G++aht2C5I4Z4dYlWZIh62FAfFO/TfzXtPpoLI6I7AuBWkIFqZCnhFOoTT7RjjaIL5Fjg==" - }, - "abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "requires": { - "event-target-shim": "^5.0.0" - } - }, - "acorn": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", - "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", - "dev": true - }, - "acorn-jsx": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", - "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", - "dev": true - }, - "agent-base": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", - "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", - "requires": { - "es6-promisify": "^5.0.0" - } - }, - "ajv": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" - }, - "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "base64-js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==" - }, - "bignumber.js": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", - "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true - }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "requires": { - "restore-cursor": "^2.0.0" - } - }, - "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", - "dev": true - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "dependencies": { - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true - } - } - }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "requires": { - "ms": "^2.1.1" - } - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, - "ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "requires": { - "once": "^1.4.0" - } - }, - "es6-promise": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz", - "integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==" - }, - "es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "requires": { - "es6-promise": "^4.0.3" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "eslint": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", - "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "ajv": "^6.9.1", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "eslint-scope": "^4.0.3", - "eslint-utils": "^1.3.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^5.0.1", - "esquery": "^1.0.1", - "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", - "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.7.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "inquirer": "^6.2.2", - "js-yaml": "^3.13.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.11", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^5.5.1", - "strip-ansi": "^4.0.0", - "strip-json-comments": "^2.0.1", - "table": "^5.2.3", - "text-table": "^0.2.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "eslint-config-prettier": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-4.2.0.tgz", - "integrity": "sha512-y0uWc/FRfrHhpPZCYflWC8aE0KRJRY04rdZVfl8cL3sEZmOYyaBdhdlQPjKZBnuRMyLVK+JUZr7HaZFClQiH4w==", - "dev": true, - "requires": { - "get-stdin": "^6.0.0" - } - }, - "eslint-plugin-es": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.4.0.tgz", - "integrity": "sha512-XfFmgFdIUDgvaRAlaXUkxrRg5JSADoRC8IkKLc/cISeR3yHVMefFHQZpcyXXEUUPHfy5DwviBcrfqlyqEwlQVw==", - "dev": true, - "requires": { - "eslint-utils": "^1.3.0", - "regexpp": "^2.0.1" - } - }, - "eslint-plugin-node": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-8.0.1.tgz", - "integrity": "sha512-ZjOjbjEi6jd82rIpFSgagv4CHWzG9xsQAVp1ZPlhRnnYxcTgENUVBvhYmkQ7GvT1QFijUSo69RaiOJKhMu6i8w==", - "dev": true, - "requires": { - "eslint-plugin-es": "^1.3.1", - "eslint-utils": "^1.3.1", - "ignore": "^5.0.2", - "minimatch": "^3.0.4", - "resolve": "^1.8.1", - "semver": "^5.5.0" - }, - "dependencies": { - "ignore": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.1.tgz", - "integrity": "sha512-DWjnQIFLenVrwyRCKZT+7a7/U4Cqgar4WG8V++K3hw+lrW1hc/SIwdiGmtxKCVACmHULTuGeBbHJmbwW7/sAvA==", - "dev": true - }, - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true - } - } - }, - "eslint-plugin-prettier": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.1.tgz", - "integrity": "sha512-/PMttrarPAY78PLvV3xfWibMOdMDl57hmlQ2XqFeA37wd+CJ7WSxV7txqjVPHi/AAFKd2lX0ZqfsOc/i5yFCSQ==", - "dev": true, - "requires": { - "prettier-linter-helpers": "^1.0.0" - } - }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", - "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", - "dev": true - }, - "eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", - "dev": true - }, - "espree": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", - "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", - "dev": true, - "requires": { - "acorn": "^6.0.7", - "acorn-jsx": "^5.0.0", - "eslint-visitor-keys": "^1.0.0" - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", - "dev": true, - "requires": { - "estraverse": "^4.0.0" - } - }, - "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", - "dev": true, - "requires": { - "estraverse": "^4.1.0" - } - }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", - "dev": true - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, - "event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "external-editor": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", - "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", - "dev": true, - "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - } - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "fast-diff": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "fast-text-encoding": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.0.tgz", - "integrity": "sha512-R9bHCvweUxxwkDwhjav5vxpFvdPGlVngtqmx4pIZfSUhM/Q4NiIUHB456BAf+Q1Nwu3HEZYONtu+Rya+af4jiQ==" - }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", - "dev": true, - "requires": { - "flat-cache": "^2.0.1" - } - }, - "flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", - "dev": true, - "requires": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" - } - }, - "flatted": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.0.tgz", - "integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg==", - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "gaxios": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-2.0.1.tgz", - "integrity": "sha512-c1NXovTxkgRJTIgB2FrFmOFg4YIV6N/bAa4f/FZ4jIw13Ql9ya/82x69CswvotJhbV3DiGnlTZwoq2NVXk2Irg==", - "requires": { - "abort-controller": "^3.0.0", - "extend": "^3.0.2", - "https-proxy-agent": "^2.2.1", - "node-fetch": "^2.3.0" - } - }, - "gcp-metadata": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-2.0.0.tgz", - "integrity": "sha512-BN6KUUWo6WLkDRst+Y7bqpXq1PYMrKUecNLRdZESp7oYtMjWcZdAM0UYvcip8wb0GXNO/j8Z8HTccK4iYtMvyQ==", - "requires": { - "gaxios": "^2.0.0", - "json-bigint": "^0.3.0" - } - }, - "get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", - "dev": true - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "globals": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", - "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", - "dev": true - }, - "google-auth-library": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-4.0.0.tgz", - "integrity": "sha512-yyxl74G16GjKLevccXK3/DYEXphtI9Q2Qw3Eh7y8scjBKNL0IbAZF1mi999gC0tkfG6J23sCbd9tMEbNYeWfJQ==", - "requires": { - "arrify": "^2.0.0", - "base64-js": "^1.3.0", - "fast-text-encoding": "^1.0.0", - "gaxios": "^2.0.0", - "gcp-metadata": "^2.0.0", - "gtoken": "^3.0.0", - "jws": "^3.1.5", - "lru-cache": "^5.0.0", - "semver": "^6.0.0" - } - }, - "google-gax": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-1.0.0.tgz", - "integrity": "sha512-Mb6bYacr9NkDMfEhm736ZfPJiUwnQs7X9Wudy8vj+mvNoO1Ei+5SYw21igrf40rzNl3TuzR9rQNg9FXB912fiA==", - "requires": { - "@grpc/grpc-js": "^0.4.0", - "@grpc/proto-loader": "^0.5.0", - "duplexify": "^3.6.0", - "google-auth-library": "^4.0.0", - "is-stream-ended": "^0.1.4", - "lodash.at": "^4.6.0", - "lodash.has": "^4.5.2", - "protobufjs": "^6.8.8", - "retry-request": "^4.0.0", - "semver": "^6.0.0", - "walkdir": "^0.3.2" - } - }, - "google-p12-pem": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-2.0.0.tgz", - "integrity": "sha512-n8eGSKzWOb9/EmSBIh81sPvsQM939QlpHMXahTZDzuRIpCu09x3Oaqz+mXGjL4TeCvSbcnOC0YZRvjkJ9s9lnA==", - "requires": { - "node-forge": "^0.8.0" - } - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "gtoken": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-3.0.0.tgz", - "integrity": "sha512-IY9HVi78D4ykVHn+ThI7rlcpdFtKyo9e9YLim9S9T3rp6fEnfeTexcrqzSpExVshPofsdauLKIa8dEnzX7ZLfQ==", - "requires": { - "gaxios": "^2.0.0", - "google-p12-pem": "^2.0.0", - "jws": "^3.1.5", - "mime": "^2.2.0", - "pify": "^4.0.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true - }, - "https-proxy-agent": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", - "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", - "requires": { - "agent-base": "^4.1.0", - "debug": "^3.1.0" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, - "import-fresh": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", - "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "inquirer": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz", - "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==", - "dev": true, - "requires": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.11", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - } - } - } - } - }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, - "is-stream-ended": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", - "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "json-bigint": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-0.3.0.tgz", - "integrity": "sha1-DM2RLEuCcNBfBW+9E4FLU9OCWx4=", - "requires": { - "bignumber.js": "^7.0.0" - } - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "requires": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "requires": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - } - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - }, - "lodash.at": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.at/-/lodash.at-4.6.0.tgz", - "integrity": "sha1-k83OZk8KGZTqM9181A4jr9EbD/g=" - }, - "lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" - }, - "lodash.has": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/lodash.has/-/lodash.has-4.5.2.tgz", - "integrity": "sha1-0Z9NwQlQWMzL4rDN9O4P5Ko3yGI=" - }, - "lodash.merge": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", - "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" - }, - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "requires": { - "yallist": "^3.0.2" - } - }, - "mime": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.2.tgz", - "integrity": "sha512-zJBfZDkwRu+j3Pdd2aHsR5GfH2jIWhmL1ZzBoc+X+3JEti2hbArWcyJ+1laC1D2/U/W1a/+Cegj0/OnEU2ybjg==" - }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", - "dev": true, - "requires": { - "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node-fetch": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.5.0.tgz", - "integrity": "sha512-YuZKluhWGJwCcUu4RlZstdAxr8bFfOVHakc1mplwHkk8J+tqM1Y5yraYvIUpeX8aY7+crCwiELJq7Vl0o0LWXw==" - }, - "node-forge": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.8.2.tgz", - "integrity": "sha512-mXQ9GBq1N3uDCyV1pdSzgIguwgtVpM7f5/5J4ipz12PKWElmPpVWLDuWl8iXmhysr21+WmX/OJ5UKx82wjomgg==" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", - "dev": true, - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "prettier-linter-helpers": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", - "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", - "dev": true, - "requires": { - "fast-diff": "^1.1.2" - } - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" - }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, - "protobufjs": { - "version": "6.8.8", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz", - "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==", - "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.0", - "@types/node": "^10.1.0", - "long": "^4.0.0" - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", - "dev": true - }, - "resolve": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz", - "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "dev": true, - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, - "retry-request": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.0.0.tgz", - "integrity": "sha512-S4HNLaWcMP6r8E4TMH52Y7/pM8uNayOcTDDQNBwsCccL1uI+Ol2TljxRDPzaNfbhOB30+XWP5NnZkB3LiJxi1w==" - }, - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - }, - "dependencies": { - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } - } - }, - "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", - "dev": true, - "requires": { - "is-promise": "^2.1.0" - } - }, - "rxjs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.1.tgz", - "integrity": "sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "semver": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", - "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==" - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true - }, - "slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - } - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "table": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/table/-/table-5.2.3.tgz", - "integrity": "sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ==", - "dev": true, - "requires": { - "ajv": "^6.9.1", - "lodash": "^4.17.11", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "through2": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", - "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", - "dev": true, - "requires": { - "readable-stream": "2 || 3" - } - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - }, - "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", - "dev": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "walkdir": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.3.2.tgz", - "integrity": "sha512-0Twghia4Z5wDGDYWURlhZmI47GvERMCsXIu0QZWVVZyW9ZjpbbZvD9Zy9M6cWiQQRRbAcYajIyKNavaZZDt1Uw==" - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "write": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", - "dev": true, - "requires": { - "mkdirp": "^0.5.1" - } - }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" - } - } -} diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index ce2979e7d28..84740b217d2 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -29,24 +29,28 @@ "lodash.merge": "^4.6.0" }, "devDependencies": { - "mocha": "^5.2.0", - "through2": "^3.0.0", "eslint": "^5.1.0", "eslint-config-prettier": "^4.0.0", "eslint-plugin-node": "^8.0.0", - "eslint-plugin-prettier": "^3.0.0" + "eslint-plugin-prettier": "^3.0.0", + "jsdoc": "^3.6.2", + "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", + "linkinator": "^1.4.2", + "mocha": "^5.2.0", + "nyc": "^14.1.1", + "prettier": "^1.17.1", + "through2": "^2.0.3" }, "scripts": { "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", "docs": "jsdoc -c .jsdoc.js", - "generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json", "lint": "eslint '**/*.js'", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "mocha system-test/*.js smoke-test/*.js --timeout 600000", + "system-test": "mocha system-test/*.js --timeout 600000", "test-no-cover": "mocha test/*.js", "test": "npm run cover", "fix": "eslint --fix '**/*.js'", - "docs-test": "linkinator docs -r --skip www.googleapis.com", + "docs-test": "linkinator docs -r --skip 'www.npmjs.org/package/@google-cloud/recaptcha-enterprise|cloud.google.com/nodejs/docs/reference/recaptcha-enterprise/latest/|github.com/googleapis/nodejs-recaptcha-enterprise/tree/master/samples|https://github.com/googleapis/nodejs-recaptcha-enterprise/blob/master/samples/quickstart.js'", "predocs-test": "npm run docs" }, "license": "Apache-2.0", diff --git a/packages/google-cloud-recaptchaenterprise/samples/README.md b/packages/google-cloud-recaptchaenterprise/samples/README.md new file mode 100644 index 00000000000..fd64d549a98 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/README.md @@ -0,0 +1,44 @@ +[//]: # "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 + +# [Google Cloud reCAPTCHA Enterprise: Node.js Samples](https://github.com/googleapis/nodejs-recaptcha-enterprise) + +[![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-recaptcha-enterprise#using-the-client-library). + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-recaptcha-enterprise/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-recaptcha-enterprise&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node 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-recaptcha-enterprise&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/recaptcha-enterprise/docs/ \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json new file mode 100644 index 00000000000..1b20bf4ba15 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-recaptcha-enterprise-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=8" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/recaptcha-enterprise": "^0.1.0" + }, + "devDependencies": { + "chai": "^4.2.0", + "mocha": "^6.1.4", + "uuid": "^3.3.2" + } +} diff --git a/packages/google-cloud-recaptchaenterprise/samples/quickstart.js b/packages/google-cloud-recaptchaenterprise/samples/quickstart.js new file mode 100644 index 00000000000..80e8f6aa5d7 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/quickstart.js @@ -0,0 +1,48 @@ +/** + * Copyright 2019, Google, Inc. + * Licensed under the Apache License, Version 2.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'; + +// [START recaptcha_enterprise_quickstart] +/** + * Instantiate the reCAPTCHA Enterprise client and make request. + * @param {string} projectNumber The project number to use when making requests. + */ +async function main(projectNumber) { + // Create the reCAPTCHA client library. + const { + RecaptchaEnterpriseServiceV1Beta1Client, + } = require('@google-cloud/recaptcha-enterprise'); + const client = new RecaptchaEnterpriseServiceV1Beta1Client(); + + // format the path to the project (it should be prefaced with projects/). + const formattedParent = client.projectPath(projectNumber); + // assessment should contain event with RESPONSE_TOKEN and RECAPTCHA_SITE_KEY: + // "{'event': {'token': 'RESPONSE_TOKEN', 'siteKey': 'RECAPTCHA_SITE_KEY'}}" + const assessment = {}; + + const request = { + parent: formattedParent, + assessment: assessment, + }; + + await client.createAssessment(request); +} +// [END recaptcha_enterprise_quickstart] + +main(...process.argv.slice(2)).catch(err => { + console.error(err); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-recaptchaenterprise/src/index.js b/packages/google-cloud-recaptchaenterprise/src/index.js index 07be1de2f7a..41b6dd01099 100644 --- a/packages/google-cloud-recaptchaenterprise/src/index.js +++ b/packages/google-cloud-recaptchaenterprise/src/index.js @@ -18,6 +18,9 @@ /** * @namespace google.cloud */ +/** + * @namespace google.protobuf + */ /** * @namespace google.cloud.recaptchaenterprise */ diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js index 19c6790ee90..3aaeedb3447 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js @@ -103,9 +103,7 @@ class RecaptchaEnterpriseServiceV1Beta1Client { assessmentPathTemplate: new gax.PathTemplate( 'projects/{project}/assessments/{assessment}' ), - projectPathTemplate: new gax.PathTemplate( - 'projects/{project}' - ), + projectPathTemplate: new gax.PathTemplate('projects/{project}'), }; // Put together the default options sent with requests. @@ -124,7 +122,8 @@ class RecaptchaEnterpriseServiceV1Beta1Client { // Put together the "service stub" for // google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1. const recaptchaEnterpriseServiceV1Beta1Stub = gaxGrpc.createStub( - protos.google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1, + protos.google.cloud.recaptchaenterprise.v1beta1 + .RecaptchaEnterpriseServiceV1Beta1, opts ); @@ -172,9 +171,7 @@ class RecaptchaEnterpriseServiceV1Beta1Client { * in this service. */ static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; + return ['https://www.googleapis.com/auth/cloud-platform']; } /** @@ -244,10 +241,11 @@ class RecaptchaEnterpriseServiceV1Beta1Client { 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, + }); return this._innerApiCalls.createAssessment(request, options, callback); } @@ -307,10 +305,11 @@ class RecaptchaEnterpriseServiceV1Beta1Client { 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, + }); return this._innerApiCalls.annotateAssessment(request, options, callback); } @@ -353,8 +352,7 @@ class RecaptchaEnterpriseServiceV1Beta1Client { * @returns {String} - A string representing the project. */ matchProjectFromAssessmentName(assessmentName) { - return this._pathTemplates.assessmentPathTemplate - .match(assessmentName) + return this._pathTemplates.assessmentPathTemplate.match(assessmentName) .project; } @@ -366,8 +364,7 @@ class RecaptchaEnterpriseServiceV1Beta1Client { * @returns {String} - A string representing the assessment. */ matchAssessmentFromAssessmentName(assessmentName) { - return this._pathTemplates.assessmentPathTemplate - .match(assessmentName) + return this._pathTemplates.assessmentPathTemplate.match(assessmentName) .assessment; } @@ -379,11 +376,8 @@ class RecaptchaEnterpriseServiceV1Beta1Client { * @returns {String} - A string representing the project. */ matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate - .match(projectName) - .project; + return this._pathTemplates.projectPathTemplate.match(projectName).project; } } - module.exports = RecaptchaEnterpriseServiceV1Beta1Client; diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index dd1b7d50d66..df700ffda58 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-05-10T12:09:57.214799Z", + "updateTime": "2019-05-14T17:26:37.612221Z", "sources": [ { "generator": { @@ -12,15 +12,15 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "07883be5bf3c3233095e99d8e92b8094f5d7084a", - "internalRef": "247530843" + "sha": "ffa256646fb15c4a6c720f0ed8f984a0ea513416", + "internalRef": "248066377" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.5.2" + "version": "2019.4.10" } } ], diff --git a/packages/google-cloud-recaptchaenterprise/system-test/.eslintrc b/packages/google-cloud-recaptchaenterprise/system-test/.eslintrc new file mode 100644 index 00000000000..e28757c0a59 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/system-test/.eslintrc @@ -0,0 +1,3 @@ +--- +env: + mocha: true \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/system-test/test.js b/packages/google-cloud-recaptchaenterprise/system-test/test.js new file mode 100644 index 00000000000..4bd12fbbc9f --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/system-test/test.js @@ -0,0 +1,23 @@ +/** + * Copyright 2019, Google, Inc. + * Licensed under the Apache License, Version 2.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'; + +describe('RecaptchaEnterpriseSystemTest', () => { + it('creates a client', async () => { + const {RecaptchaEnterpriseServiceV1Beta1Client} = require('../'); + new RecaptchaEnterpriseServiceV1Beta1Client(); + }); +}); diff --git a/packages/google-cloud-recaptchaenterprise/test/.eslintrc b/packages/google-cloud-recaptchaenterprise/test/.eslintrc new file mode 100644 index 00000000000..e28757c0a59 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/test/.eslintrc @@ -0,0 +1,3 @@ +--- +env: + mocha: true \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js b/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js index 33f92f4cc83..dfc9d3e9c3c 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js +++ b/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js @@ -25,10 +25,12 @@ error.code = FAKE_STATUS_CODE; describe('RecaptchaEnterpriseServiceV1Beta1Client', () => { describe('createAssessment', () => { it('invokes createAssessment without error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); // Mock request const formattedParent = client.projectPath('[PROJECT]'); @@ -40,7 +42,7 @@ describe('RecaptchaEnterpriseServiceV1Beta1Client', () => { // Mock response const name = 'name3373707'; - const score = 1.0926453E7; + const score = 1.0926453e7; const expectedResponse = { name: name, score: score, @@ -60,10 +62,12 @@ describe('RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes createAssessment with error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); // Mock request const formattedParent = client.projectPath('[PROJECT]'); @@ -91,10 +95,12 @@ describe('RecaptchaEnterpriseServiceV1Beta1Client', () => { describe('annotateAssessment', () => { it('invokes annotateAssessment without error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); // Mock request const formattedName = client.assessmentPath('[PROJECT]', '[ASSESSMENT]'); @@ -121,10 +127,12 @@ describe('RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes annotateAssessment with error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); // Mock request const formattedName = client.assessmentPath('[PROJECT]', '[ASSESSMENT]'); @@ -149,7 +157,6 @@ describe('RecaptchaEnterpriseServiceV1Beta1Client', () => { }); }); }); - }); function mockSimpleGrpcMethod(expectedRequest, response, error) { From ac413ce27f267d848058f899c601791b86d481b4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 14 May 2019 13:18:33 -0700 Subject: [PATCH 012/253] chore(deps): update dependency mocha to v6 (#15) --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 84740b217d2..bdfa1551eec 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -36,7 +36,7 @@ "jsdoc": "^3.6.2", "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", "linkinator": "^1.4.2", - "mocha": "^5.2.0", + "mocha": "^6.0.0", "nyc": "^14.1.1", "prettier": "^1.17.1", "through2": "^2.0.3" From 0bc5f0897c216781a96f86a286ce0b14f7497aab Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 14 May 2019 13:18:50 -0700 Subject: [PATCH 013/253] chore(deps): update dependency eslint-plugin-node to v9 (#14) --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index bdfa1551eec..eb3ea0d0966 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -31,7 +31,7 @@ "devDependencies": { "eslint": "^5.1.0", "eslint-config-prettier": "^4.0.0", - "eslint-plugin-node": "^8.0.0", + "eslint-plugin-node": "^9.0.0", "eslint-plugin-prettier": "^3.0.0", "jsdoc": "^3.6.2", "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", From 01a5e8bec490cc328068e8a4f7375f51b4ae11d6 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 14 May 2019 14:43:17 -0700 Subject: [PATCH 014/253] chore: release 1.0.0 (#20) --- .../CHANGELOG.md | 24 +++++++++++++++++++ .../package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/CHANGELOG.md diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md new file mode 100644 index 00000000000..55d6ce1ed98 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -0,0 +1,24 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions + +## 1.0.0 (2019-05-14) + + +### Bug Fixes + +* **deps:** update dependency google-gax to v1 ([#17](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/17)) ([0f9e159](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/0f9e159)) +* DEADLINE_EXCEEDED retry code is idempotent ([#10](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/10)) ([746151c](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/746151c)) +* do not retry request on DEADLINE_EXCEEDED ([a6e9f4a](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/a6e9f4a)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#2](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/2)) ([94d6a49](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/94d6a49)) + + +### BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#2) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index eb3ea0d0966..1d6521c7d8b 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "0.1.0", + "version": "1.0.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 1b20bf4ba15..c6d55af4162 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^0.1.0" + "@google-cloud/recaptcha-enterprise": "^1.0.0" }, "devDependencies": { "chai": "^4.2.0", From 611c1a4c118440c2cd104d1fe9129a767096efa3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Thu, 16 May 2019 13:20:26 -0700 Subject: [PATCH 015/253] docs: fix import example (#21) --- .../recaptcha_enterprise_service_v1_beta1_client.js | 4 ++-- packages/google-cloud-recaptchaenterprise/synth.metadata | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js index 3aaeedb3447..11de11a5640 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js @@ -212,7 +212,7 @@ class RecaptchaEnterpriseServiceV1Beta1Client { * * @example * - * const recaptchaenterprise = require('recaptchaenterprise.v1beta1'); + * const recaptchaenterprise = require('@google-cloud/recaptchaenterprise'); * * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ * // optional auth parameters. @@ -276,7 +276,7 @@ class RecaptchaEnterpriseServiceV1Beta1Client { * * @example * - * const recaptchaenterprise = require('recaptchaenterprise.v1beta1'); + * const recaptchaenterprise = require('@google-cloud/recaptchaenterprise'); * * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ * // optional auth parameters. diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index df700ffda58..71d91067581 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-05-14T17:26:37.612221Z", + "updateTime": "2019-05-15T11:21:09.217206Z", "sources": [ { "generator": { @@ -12,15 +12,15 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ffa256646fb15c4a6c720f0ed8f984a0ea513416", - "internalRef": "248066377" + "sha": "275cdfcdc3188a60456f43acd139b8cc037379f4", + "internalRef": "248217300" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.4.10" + "version": "2019.5.2" } } ], From c2ba0e9d5da2fc283599480695456af9ff0d8d94 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 17 May 2019 08:16:35 -0700 Subject: [PATCH 016/253] build: add new kokoro config for coverage and release-please (#22) --- packages/google-cloud-recaptchaenterprise/synth.metadata | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 71d91067581..80b9c57d439 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-05-15T11:21:09.217206Z", + "updateTime": "2019-05-17T01:09:41.420467Z", "sources": [ { "generator": { @@ -12,15 +12,15 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "275cdfcdc3188a60456f43acd139b8cc037379f4", - "internalRef": "248217300" + "sha": "03269e767cff9dd644d7784a4d4350b2ba6daf69", + "internalRef": "248524261" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.5.2" + "version": "2019.4.10" } } ], From 8940548cc83033bbfe89b339690f1f033024ceab Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 17 May 2019 16:50:05 -0700 Subject: [PATCH 017/253] build: updated kokoro config for coverage and release-please (#23) --- packages/google-cloud-recaptchaenterprise/synth.metadata | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 80b9c57d439..e2305208035 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-05-17T01:09:41.420467Z", + "updateTime": "2019-05-17T19:49:01.898162Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "03269e767cff9dd644d7784a4d4350b2ba6daf69", - "internalRef": "248524261" + "sha": "99efb1441b7c2aeb75c69f8baf9b61d4221bb744", + "internalRef": "248724297" } }, { From ecdf44ceeeead738287f65722a1bdd4e3077e1c8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 21 May 2019 09:27:51 -0700 Subject: [PATCH 018/253] refactor: drop dependency on lodash.merge and update links (#24) --- .../google-cloud-recaptchaenterprise/package.json | 3 +-- ...recaptcha_enterprise_service_v1_beta1_client.js | 14 +++++--------- .../synth.metadata | 12 ++++++------ 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 1d6521c7d8b..7ca3a969e6c 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -25,8 +25,7 @@ "reCAPTCHA Enterprise API" ], "dependencies": { - "google-gax": "^1.0.0", - "lodash.merge": "^4.6.0" + "google-gax": "^1.0.0" }, "devDependencies": { "eslint": "^5.1.0", diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js index 11de11a5640..0847d073171 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js @@ -16,7 +16,6 @@ const gapicConfig = require('./recaptcha_enterprise_service_v1_beta1_client_config.json'); const gax = require('google-gax'); -const merge = require('lodash.merge'); const path = require('path'); const VERSION = require('../../package.json').version; @@ -88,12 +87,9 @@ class RecaptchaEnterpriseServiceV1Beta1Client { } // Load the applicable protos. - const protos = merge( - {}, - gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - 'google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto' - ) + const protos = gaxGrpc.loadProto( + path.join(__dirname, '..', '..', 'protos'), + ['google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto'] ); // This API contains "path templates"; forward-slash-separated @@ -201,7 +197,7 @@ class RecaptchaEnterpriseServiceV1Beta1Client { * This object should have the same structure as [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -265,7 +261,7 @@ class RecaptchaEnterpriseServiceV1Beta1Client { * The number should be among the values of [Annotation]{@link google.cloud.recaptchaenterprise.v1beta1.Annotation} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index e2305208035..98c84a46f26 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-05-17T19:49:01.898162Z", + "updateTime": "2019-05-21T11:22:01.138953Z", "sources": [ { "generator": { "name": "artman", - "version": "0.19.0", - "dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e" + "version": "0.20.0", + "dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "99efb1441b7c2aeb75c69f8baf9b61d4221bb744", - "internalRef": "248724297" + "sha": "32a10f69e2c9ce15bba13ab1ff928bacebb25160", + "internalRef": "249058354" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.4.10" + "version": "2019.5.2" } } ], From e09d1ddab585cb947b84f27883ccfdff9d0e2e54 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 23 May 2019 02:39:17 +0000 Subject: [PATCH 019/253] chore: use published jsdoc-baseline package (#25) --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 7ca3a969e6c..09f2cd65311 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -33,7 +33,7 @@ "eslint-plugin-node": "^9.0.0", "eslint-plugin-prettier": "^3.0.0", "jsdoc": "^3.6.2", - "jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git", + "jsdoc-baseline": "^0.1.0", "linkinator": "^1.4.2", "mocha": "^6.0.0", "nyc": "^14.1.1", From d4ef93b8abbd1c72dab2f1eb73a1d492ccc5955d Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 28 May 2019 20:40:19 +0000 Subject: [PATCH 020/253] build: ignore proto files in test coverage (#27) --- packages/google-cloud-recaptchaenterprise/.nycrc | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-recaptchaenterprise/.nycrc b/packages/google-cloud-recaptchaenterprise/.nycrc index bfe4073a6ab..83a421a0628 100644 --- a/packages/google-cloud-recaptchaenterprise/.nycrc +++ b/packages/google-cloud-recaptchaenterprise/.nycrc @@ -10,6 +10,7 @@ "**/samples", "**/scripts", "**/src/**/v*/**/*.js", + "**/protos", "**/test", ".jsdoc.js", "**/.jsdoc.js", From e09c5cc93f3c17a112b5325e0fff1a59201488e8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 5 Jun 2019 08:46:04 -0700 Subject: [PATCH 021/253] feat: support apiEndpoint override in client constructor (#30) --- ...tcha_enterprise_service_v1_beta1_client.js | 14 +++++++++- .../synth.metadata | 10 +++---- .../test/gapic-v1beta1.js | 27 +++++++++++++++++++ 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js index 0847d073171..eef872a4b8d 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js @@ -55,14 +55,18 @@ class RecaptchaEnterpriseServiceV1Beta1Client { * API remote host. */ constructor(opts) { + opts = opts || {}; this._descriptors = {}; + const servicePath = + opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; + // Ensure that options include the service address and port. opts = Object.assign( { clientConfig: {}, port: this.constructor.port, - servicePath: this.constructor.servicePath, + servicePath, }, opts ); @@ -155,6 +159,14 @@ class RecaptchaEnterpriseServiceV1Beta1Client { return 'recaptchaenterprise.googleapis.com'; } + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'recaptchaenterprise.googleapis.com'; + } + /** * The port for this API service. */ diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 98c84a46f26..2626e6503c4 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-05-21T11:22:01.138953Z", + "updateTime": "2019-06-05T14:23:52.798433Z", "sources": [ { "generator": { "name": "artman", - "version": "0.20.0", - "dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec" + "version": "0.23.1", + "dockerImage": "googleapis/artman@sha256:9d5cae1454da64ac3a87028f8ef486b04889e351c83bb95e83b8fab3959faed0" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "32a10f69e2c9ce15bba13ab1ff928bacebb25160", - "internalRef": "249058354" + "sha": "47c142a7cecc6efc9f6f8af804b8be55392b795b", + "internalRef": "251635729" } }, { diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js b/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js index dfc9d3e9c3c..7985dd713a4 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js +++ b/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js @@ -23,6 +23,33 @@ const error = new Error(); error.code = FAKE_STATUS_CODE; describe('RecaptchaEnterpriseServiceV1Beta1Client', () => { + it('has servicePath', () => { + const servicePath = + recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no options', () => { + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); + assert(client); + }); + describe('createAssessment', () => { it('invokes createAssessment without error', done => { const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( From 6dec1277c9cc75b69d68421459ff74e754f0a742 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 5 Jun 2019 09:52:37 -0700 Subject: [PATCH 022/253] chore: release 1.1.0 (#31) * updated CHANGELOG.md * updated package.json * updated samples/package.json --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 55d6ce1ed98..321b38e2b25 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [1.1.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.0.0...v1.1.0) (2019-06-05) + + +### Features + +* support apiEndpoint override in client constructor ([#30](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/30)) ([1192afd](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/1192afd)) + ## 1.0.0 (2019-05-14) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 09f2cd65311..cf7009192cb 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.0.0", + "version": "1.1.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index c6d55af4162..2949012669d 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.0.0" + "@google-cloud/recaptcha-enterprise": "^1.1.0" }, "devDependencies": { "chai": "^4.2.0", From 394b101238a187cbd5f2035a8b82845df36dfe5c Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 12 Jun 2019 22:10:18 -0700 Subject: [PATCH 023/253] fix(docs): move to new client docs URL (#32) --- packages/google-cloud-recaptchaenterprise/.repo-metadata.json | 4 ++-- packages/google-cloud-recaptchaenterprise/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.repo-metadata.json b/packages/google-cloud-recaptchaenterprise/.repo-metadata.json index bbd5da72abb..6f32e715008 100644 --- a/packages/google-cloud-recaptchaenterprise/.repo-metadata.json +++ b/packages/google-cloud-recaptchaenterprise/.repo-metadata.json @@ -2,7 +2,7 @@ "name": "recaptcha-enterprise", "name_pretty": "Google Cloud reCAPTCHA Enterprise", "product_documentation": "https://cloud.google.com/recaptcha-enterprise/docs/", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/recaptcha-enterprise/latest/", + "client_documentation": "https://googleapis.dev/nodejs/recaptcha-enterprise/latest", "issue_tracker": "", "release_level": "alpha", "language": "nodejs", @@ -10,4 +10,4 @@ "distribution_name": "@google-cloud/recaptcha-enterprise", "api_id": "recaptchaenterprise.googleapis.com", "requires_billing": true -} +} \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index 2230d009cf2..440ddb76fc8 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -125,7 +125,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-recaptcha-enterprise/blob/master/LICENSE) -[client-docs]: https://cloud.google.com/nodejs/docs/reference/recaptcha-enterprise/latest/ +[client-docs]: https://googleapis.dev/nodejs/recaptcha-enterprise/latest [product-docs]: https://cloud.google.com/recaptcha-enterprise/docs/ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From 4d05f14eb2193dc9a6dfca7e0ee79e2b443775ff Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 14 Jun 2019 08:31:07 -0700 Subject: [PATCH 024/253] chore: release 1.1.1 (#33) * updated CHANGELOG.md * updated package.json * updated samples/package.json --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 321b38e2b25..6b4cb675fe6 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [1.1.1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.1.0...v1.1.1) (2019-06-14) + + +### Bug Fixes + +* **docs:** move to new client docs URL ([#32](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/32)) ([6a95276](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/6a95276)) + ## [1.1.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.0.0...v1.1.0) (2019-06-05) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index cf7009192cb..12c5d2d82a2 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.1.0", + "version": "1.1.1", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 2949012669d..180ed849d68 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.1.0" + "@google-cloud/recaptcha-enterprise": "^1.1.1" }, "devDependencies": { "chai": "^4.2.0", From 387f290261487239d6315fe57b608bc2eeec8d33 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 18 Jun 2019 10:04:42 -0700 Subject: [PATCH 025/253] build: switch to GitHub magic proxy (#34) --- .../google-cloud-recaptchaenterprise/synth.metadata | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 2626e6503c4..c6cad5ad6d8 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-05T14:23:52.798433Z", + "updateTime": "2019-06-18T01:03:28.810945Z", "sources": [ { "generator": { "name": "artman", - "version": "0.23.1", - "dockerImage": "googleapis/artman@sha256:9d5cae1454da64ac3a87028f8ef486b04889e351c83bb95e83b8fab3959faed0" + "version": "0.26.0", + "dockerImage": "googleapis/artman@sha256:6db0735b0d3beec5b887153a2a7c7411fc7bb53f73f6f389a822096bd14a3a15" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "47c142a7cecc6efc9f6f8af804b8be55392b795b", - "internalRef": "251635729" + "sha": "384aa843867c4d17756d14a01f047b6368494d32", + "internalRef": "253675319" } }, { From c70221d418067c4a9be90ba1b68c573bfce0aed5 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 25 Jun 2019 16:42:34 -0700 Subject: [PATCH 026/253] fix(docs): link to reference docs section on googleapis.dev (#35) * fix(docs): reference docs should link to section of googleapis.dev with API reference * fix(docs): make anchors work in jsdoc --- packages/google-cloud-recaptchaenterprise/.jsdoc.js | 3 +++ packages/google-cloud-recaptchaenterprise/README.md | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.jsdoc.js b/packages/google-cloud-recaptchaenterprise/.jsdoc.js index 6589a5d8e58..38b393dd4e5 100644 --- a/packages/google-cloud-recaptchaenterprise/.jsdoc.js +++ b/packages/google-cloud-recaptchaenterprise/.jsdoc.js @@ -41,5 +41,8 @@ module.exports = { sourceFiles: false, systemName: '@google-cloud/recaptcha-enterprise', theme: 'lumen' + }, + markdown: { + idInHeadings: true } }; diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index 440ddb76fc8..bf9fdf15dd8 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -125,10 +125,12 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-recaptcha-enterprise/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/recaptcha-enterprise/latest +[client-docs]: https://googleapis.dev/nodejs/recaptcha-enterprise/latest#reference [product-docs]: https://cloud.google.com/recaptcha-enterprise/docs/ [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=recaptchaenterprise.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file +[auth]: https://cloud.google.com/docs/authentication/getting-started + + From 955658d575f8b9a815d4214023fdbec114a98b25 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 26 Jun 2019 15:35:24 -0700 Subject: [PATCH 027/253] chore: release 1.1.2 (#36) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 6b4cb675fe6..3fdc2fb7b59 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [1.1.2](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.1.1...v1.1.2) (2019-06-26) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#35](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/35)) ([14ada6b](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/14ada6b)) + ### [1.1.1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.1.0...v1.1.1) (2019-06-14) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 12c5d2d82a2..f6d9e14ed64 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.1.1", + "version": "1.1.2", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 180ed849d68..c18327cfaf5 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.1.1" + "@google-cloud/recaptcha-enterprise": "^1.1.2" }, "devDependencies": { "chai": "^4.2.0", From 31c652a7bd21fc0496f96728ca600af0e5a7b054 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 28 Jun 2019 10:07:12 -0700 Subject: [PATCH 028/253] build: use config file for linkinator (#37) --- .../linkinator.config.json | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/linkinator.config.json diff --git a/packages/google-cloud-recaptchaenterprise/linkinator.config.json b/packages/google-cloud-recaptchaenterprise/linkinator.config.json new file mode 100644 index 00000000000..d780d6bfff5 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/linkinator.config.json @@ -0,0 +1,7 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com" + ] +} diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index f6d9e14ed64..91033caa6f2 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -34,7 +34,7 @@ "eslint-plugin-prettier": "^3.0.0", "jsdoc": "^3.6.2", "jsdoc-baseline": "^0.1.0", - "linkinator": "^1.4.2", + "linkinator": "^1.5.0", "mocha": "^6.0.0", "nyc": "^14.1.1", "prettier": "^1.17.1", @@ -49,7 +49,7 @@ "test-no-cover": "mocha test/*.js", "test": "npm run cover", "fix": "eslint --fix '**/*.js'", - "docs-test": "linkinator docs -r --skip 'www.npmjs.org/package/@google-cloud/recaptcha-enterprise|cloud.google.com/nodejs/docs/reference/recaptcha-enterprise/latest/|github.com/googleapis/nodejs-recaptcha-enterprise/tree/master/samples|https://github.com/googleapis/nodejs-recaptcha-enterprise/blob/master/samples/quickstart.js'", + "docs-test": "linkinator docs", "predocs-test": "npm run docs" }, "license": "Apache-2.0", From 938a3255c2ffe86235a117a4e9044c19221a14dd Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 22 Jul 2019 22:31:04 -0700 Subject: [PATCH 029/253] chore(deps): drop dependency on through2 (#38) --- packages/google-cloud-recaptchaenterprise/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 91033caa6f2..58dc0f0d9a7 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -37,8 +37,7 @@ "linkinator": "^1.5.0", "mocha": "^6.0.0", "nyc": "^14.1.1", - "prettier": "^1.17.1", - "through2": "^2.0.3" + "prettier": "^1.17.1" }, "scripts": { "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", From baca21d91ed16346586e6f82c281dfdf55b749fa Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 26 Jul 2019 18:58:28 +0300 Subject: [PATCH 030/253] chore(deps): update linters (#39) --- packages/google-cloud-recaptchaenterprise/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 58dc0f0d9a7..cfe82145796 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -28,8 +28,8 @@ "google-gax": "^1.0.0" }, "devDependencies": { - "eslint": "^5.1.0", - "eslint-config-prettier": "^4.0.0", + "eslint": "^6.0.0", + "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^9.0.0", "eslint-plugin-prettier": "^3.0.0", "jsdoc": "^3.6.2", From 4757f1ecedff16189ced8f9ef83e3b5ae707c4db Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 31 Jul 2019 08:42:35 -0700 Subject: [PATCH 031/253] docs: use the jsdoc-fresh theme (#40) --- packages/google-cloud-recaptchaenterprise/.jsdoc.js | 2 +- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.jsdoc.js b/packages/google-cloud-recaptchaenterprise/.jsdoc.js index 38b393dd4e5..52f4bb3395f 100644 --- a/packages/google-cloud-recaptchaenterprise/.jsdoc.js +++ b/packages/google-cloud-recaptchaenterprise/.jsdoc.js @@ -20,7 +20,7 @@ module.exports = { opts: { readme: './README.md', package: './package.json', - template: './node_modules/jsdoc-baseline', + template: './node_modules/jsdoc-fresh', recurse: true, verbose: true, destination: './docs/' diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index cfe82145796..31a46c44fcb 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -33,7 +33,7 @@ "eslint-plugin-node": "^9.0.0", "eslint-plugin-prettier": "^3.0.0", "jsdoc": "^3.6.2", - "jsdoc-baseline": "^0.1.0", + "jsdoc-fresh": "^1.0.1", "linkinator": "^1.5.0", "mocha": "^6.0.0", "nyc": "^14.1.1", From caf2b63c519457e0cbdba62fe35374f94394490f Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 31 Jul 2019 16:07:08 -0700 Subject: [PATCH 032/253] docs: document apiEndpoint over servicePath (#41) --- .../src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js index eef872a4b8d..5cf07f7d89d 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js @@ -51,7 +51,7 @@ class RecaptchaEnterpriseServiceV1Beta1Client { * your project ID will be detected automatically. * @param {function} [options.promise] - Custom promise module to use instead * of native Promises. - * @param {string} [options.servicePath] - The domain name of the + * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ constructor(opts) { From 8f952d59f69a9a8191a2632ef5a6890c5c88548e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 2 Aug 2019 10:52:57 -0700 Subject: [PATCH 033/253] fix: allow calls with no request, add JSON proto --- .../protos/protos.json | 1174 +++++++++++++++++ .../src/service_proto_list.json | 1 + ...tcha_enterprise_service_v1_beta1_client.js | 2 + .../synth.metadata | 10 +- 4 files changed, 1182 insertions(+), 5 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/protos/protos.json create mode 100644 packages/google-cloud-recaptchaenterprise/src/service_proto_list.json diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json new file mode 100644 index 00000000000..3f449b77682 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -0,0 +1,1174 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "recaptchaenterprise": { + "nested": { + "v1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.RecaptchaEnterprise.V1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1beta1;recaptchaenterprise", + "java_multiple_files": true, + "java_outer_classname": "RecaptchaEnterpriseProto", + "java_package": "com.google.recaptchaenterprise.v1beta1", + "objc_class_prefix": "GCRE", + "php_namespace": "Google\\Cloud\\RecaptchaEnterprise\\V1beta1" + }, + "nested": { + "RecaptchaEnterpriseServiceV1Beta1": { + "methods": { + "CreateAssessment": { + "requestType": "CreateAssessmentRequest", + "responseType": "Assessment", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*}/assessments", + "(google.api.http).body": "assessment" + } + }, + "AnnotateAssessment": { + "requestType": "AnnotateAssessmentRequest", + "responseType": "AnnotateAssessmentResponse", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/assessments/*}:annotate", + "(google.api.http).body": "*" + } + } + } + }, + "CreateAssessmentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "assessment": { + "type": "Assessment", + "id": 2 + } + } + }, + "AnnotateAssessmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "annotation": { + "type": "Annotation", + "id": 2 + } + }, + "nested": { + "Annotation": { + "values": { + "ANNOTATION_UNSPECIFIED": 0, + "LEGITIMATE": 1, + "FRAUDULENT": 2 + } + } + } + }, + "AnnotateAssessmentResponse": { + "fields": {} + }, + "Assessment": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "event": { + "type": "Event", + "id": 2 + }, + "score": { + "type": "float", + "id": 3 + }, + "tokenProperties": { + "type": "TokenProperties", + "id": 4 + }, + "reasons": { + "rule": "repeated", + "type": "ClassificationReason", + "id": 5 + } + }, + "nested": { + "ClassificationReason": { + "values": { + "CLASSIFICATION_REASON_UNSPECIFIED": 0, + "AUTOMATION": 1, + "UNEXPECTED_ENVIRONMENT": 2, + "UNEXPECTED_USAGE_PATTERNS": 4, + "PROVISIONAL_RISK_ANALYSIS": 5 + } + } + } + }, + "Event": { + "fields": { + "token": { + "type": "string", + "id": 1 + }, + "siteKey": { + "type": "string", + "id": 2 + } + } + }, + "TokenProperties": { + "fields": { + "valid": { + "type": "bool", + "id": 1 + }, + "invalidReason": { + "type": "InvalidReason", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "hostname": { + "type": "string", + "id": 4 + }, + "action": { + "type": "string", + "id": 5 + } + }, + "nested": { + "InvalidReason": { + "values": { + "INVALID_REASON_UNSPECIFIED": 0, + "UNKNOWN_INVALID_REASON": 1, + "MALFORMED": 2, + "EXPIRED": 3, + "DUPE": 4, + "SITE_MISMATCH": 5, + "MISSING": 6 + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "HttpProto", + "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 + } + } + } + } + }, + "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 + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/src/service_proto_list.json b/packages/google-cloud-recaptchaenterprise/src/service_proto_list.json new file mode 100644 index 00000000000..5e0928495a5 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/service_proto_list.json @@ -0,0 +1 @@ +["../protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto"] \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js index 5cf07f7d89d..ebd479825a7 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js @@ -246,6 +246,7 @@ class RecaptchaEnterpriseServiceV1Beta1Client { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -310,6 +311,7 @@ class RecaptchaEnterpriseServiceV1Beta1Client { callback = options; options = {}; } + request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index c6cad5ad6d8..5c5613715ae 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-18T01:03:28.810945Z", + "updateTime": "2019-08-02T11:22:34.432117Z", "sources": [ { "generator": { "name": "artman", - "version": "0.26.0", - "dockerImage": "googleapis/artman@sha256:6db0735b0d3beec5b887153a2a7c7411fc7bb53f73f6f389a822096bd14a3a15" + "version": "0.32.0", + "dockerImage": "googleapis/artman@sha256:6929f343c400122d85818195b18613330a12a014bffc1e08499550d40571479d" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "384aa843867c4d17756d14a01f047b6368494d32", - "internalRef": "253675319" + "sha": "3a40d3a5f5e5a33fd49888a8a33ed021f65c0ccf", + "internalRef": "261297518" } }, { From b2d3514d59af72fdaafe2c280ac7772c8e8e9acd Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 5 Aug 2019 09:53:50 -0700 Subject: [PATCH 034/253] chore: release 1.1.3 (#45) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 3fdc2fb7b59..be88f1a550a 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [1.1.3](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.1.2...v1.1.3) (2019-08-05) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([ab643f8](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/ab643f8)) + ### [1.1.2](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.1.1...v1.1.2) (2019-06-26) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 31a46c44fcb..5ebbf0aced8 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.1.2", + "version": "1.1.3", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index c18327cfaf5..ca5cbe96007 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.1.2" + "@google-cloud/recaptcha-enterprise": "^1.1.3" }, "devDependencies": { "chai": "^4.2.0", From 8d0d87f0a4dfc7d74537f56e7d9419d77a917655 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 25 Aug 2019 18:03:03 -0700 Subject: [PATCH 035/253] fix: include the correct version of node in a header (#46) --- .../recaptcha_enterprise_service_v1_beta1_client.js | 2 +- .../google-cloud-recaptchaenterprise/synth.metadata | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js index ebd479825a7..9094e48a3c9 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js @@ -81,7 +81,7 @@ class RecaptchaEnterpriseServiceV1Beta1Client { // Determine the client header string. const clientHeader = [ - `gl-node/${process.version}`, + `gl-node/${process.versions.node}`, `grpc/${gaxGrpc.grpcVersion}`, `gax/${gax.version}`, `gapic/${VERSION}`, diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 5c5613715ae..1c3f021f9f7 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-02T11:22:34.432117Z", + "updateTime": "2019-08-21T11:20:00.859575Z", "sources": [ { "generator": { "name": "artman", - "version": "0.32.0", - "dockerImage": "googleapis/artman@sha256:6929f343c400122d85818195b18613330a12a014bffc1e08499550d40571479d" + "version": "0.34.0", + "dockerImage": "googleapis/artman@sha256:38a27ba6245f96c3e86df7acb2ebcc33b4f186d9e475efe2d64303aec3d4e0ea" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3a40d3a5f5e5a33fd49888a8a33ed021f65c0ccf", - "internalRef": "261297518" + "sha": "11592a15391951348a64f5c303399733b1c5b3b2", + "internalRef": "264425502" } }, { From c38a014a8e1b316d4a8c43b136d37e80b1d40606 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 25 Aug 2019 19:30:17 -0700 Subject: [PATCH 036/253] chore: release 1.1.4 (#47) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index be88f1a550a..6ad531b6a1d 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [1.1.4](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.1.3...v1.1.4) (2019-08-26) + + +### Bug Fixes + +* include the correct version of node in a header ([#46](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/46)) ([2cc8099](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/2cc8099)) + ### [1.1.3](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.1.2...v1.1.3) (2019-08-05) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 5ebbf0aced8..b45ac070766 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.1.3", + "version": "1.1.4", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index ca5cbe96007..bef13e4cecb 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.1.3" + "@google-cloud/recaptcha-enterprise": "^1.1.4" }, "devDependencies": { "chai": "^4.2.0", From eff4cc8811abe4135b01ca2f3f56d5519bf1faf4 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 27 Aug 2019 07:51:28 -0700 Subject: [PATCH 037/253] docs: update function documentation --- .../src/v1beta1/doc/google/protobuf/doc_timestamp.js | 10 ++++++---- .../google-cloud-recaptchaenterprise/synth.metadata | 10 +++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_timestamp.js index b643b2d6c1e..3bc1e986897 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_timestamp.js @@ -89,11 +89,13 @@ * 01:30 UTC on January 15, 2017. * * In JavaScript, one can convert a Date object to this format using the - * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) - * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://cloud.google.com + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://cloud.google.com * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D * ) to obtain a formatter capable of generating timestamps in this format. * diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 1c3f021f9f7..7c0dd58234f 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-21T11:20:00.859575Z", + "updateTime": "2019-08-27T11:17:19.141986Z", "sources": [ { "generator": { "name": "artman", - "version": "0.34.0", - "dockerImage": "googleapis/artman@sha256:38a27ba6245f96c3e86df7acb2ebcc33b4f186d9e475efe2d64303aec3d4e0ea" + "version": "0.35.1", + "dockerImage": "googleapis/artman@sha256:b11c7ea0d0831c54016fb50f4b796d24d1971439b30fbc32a369ba1ac887c384" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "11592a15391951348a64f5c303399733b1c5b3b2", - "internalRef": "264425502" + "sha": "650caad718bb063f189405c23972dc9818886358", + "internalRef": "265565344" } }, { From 3bd72a79d6be023fba676209747551f1191c9018 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 28 Aug 2019 12:20:39 -0700 Subject: [PATCH 038/253] docs: update link to client docs (#50) --- packages/google-cloud-recaptchaenterprise/README.md | 4 +--- packages/google-cloud-recaptchaenterprise/synth.metadata | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index bf9fdf15dd8..401ce585570 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -125,12 +125,10 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-recaptcha-enterprise/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/recaptcha-enterprise/latest#reference +[client-docs]: https://googleapis.dev/nodejs/recaptcha-enterprise/latest [product-docs]: https://cloud.google.com/recaptcha-enterprise/docs/ [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=recaptchaenterprise.googleapis.com [auth]: https://cloud.google.com/docs/authentication/getting-started - - diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 7c0dd58234f..55b4ae6288f 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-08-27T11:17:19.141986Z", + "updateTime": "2019-08-28T11:19:03.821244Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "650caad718bb063f189405c23972dc9818886358", - "internalRef": "265565344" + "sha": "dbd38035c35083507e2f0b839985cf17e212cb1c", + "internalRef": "265796259" } }, { From 7632defe1194ff24485db271b9153e140608f58c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 3 Sep 2019 14:05:32 -0700 Subject: [PATCH 039/253] feat: load protos from JSON, grpc-fallback support * [CHANGE ME] Re-generated to pick up changes in the API or client library generator. * fixes * fix webpack.config.js --- .../src/browser.js | 21 +++++ .../src/service_proto_list.json | 1 - ...tcha_enterprise_service_v1_beta1_client.js | 77 +++++++++++++------ ...nterprise_service_v1_beta1_proto_list.json | 3 + .../synth.metadata | 10 +-- .../test/gapic-v1beta1.js | 7 ++ .../webpack.config.js | 46 +++++++++++ 7 files changed, 134 insertions(+), 31 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/src/browser.js delete mode 100644 packages/google-cloud-recaptchaenterprise/src/service_proto_list.json create mode 100644 packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_proto_list.json create mode 100644 packages/google-cloud-recaptchaenterprise/webpack.config.js diff --git a/packages/google-cloud-recaptchaenterprise/src/browser.js b/packages/google-cloud-recaptchaenterprise/src/browser.js new file mode 100644 index 00000000000..ddbcd7ecb9a --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/browser.js @@ -0,0 +1,21 @@ +// 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 +// +// 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'; + +// Set a flag that we are running in a browser bundle. +global.isBrowser = true; + +// Re-export all exports from ./index.js. +module.exports = require('./index'); diff --git a/packages/google-cloud-recaptchaenterprise/src/service_proto_list.json b/packages/google-cloud-recaptchaenterprise/src/service_proto_list.json deleted file mode 100644 index 5e0928495a5..00000000000 --- a/packages/google-cloud-recaptchaenterprise/src/service_proto_list.json +++ /dev/null @@ -1 +0,0 @@ -["../protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto"] \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js index 9094e48a3c9..e3ac9d680b7 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js @@ -58,6 +58,16 @@ class RecaptchaEnterpriseServiceV1Beta1Client { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + 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. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -74,36 +84,51 @@ class RecaptchaEnterpriseServiceV1Beta1Client { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.versions.node}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); 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' + ); const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto'] + opts.fallback ? 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 = { - assessmentPathTemplate: new gax.PathTemplate( + assessmentPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/assessments/{assessment}' ), - projectPathTemplate: new gax.PathTemplate('projects/{project}'), + projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), }; // Put together the default options sent with requests. @@ -122,8 +147,12 @@ class RecaptchaEnterpriseServiceV1Beta1Client { // Put together the "service stub" for // google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1. const recaptchaEnterpriseServiceV1Beta1Stub = gaxGrpc.createStub( - protos.google.cloud.recaptchaenterprise.v1beta1 - .RecaptchaEnterpriseServiceV1Beta1, + opts.fallback + ? protos.lookupService( + 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1' + ) + : protos.google.cloud.recaptchaenterprise.v1beta1 + .RecaptchaEnterpriseServiceV1Beta1, opts ); @@ -134,18 +163,16 @@ class RecaptchaEnterpriseServiceV1Beta1Client { 'annotateAssessment', ]; for (const methodName of recaptchaEnterpriseServiceV1Beta1StubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - recaptchaEnterpriseServiceV1Beta1Stub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = recaptchaEnterpriseServiceV1Beta1Stub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], null ); diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_proto_list.json b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_proto_list.json new file mode 100644 index 00000000000..35d2e7543ad --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto" +] diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 55b4ae6288f..7d8d1bcaf7e 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-28T11:19:03.821244Z", + "updateTime": "2019-08-31T11:15:56.932984Z", "sources": [ { "generator": { "name": "artman", - "version": "0.35.1", - "dockerImage": "googleapis/artman@sha256:b11c7ea0d0831c54016fb50f4b796d24d1971439b30fbc32a369ba1ac887c384" + "version": "0.36.1", + "dockerImage": "googleapis/artman@sha256:7c20f006c7a62d9d782e2665647d52290c37a952ef3cd134624d5dd62b3f71bd" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "dbd38035c35083507e2f0b839985cf17e212cb1c", - "internalRef": "265796259" + "sha": "82809578652607c8ee29d9e199c21f28f81a03e0", + "internalRef": "266247326" } }, { diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js b/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js index 7985dd713a4..9ff1a38f540 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js +++ b/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js @@ -50,6 +50,13 @@ describe('RecaptchaEnterpriseServiceV1Beta1Client', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + {fallback: true} + ); + assert(client); + }); + describe('createAssessment', () => { it('invokes createAssessment without error', done => { const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( diff --git a/packages/google-cloud-recaptchaenterprise/webpack.config.js b/packages/google-cloud-recaptchaenterprise/webpack.config.js new file mode 100644 index 00000000000..3eb4643e0c1 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/webpack.config.js @@ -0,0 +1,46 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + entry: './src/browser.js', + output: { + library: 'recaptchaenterprise', + filename: './recaptchaenterprise.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + extensions: ['.js', '.json'], + }, + module: { + rules: [ + { + 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 65642829918c81e220999c828b591c7ae352a4da Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 9 Sep 2019 21:30:58 +0300 Subject: [PATCH 040/253] chore(deps): update dependency eslint-plugin-node to v10 (#53) --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index b45ac070766..5ab30e9c68f 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -30,7 +30,7 @@ "devDependencies": { "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", - "eslint-plugin-node": "^9.0.0", + "eslint-plugin-node": "^10.0.0", "eslint-plugin-prettier": "^3.0.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", From 1ef9ec56df858bc79be9fddd413e376f41053475 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 10 Sep 2019 09:40:55 -0700 Subject: [PATCH 041/253] chore: add conformance folder to nyc ignore list (#55) --- packages/google-cloud-recaptchaenterprise/.nycrc | 1 + packages/google-cloud-recaptchaenterprise/synth.metadata | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.nycrc b/packages/google-cloud-recaptchaenterprise/.nycrc index 83a421a0628..23e322204ec 100644 --- a/packages/google-cloud-recaptchaenterprise/.nycrc +++ b/packages/google-cloud-recaptchaenterprise/.nycrc @@ -6,6 +6,7 @@ "**/.coverage", "**/apis", "**/benchmark", + "**/conformance", "**/docs", "**/samples", "**/scripts", diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 7d8d1bcaf7e..72e7040bbef 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,19 +1,18 @@ { - "updateTime": "2019-08-31T11:15:56.932984Z", + "updateTime": "2019-09-10T11:20:43.095715Z", "sources": [ { "generator": { "name": "artman", - "version": "0.36.1", - "dockerImage": "googleapis/artman@sha256:7c20f006c7a62d9d782e2665647d52290c37a952ef3cd134624d5dd62b3f71bd" + "version": "0.36.2", + "dockerImage": "googleapis/artman@sha256:0e6f3a668cd68afc768ecbe08817cf6e56a0e64fcbdb1c58c3b97492d12418a1" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "82809578652607c8ee29d9e199c21f28f81a03e0", - "internalRef": "266247326" + "sha": "26e189ad03ba63591fb26eecb6aaade7ad39f57a" } }, { From 9e26b1f37c355bc37a952c770bf1bc0f8df96282 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 16 Sep 2019 09:56:54 -0700 Subject: [PATCH 042/253] chore: release 1.2.0 (#52) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 6ad531b6a1d..ff5e35d2b08 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [1.2.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.1.4...v1.2.0) (2019-09-16) + + +### Features + +* load protos from JSON, grpc-fallback support ([7a4b2a6](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/7a4b2a6)) + ### [1.1.4](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.1.3...v1.1.4) (2019-08-26) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 5ab30e9c68f..faf5fea4c36 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.1.4", + "version": "1.2.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index bef13e4cecb..f1a613e998c 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.1.4" + "@google-cloud/recaptcha-enterprise": "^1.2.0" }, "devDependencies": { "chai": "^4.2.0", From 483051cd3ce8aa361701edfe60a331ee9696a03f Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 27 Sep 2019 02:04:35 -0400 Subject: [PATCH 043/253] chore: add protos/ to .eslintignore --- packages/google-cloud-recaptchaenterprise/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-recaptchaenterprise/.eslintignore b/packages/google-cloud-recaptchaenterprise/.eslintignore index f0c7aead4bf..09b31fe735a 100644 --- a/packages/google-cloud-recaptchaenterprise/.eslintignore +++ b/packages/google-cloud-recaptchaenterprise/.eslintignore @@ -2,3 +2,4 @@ src/**/doc/* build/ docs/ +protos/ From a97ddcb1c9dd34bddf0a16410edf2c466fccf3cd Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 1 Oct 2019 20:15:04 -0700 Subject: [PATCH 044/253] fix: use compatible version of google-gax * fix: use compatible version of google-gax * fix: use gax v1.6.3 --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index faf5fea4c36..663b63e5a9f 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -25,7 +25,7 @@ "reCAPTCHA Enterprise API" ], "dependencies": { - "google-gax": "^1.0.0" + "google-gax": "^1.6.3" }, "devDependencies": { "eslint": "^6.0.0", From 97aa4e6e054d329197057c5e4e73f05e6191dfee Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 8 Oct 2019 18:05:49 -0700 Subject: [PATCH 045/253] chore: update CONTRIBUTING.md and make releaseType node (#64) --- .../google-cloud-recaptchaenterprise/CONTRIBUTING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/google-cloud-recaptchaenterprise/CONTRIBUTING.md b/packages/google-cloud-recaptchaenterprise/CONTRIBUTING.md index 78aaa61b269..f6c4cf010e3 100644 --- a/packages/google-cloud-recaptchaenterprise/CONTRIBUTING.md +++ b/packages/google-cloud-recaptchaenterprise/CONTRIBUTING.md @@ -34,6 +34,7 @@ accept your pull requests. 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 @@ -46,8 +47,17 @@ accept your pull requests. 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 From e0d0e6f310fa910df9baa7085b094f8d3a662c05 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 12 Oct 2019 10:21:38 -0700 Subject: [PATCH 046/253] feat: update scopes and classifications (#60) --- .../v1beta1/recaptchaenterprise.proto | 82 +- .../protos/protos.d.ts | 4503 ++++++ .../protos/protos.js | 12007 ++++++++++++++++ .../protos/protos.json | 155 +- .../v1beta1/doc_recaptchaenterprise.js | 36 +- ...tcha_enterprise_service_v1_beta1_client.js | 4 +- .../synth.metadata | 9 +- 7 files changed, 16733 insertions(+), 63 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/protos/protos.d.ts create mode 100644 packages/google-cloud-recaptchaenterprise/protos/protos.js diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto index 188f99f6f77..c2025d4500e 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto @@ -18,6 +18,9 @@ syntax = "proto3"; package google.cloud.recaptchaenterprise.v1beta1; import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.RecaptchaEnterprise.V1Beta1"; @@ -28,15 +31,18 @@ option java_package = "com.google.recaptchaenterprise.v1beta1"; option objc_class_prefix = "GCRE"; option php_namespace = "Google\\Cloud\\RecaptchaEnterprise\\V1beta1"; - // Service to determine the likelihood an event is legitimate. service RecaptchaEnterpriseServiceV1Beta1 { + option (google.api.default_host) = "recaptchaenterprise.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + // Creates an Assessment of the likelihood an event is legitimate. rpc CreateAssessment(CreateAssessmentRequest) returns (Assessment) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*}/assessments" body: "assessment" }; + option (google.api.method_signature) = "parent,assessment"; } // Annotates a previously created Assessment to provide additional information @@ -46,6 +52,7 @@ service RecaptchaEnterpriseServiceV1Beta1 { post: "/v1beta1/{name=projects/*/assessments/*}:annotate" body: "*" }; + option (google.api.method_signature) = "name,annotation"; } } @@ -53,10 +60,15 @@ service RecaptchaEnterpriseServiceV1Beta1 { message CreateAssessmentRequest { // Required. The name of the project in which the assessment will be created, // in the format "projects/{project_number}". - string parent = 1; - - // The asessment details. - Assessment assessment = 2; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The assessment details. + Assessment assessment = 2 [(google.api.field_behavior) = REQUIRED]; } // The request message to annotate an Assessment. @@ -75,10 +87,15 @@ message AnnotateAssessmentRequest { // Required. The resource name of the Assessment, in the format // "projects/{project_number}/assessments/{assessment_id}". - string name = 1; - - // The annotation that will be assigned to the Event. - Annotation annotation = 2; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/Assessment" + } + ]; + + // Required. The annotation that will be assigned to the Event. + Annotation annotation = 2 [(google.api.field_behavior) = REQUIRED]; } // Empty response for AnnotateAssessment. @@ -88,30 +105,38 @@ message AnnotateAssessmentResponse { // A recaptcha assessment resource. message Assessment { + option (google.api.resource) = { + type: "recaptchaenterprise.googleapis.com/Assessment" + pattern: "projects/{project}/assessments/{assessment}" + }; + // LINT.IfChange(classification_reason) // Reasons contributing to the risk analysis verdict. enum ClassificationReason { // Default unspecified type. CLASSIFICATION_REASON_UNSPECIFIED = 0; - // The event appeared to be automated. + // Interactions matched the behavior of an automated agent. AUTOMATION = 1; - // The event was not made from the proper context on the real site. + // The event originated from an illegitimate environment. UNEXPECTED_ENVIRONMENT = 2; - // Browsing behavior leading up to the event was generated was out of the - // ordinary. + // Traffic volume from the event source is higher than normal. + TOO_MUCH_TRAFFIC = 3; + + // Interactions with the site were significantly different than expected + // patterns. UNEXPECTED_USAGE_PATTERNS = 4; // Too little traffic has been received from this site thus far to generate // quality risk analysis. - PROVISIONAL_RISK_ANALYSIS = 5; + LOW_CONFIDENCE_SCORE = 5; } // Output only. The resource name for the Assessment in the format // "projects/{project_number}/assessments/{assessment_id}". - string name = 1; + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // The event being assessed. Event event = 2; @@ -119,26 +144,27 @@ message Assessment { // Output only. Legitimate event score from 0.0 to 1.0. // (1.0 means very likely legitimate traffic while 0.0 means very likely // non-legitimate traffic). - float score = 3; + float score = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Properties of the provided event token. - TokenProperties token_properties = 4; + TokenProperties token_properties = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Reasons contributing to the risk analysis verdict. - repeated ClassificationReason reasons = 5; + repeated ClassificationReason reasons = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; } message Event { - // The user response token provided by the reCAPTCHA client-side integration + // Required. The user response token provided by the reCAPTCHA client-side integration // on your site. - string token = 1; + string token = 1 [(google.api.field_behavior) = REQUIRED]; - // The site key that was used to invoke reCAPTCHA on your site and generate + // Required. The site key that was used to invoke reCAPTCHA on your site and generate // the token. - string site_key = 2; + string site_key = 2 [(google.api.field_behavior) = REQUIRED]; } message TokenProperties { + // LINT.IfChange // Enum that represents the types of invalid token reasons. enum InvalidReason { // Default unspecified type. @@ -156,7 +182,7 @@ message TokenProperties { // The user verification had already been seen. DUPE = 4; - // The user verification token did not match the provided site secret. + // The user verification token did not match the provided site key. // This may be a configuration error (e.g. development keys used in // production) or end users trying to use verification tokens from other // sites. @@ -166,18 +192,18 @@ message TokenProperties { MISSING = 6; } - // Output only. Whether the provided user response token is valid. + // Whether the provided user response token is valid. bool valid = 1; - // Output only. Reason associated with the response when valid = false. + // Reason associated with the response when valid = false. InvalidReason invalid_reason = 2; - // Output only. The timestamp corresponding to the generation of the token. + // The timestamp corresponding to the generation of the token. google.protobuf.Timestamp create_time = 3; - // Output only. The hostname of the page on which the token was generated. + // The hostname of the page on which the token was generated. string hostname = 4; - // Output only. Action name provided at token generation. + // Action name provided at token generation. string action = 5; } diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts new file mode 100644 index 00000000000..c96a45c8cc2 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -0,0 +1,4503 @@ +import * as $protobuf from "protobufjs"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace recaptchaenterprise. */ + namespace recaptchaenterprise { + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Represents a RecaptchaEnterpriseServiceV1Beta1 */ + class RecaptchaEnterpriseServiceV1Beta1 extends $protobuf.rpc.Service { + + /** + * Constructs a new RecaptchaEnterpriseServiceV1Beta1 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 RecaptchaEnterpriseServiceV1Beta1 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): RecaptchaEnterpriseServiceV1Beta1; + + /** + * Calls CreateAssessment. + * @param request CreateAssessmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Assessment + */ + public createAssessment(request: google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, callback: google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateAssessmentCallback): void; + + /** + * Calls CreateAssessment. + * @param request CreateAssessmentRequest message or plain object + * @returns Promise + */ + public createAssessment(request: google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest): Promise; + + /** + * Calls AnnotateAssessment. + * @param request AnnotateAssessmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnnotateAssessmentResponse + */ + public annotateAssessment(request: google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, callback: google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.AnnotateAssessmentCallback): void; + + /** + * Calls AnnotateAssessment. + * @param request AnnotateAssessmentRequest message or plain object + * @returns Promise + */ + public annotateAssessment(request: google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest): Promise; + } + + namespace RecaptchaEnterpriseServiceV1Beta1 { + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#createAssessment}. + * @param error Error, if any + * @param [response] Assessment + */ + type CreateAssessmentCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1beta1.Assessment) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#annotateAssessment}. + * @param error Error, if any + * @param [response] AnnotateAssessmentResponse + */ + type AnnotateAssessmentCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse) => void; + } + + /** Properties of a CreateAssessmentRequest. */ + interface ICreateAssessmentRequest { + + /** CreateAssessmentRequest parent */ + parent?: (string|null); + + /** CreateAssessmentRequest assessment */ + assessment?: (google.cloud.recaptchaenterprise.v1beta1.IAssessment|null); + } + + /** Represents a CreateAssessmentRequest. */ + class CreateAssessmentRequest implements ICreateAssessmentRequest { + + /** + * Constructs a new CreateAssessmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest); + + /** CreateAssessmentRequest parent. */ + public parent: string; + + /** CreateAssessmentRequest assessment. */ + public assessment?: (google.cloud.recaptchaenterprise.v1beta1.IAssessment|null); + + /** + * Creates a new CreateAssessmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAssessmentRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest): google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest; + + /** + * Encodes the specified CreateAssessmentRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest.verify|verify} messages. + * @param message CreateAssessmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAssessmentRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest.verify|verify} messages. + * @param message CreateAssessmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAssessmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAssessmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest; + + /** + * Decodes a CreateAssessmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAssessmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest; + + /** + * Verifies a CreateAssessmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAssessmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAssessmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest; + + /** + * Creates a plain object from a CreateAssessmentRequest message. Also converts values to other types if specified. + * @param message CreateAssessmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAssessmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateAssessmentRequest. */ + interface IAnnotateAssessmentRequest { + + /** AnnotateAssessmentRequest name */ + name?: (string|null); + + /** AnnotateAssessmentRequest annotation */ + annotation?: (google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation|null); + } + + /** Represents an AnnotateAssessmentRequest. */ + class AnnotateAssessmentRequest implements IAnnotateAssessmentRequest { + + /** + * Constructs a new AnnotateAssessmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest); + + /** AnnotateAssessmentRequest name. */ + public name: string; + + /** AnnotateAssessmentRequest annotation. */ + public annotation: google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation; + + /** + * Creates a new AnnotateAssessmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateAssessmentRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest): google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest; + + /** + * Encodes the specified AnnotateAssessmentRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.verify|verify} messages. + * @param message AnnotateAssessmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateAssessmentRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.verify|verify} messages. + * @param message AnnotateAssessmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateAssessmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateAssessmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest; + + /** + * Decodes an AnnotateAssessmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateAssessmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest; + + /** + * Verifies an AnnotateAssessmentRequest message. + * @param message Plain 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 AnnotateAssessmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateAssessmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest; + + /** + * Creates a plain object from an AnnotateAssessmentRequest message. Also converts values to other types if specified. + * @param message AnnotateAssessmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateAssessmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AnnotateAssessmentRequest { + + /** Annotation enum. */ + enum Annotation { + ANNOTATION_UNSPECIFIED = 0, + LEGITIMATE = 1, + FRAUDULENT = 2 + } + } + + /** Properties of an AnnotateAssessmentResponse. */ + interface IAnnotateAssessmentResponse { + } + + /** Represents an AnnotateAssessmentResponse. */ + class AnnotateAssessmentResponse implements IAnnotateAssessmentResponse { + + /** + * Constructs a new AnnotateAssessmentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse); + + /** + * Creates a new AnnotateAssessmentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateAssessmentResponse instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse): google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse; + + /** + * Encodes the specified AnnotateAssessmentResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse.verify|verify} messages. + * @param message AnnotateAssessmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateAssessmentResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse.verify|verify} messages. + * @param message AnnotateAssessmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateAssessmentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateAssessmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse; + + /** + * Decodes an AnnotateAssessmentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateAssessmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse; + + /** + * Verifies an AnnotateAssessmentResponse message. + * @param message Plain 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 AnnotateAssessmentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateAssessmentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse; + + /** + * Creates a plain object from an AnnotateAssessmentResponse message. Also converts values to other types if specified. + * @param message AnnotateAssessmentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateAssessmentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Assessment. */ + interface IAssessment { + + /** Assessment name */ + name?: (string|null); + + /** Assessment event */ + event?: (google.cloud.recaptchaenterprise.v1beta1.IEvent|null); + + /** Assessment score */ + score?: (number|null); + + /** Assessment tokenProperties */ + tokenProperties?: (google.cloud.recaptchaenterprise.v1beta1.ITokenProperties|null); + + /** Assessment reasons */ + reasons?: (google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason[]|null); + } + + /** Represents an Assessment. */ + class Assessment implements IAssessment { + + /** + * Constructs a new Assessment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IAssessment); + + /** Assessment name. */ + public name: string; + + /** Assessment event. */ + public event?: (google.cloud.recaptchaenterprise.v1beta1.IEvent|null); + + /** Assessment score. */ + public score: number; + + /** Assessment tokenProperties. */ + public tokenProperties?: (google.cloud.recaptchaenterprise.v1beta1.ITokenProperties|null); + + /** Assessment reasons. */ + public reasons: google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason[]; + + /** + * Creates a new Assessment instance using the specified properties. + * @param [properties] Properties to set + * @returns Assessment instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IAssessment): google.cloud.recaptchaenterprise.v1beta1.Assessment; + + /** + * Encodes the specified Assessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Assessment.verify|verify} messages. + * @param message Assessment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Assessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Assessment.verify|verify} messages. + * @param message Assessment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Assessment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Assessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.Assessment; + + /** + * Decodes an Assessment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Assessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.Assessment; + + /** + * Verifies an Assessment message. + * @param message Plain 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 Assessment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Assessment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.Assessment; + + /** + * Creates a plain object from an Assessment message. Also converts values to other types if specified. + * @param message Assessment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.Assessment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Assessment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Assessment { + + /** ClassificationReason enum. */ + enum ClassificationReason { + CLASSIFICATION_REASON_UNSPECIFIED = 0, + AUTOMATION = 1, + UNEXPECTED_ENVIRONMENT = 2, + TOO_MUCH_TRAFFIC = 3, + UNEXPECTED_USAGE_PATTERNS = 4, + LOW_CONFIDENCE_SCORE = 5 + } + } + + /** Properties of an Event. */ + interface IEvent { + + /** Event token */ + token?: (string|null); + + /** Event siteKey */ + siteKey?: (string|null); + } + + /** Represents an Event. */ + class Event implements IEvent { + + /** + * Constructs a new Event. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IEvent); + + /** Event token. */ + public token: string; + + /** Event siteKey. */ + public siteKey: string; + + /** + * Creates a new Event instance using the specified properties. + * @param [properties] Properties to set + * @returns Event instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IEvent): google.cloud.recaptchaenterprise.v1beta1.Event; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Event message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.Event; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.Event; + + /** + * Verifies an Event message. + * @param message Plain 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 Event message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Event + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.Event; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @param message Event + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.Event, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Event to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TokenProperties. */ + interface ITokenProperties { + + /** TokenProperties valid */ + valid?: (boolean|null); + + /** TokenProperties invalidReason */ + invalidReason?: (google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason|null); + + /** TokenProperties createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** TokenProperties hostname */ + hostname?: (string|null); + + /** TokenProperties action */ + action?: (string|null); + } + + /** Represents a TokenProperties. */ + class TokenProperties implements ITokenProperties { + + /** + * Constructs a new TokenProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.ITokenProperties); + + /** TokenProperties valid. */ + public valid: boolean; + + /** TokenProperties invalidReason. */ + public invalidReason: google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason; + + /** TokenProperties createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** TokenProperties hostname. */ + public hostname: string; + + /** TokenProperties action. */ + public action: string; + + /** + * Creates a new TokenProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenProperties instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.ITokenProperties): google.cloud.recaptchaenterprise.v1beta1.TokenProperties; + + /** + * Encodes the specified TokenProperties message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TokenProperties.verify|verify} messages. + * @param message TokenProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.ITokenProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TokenProperties message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TokenProperties.verify|verify} messages. + * @param message TokenProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.ITokenProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TokenProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.TokenProperties; + + /** + * Decodes a TokenProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TokenProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.TokenProperties; + + /** + * Verifies a TokenProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TokenProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TokenProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.TokenProperties; + + /** + * Creates a plain object from a TokenProperties message. Also converts values to other types if specified. + * @param message TokenProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.TokenProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TokenProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TokenProperties { + + /** InvalidReason enum. */ + enum InvalidReason { + INVALID_REASON_UNSPECIFIED = 0, + UNKNOWN_INVALID_REASON = 1, + MALFORMED = 2, + EXPIRED = 3, + DUPE = 4, + SITE_MISMATCH = 5, + MISSING = 6 + } + } + } + } + } + + /** 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|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; + + /** + * 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|null); + + /** FieldDescriptorProto type */ + type?: (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; + + /** FieldDescriptorProto type. */ + public type: 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|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); + } + + /** 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; + + /** 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|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (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; + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: 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|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); + } + + /** 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; + + /** 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|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|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); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: Uint8Array; + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|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); + + /** 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 }; + } + } +} diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js new file mode 100644 index 00000000000..e395c3620f0 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -0,0 +1,12007 @@ +/*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["default"] || ($protobuf.roots["default"] = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.recaptchaenterprise = (function() { + + /** + * Namespace recaptchaenterprise. + * @memberof google.cloud + * @namespace + */ + var recaptchaenterprise = {}; + + recaptchaenterprise.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.recaptchaenterprise + * @namespace + */ + var v1beta1 = {}; + + v1beta1.RecaptchaEnterpriseServiceV1Beta1 = (function() { + + /** + * Constructs a new RecaptchaEnterpriseServiceV1Beta1 service. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents a RecaptchaEnterpriseServiceV1Beta1 + * @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 RecaptchaEnterpriseServiceV1Beta1(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RecaptchaEnterpriseServiceV1Beta1.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RecaptchaEnterpriseServiceV1Beta1; + + /** + * Creates new RecaptchaEnterpriseServiceV1Beta1 service using the specified rpc implementation. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @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 {RecaptchaEnterpriseServiceV1Beta1} RPC service. Useful where requests and/or responses are streamed. + */ + RecaptchaEnterpriseServiceV1Beta1.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#createAssessment}. + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @typedef CreateAssessmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1beta1.Assessment} [response] Assessment + */ + + /** + * Calls CreateAssessment. + * @function createAssessment + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @instance + * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest} request CreateAssessmentRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateAssessmentCallback} callback Node-style callback called with the error, if any, and Assessment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseServiceV1Beta1.prototype.createAssessment = function createAssessment(request, callback) { + return this.rpcCall(createAssessment, $root.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest, $root.google.cloud.recaptchaenterprise.v1beta1.Assessment, request, callback); + }, "name", { value: "CreateAssessment" }); + + /** + * Calls CreateAssessment. + * @function createAssessment + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @instance + * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest} request CreateAssessmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#annotateAssessment}. + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @typedef AnnotateAssessmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse} [response] AnnotateAssessmentResponse + */ + + /** + * Calls AnnotateAssessment. + * @function annotateAssessment + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @instance + * @param {google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest} request AnnotateAssessmentRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.AnnotateAssessmentCallback} callback Node-style callback called with the error, if any, and AnnotateAssessmentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseServiceV1Beta1.prototype.annotateAssessment = function annotateAssessment(request, callback) { + return this.rpcCall(annotateAssessment, $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest, $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse, request, callback); + }, "name", { value: "AnnotateAssessment" }); + + /** + * Calls AnnotateAssessment. + * @function annotateAssessment + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @instance + * @param {google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest} request AnnotateAssessmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RecaptchaEnterpriseServiceV1Beta1; + })(); + + v1beta1.CreateAssessmentRequest = (function() { + + /** + * Properties of a CreateAssessmentRequest. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface ICreateAssessmentRequest + * @property {string|null} [parent] CreateAssessmentRequest parent + * @property {google.cloud.recaptchaenterprise.v1beta1.IAssessment|null} [assessment] CreateAssessmentRequest assessment + */ + + /** + * Constructs a new CreateAssessmentRequest. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents a CreateAssessmentRequest. + * @implements ICreateAssessmentRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest=} [properties] Properties to set + */ + function CreateAssessmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAssessmentRequest parent. + * @member {string} parent + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest + * @instance + */ + CreateAssessmentRequest.prototype.parent = ""; + + /** + * CreateAssessmentRequest assessment. + * @member {google.cloud.recaptchaenterprise.v1beta1.IAssessment|null|undefined} assessment + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest + * @instance + */ + CreateAssessmentRequest.prototype.assessment = null; + + /** + * Creates a new CreateAssessmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest} CreateAssessmentRequest instance + */ + CreateAssessmentRequest.create = function create(properties) { + return new CreateAssessmentRequest(properties); + }; + + /** + * Encodes the specified CreateAssessmentRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest} message CreateAssessmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAssessmentRequest.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.assessment != null && message.hasOwnProperty("assessment")) + $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.encode(message.assessment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAssessmentRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest} message CreateAssessmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAssessmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAssessmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest} CreateAssessmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAssessmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.assessment = $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAssessmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest} CreateAssessmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAssessmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAssessmentRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAssessmentRequest.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.assessment != null && message.hasOwnProperty("assessment")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.verify(message.assessment); + if (error) + return "assessment." + error; + } + return null; + }; + + /** + * Creates a CreateAssessmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest} CreateAssessmentRequest + */ + CreateAssessmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.assessment != null) { + if (typeof object.assessment !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest.assessment: object expected"); + message.assessment = $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.fromObject(object.assessment); + } + return message; + }; + + /** + * Creates a plain object from a CreateAssessmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest} message CreateAssessmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAssessmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.assessment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.assessment != null && message.hasOwnProperty("assessment")) + object.assessment = $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.toObject(message.assessment, options); + return object; + }; + + /** + * Converts this CreateAssessmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAssessmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateAssessmentRequest; + })(); + + v1beta1.AnnotateAssessmentRequest = (function() { + + /** + * Properties of an AnnotateAssessmentRequest. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface IAnnotateAssessmentRequest + * @property {string|null} [name] AnnotateAssessmentRequest name + * @property {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation|null} [annotation] AnnotateAssessmentRequest annotation + */ + + /** + * Constructs a new AnnotateAssessmentRequest. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents an AnnotateAssessmentRequest. + * @implements IAnnotateAssessmentRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest=} [properties] Properties to set + */ + function AnnotateAssessmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateAssessmentRequest name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + * @instance + */ + AnnotateAssessmentRequest.prototype.name = ""; + + /** + * AnnotateAssessmentRequest annotation. + * @member {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation} annotation + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + * @instance + */ + AnnotateAssessmentRequest.prototype.annotation = 0; + + /** + * Creates a new AnnotateAssessmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest} AnnotateAssessmentRequest instance + */ + AnnotateAssessmentRequest.create = function create(properties) { + return new AnnotateAssessmentRequest(properties); + }; + + /** + * Encodes the specified AnnotateAssessmentRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest} message AnnotateAssessmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateAssessmentRequest.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.annotation != null && message.hasOwnProperty("annotation")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.annotation); + return writer; + }; + + /** + * Encodes the specified AnnotateAssessmentRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest} message AnnotateAssessmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateAssessmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateAssessmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest} AnnotateAssessmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateAssessmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.annotation = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateAssessmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest} AnnotateAssessmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateAssessmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateAssessmentRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateAssessmentRequest.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.annotation != null && message.hasOwnProperty("annotation")) + switch (message.annotation) { + default: + return "annotation: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AnnotateAssessmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest} AnnotateAssessmentRequest + */ + AnnotateAssessmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.annotation) { + case "ANNOTATION_UNSPECIFIED": + case 0: + message.annotation = 0; + break; + case "LEGITIMATE": + case 1: + message.annotation = 1; + break; + case "FRAUDULENT": + case 2: + message.annotation = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnnotateAssessmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest} message AnnotateAssessmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateAssessmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.annotation = options.enums === String ? "ANNOTATION_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.annotation != null && message.hasOwnProperty("annotation")) + object.annotation = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation[message.annotation] : message.annotation; + return object; + }; + + /** + * Converts this AnnotateAssessmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + * @instance + * @returns {Object.} JSON object + */ + AnnotateAssessmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Annotation enum. + * @name google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation + * @enum {string} + * @property {number} ANNOTATION_UNSPECIFIED=0 ANNOTATION_UNSPECIFIED value + * @property {number} LEGITIMATE=1 LEGITIMATE value + * @property {number} FRAUDULENT=2 FRAUDULENT value + */ + AnnotateAssessmentRequest.Annotation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANNOTATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "LEGITIMATE"] = 1; + values[valuesById[2] = "FRAUDULENT"] = 2; + return values; + })(); + + return AnnotateAssessmentRequest; + })(); + + v1beta1.AnnotateAssessmentResponse = (function() { + + /** + * Properties of an AnnotateAssessmentResponse. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface IAnnotateAssessmentResponse + */ + + /** + * Constructs a new AnnotateAssessmentResponse. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents an AnnotateAssessmentResponse. + * @implements IAnnotateAssessmentResponse + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse=} [properties] Properties to set + */ + function AnnotateAssessmentResponse(properties) { + if (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 AnnotateAssessmentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse} AnnotateAssessmentResponse instance + */ + AnnotateAssessmentResponse.create = function create(properties) { + return new AnnotateAssessmentResponse(properties); + }; + + /** + * Encodes the specified AnnotateAssessmentResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse} message AnnotateAssessmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateAssessmentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AnnotateAssessmentResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse} message AnnotateAssessmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateAssessmentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateAssessmentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse} AnnotateAssessmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateAssessmentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateAssessmentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse} AnnotateAssessmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateAssessmentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateAssessmentResponse message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateAssessmentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AnnotateAssessmentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse} AnnotateAssessmentResponse + */ + AnnotateAssessmentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse) + return object; + return new $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse(); + }; + + /** + * Creates a plain object from an AnnotateAssessmentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse} message AnnotateAssessmentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateAssessmentResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AnnotateAssessmentResponse to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateAssessmentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateAssessmentResponse; + })(); + + v1beta1.Assessment = (function() { + + /** + * Properties of an Assessment. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface IAssessment + * @property {string|null} [name] Assessment name + * @property {google.cloud.recaptchaenterprise.v1beta1.IEvent|null} [event] Assessment event + * @property {number|null} [score] Assessment score + * @property {google.cloud.recaptchaenterprise.v1beta1.ITokenProperties|null} [tokenProperties] Assessment tokenProperties + * @property {Array.|null} [reasons] Assessment reasons + */ + + /** + * Constructs a new Assessment. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents an Assessment. + * @implements IAssessment + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.IAssessment=} [properties] Properties to set + */ + function Assessment(properties) { + this.reasons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Assessment name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @instance + */ + Assessment.prototype.name = ""; + + /** + * Assessment event. + * @member {google.cloud.recaptchaenterprise.v1beta1.IEvent|null|undefined} event + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @instance + */ + Assessment.prototype.event = null; + + /** + * Assessment score. + * @member {number} score + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @instance + */ + Assessment.prototype.score = 0; + + /** + * Assessment tokenProperties. + * @member {google.cloud.recaptchaenterprise.v1beta1.ITokenProperties|null|undefined} tokenProperties + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @instance + */ + Assessment.prototype.tokenProperties = null; + + /** + * Assessment reasons. + * @member {Array.} reasons + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @instance + */ + Assessment.prototype.reasons = $util.emptyArray; + + /** + * Creates a new Assessment instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IAssessment=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.Assessment} Assessment instance + */ + Assessment.create = function create(properties) { + return new Assessment(properties); + }; + + /** + * Encodes the specified Assessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Assessment.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IAssessment} message Assessment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Assessment.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.event != null && message.hasOwnProperty("event")) + $root.google.cloud.recaptchaenterprise.v1beta1.Event.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.score); + if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) + $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.encode(message.tokenProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reasons != null && message.reasons.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.reasons.length; ++i) + writer.int32(message.reasons[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Assessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Assessment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IAssessment} message Assessment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Assessment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Assessment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.Assessment} Assessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Assessment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.Assessment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.event = $root.google.cloud.recaptchaenterprise.v1beta1.Event.decode(reader, reader.uint32()); + break; + case 3: + message.score = reader.float(); + break; + case 4: + message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.decode(reader, reader.uint32()); + break; + case 5: + if (!(message.reasons && message.reasons.length)) + message.reasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.reasons.push(reader.int32()); + } else + message.reasons.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Assessment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.Assessment} Assessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Assessment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Assessment message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Assessment.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.event != null && message.hasOwnProperty("event")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.Event.verify(message.event); + if (error) + return "event." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.verify(message.tokenProperties); + if (error) + return "tokenProperties." + error; + } + if (message.reasons != null && message.hasOwnProperty("reasons")) { + if (!Array.isArray(message.reasons)) + return "reasons: array expected"; + for (var i = 0; i < message.reasons.length; ++i) + switch (message.reasons[i]) { + default: + return "reasons: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + } + return null; + }; + + /** + * Creates an Assessment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.Assessment} Assessment + */ + Assessment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.Assessment) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.Assessment(); + if (object.name != null) + message.name = String(object.name); + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Assessment.event: object expected"); + message.event = $root.google.cloud.recaptchaenterprise.v1beta1.Event.fromObject(object.event); + } + if (object.score != null) + message.score = Number(object.score); + if (object.tokenProperties != null) { + if (typeof object.tokenProperties !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Assessment.tokenProperties: object expected"); + message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.fromObject(object.tokenProperties); + } + if (object.reasons) { + if (!Array.isArray(object.reasons)) + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Assessment.reasons: array expected"); + message.reasons = []; + for (var i = 0; i < object.reasons.length; ++i) + switch (object.reasons[i]) { + default: + case "CLASSIFICATION_REASON_UNSPECIFIED": + case 0: + message.reasons[i] = 0; + break; + case "AUTOMATION": + case 1: + message.reasons[i] = 1; + break; + case "UNEXPECTED_ENVIRONMENT": + case 2: + message.reasons[i] = 2; + break; + case "TOO_MUCH_TRAFFIC": + case 3: + message.reasons[i] = 3; + break; + case "UNEXPECTED_USAGE_PATTERNS": + case 4: + message.reasons[i] = 4; + break; + case "LOW_CONFIDENCE_SCORE": + case 5: + message.reasons[i] = 5; + break; + } + } + return message; + }; + + /** + * Creates a plain object from an Assessment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.Assessment} message Assessment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Assessment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.reasons = []; + if (options.defaults) { + object.name = ""; + object.event = null; + object.score = 0; + object.tokenProperties = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.event != null && message.hasOwnProperty("event")) + object.event = $root.google.cloud.recaptchaenterprise.v1beta1.Event.toObject(message.event, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) + object.tokenProperties = $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.toObject(message.tokenProperties, options); + if (message.reasons && message.reasons.length) { + object.reasons = []; + for (var j = 0; j < message.reasons.length; ++j) + object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason[message.reasons[j]] : message.reasons[j]; + } + return object; + }; + + /** + * Converts this Assessment to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @instance + * @returns {Object.} JSON object + */ + Assessment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ClassificationReason enum. + * @name google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason + * @enum {string} + * @property {number} CLASSIFICATION_REASON_UNSPECIFIED=0 CLASSIFICATION_REASON_UNSPECIFIED value + * @property {number} AUTOMATION=1 AUTOMATION value + * @property {number} UNEXPECTED_ENVIRONMENT=2 UNEXPECTED_ENVIRONMENT value + * @property {number} TOO_MUCH_TRAFFIC=3 TOO_MUCH_TRAFFIC value + * @property {number} UNEXPECTED_USAGE_PATTERNS=4 UNEXPECTED_USAGE_PATTERNS value + * @property {number} LOW_CONFIDENCE_SCORE=5 LOW_CONFIDENCE_SCORE value + */ + Assessment.ClassificationReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLASSIFICATION_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTOMATION"] = 1; + values[valuesById[2] = "UNEXPECTED_ENVIRONMENT"] = 2; + values[valuesById[3] = "TOO_MUCH_TRAFFIC"] = 3; + values[valuesById[4] = "UNEXPECTED_USAGE_PATTERNS"] = 4; + values[valuesById[5] = "LOW_CONFIDENCE_SCORE"] = 5; + return values; + })(); + + return Assessment; + })(); + + v1beta1.Event = (function() { + + /** + * Properties of an Event. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface IEvent + * @property {string|null} [token] Event token + * @property {string|null} [siteKey] Event siteKey + */ + + /** + * Constructs a new Event. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents an Event. + * @implements IEvent + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.IEvent=} [properties] Properties to set + */ + function Event(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Event token. + * @member {string} token + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @instance + */ + Event.prototype.token = ""; + + /** + * Event siteKey. + * @member {string} siteKey + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @instance + */ + Event.prototype.siteKey = ""; + + /** + * Creates a new Event instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IEvent=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.Event} Event instance + */ + Event.create = function create(properties) { + return new Event(properties); + }; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Event.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.token != null && message.hasOwnProperty("token")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); + if (message.siteKey != null && message.hasOwnProperty("siteKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.siteKey); + return writer; + }; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Event.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Event message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.Event(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.token = reader.string(); + break; + case 2: + message.siteKey = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Event message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Event.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + if (message.siteKey != null && message.hasOwnProperty("siteKey")) + if (!$util.isString(message.siteKey)) + return "siteKey: string expected"; + return null; + }; + + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.Event} Event + */ + Event.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.Event) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.Event(); + if (object.token != null) + message.token = String(object.token); + if (object.siteKey != null) + message.siteKey = String(object.siteKey); + return message; + }; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.Event} message Event + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Event.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.token = ""; + object.siteKey = ""; + } + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + if (message.siteKey != null && message.hasOwnProperty("siteKey")) + object.siteKey = message.siteKey; + return object; + }; + + /** + * Converts this Event to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @instance + * @returns {Object.} JSON object + */ + Event.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Event; + })(); + + v1beta1.TokenProperties = (function() { + + /** + * Properties of a TokenProperties. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface ITokenProperties + * @property {boolean|null} [valid] TokenProperties valid + * @property {google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason|null} [invalidReason] TokenProperties invalidReason + * @property {google.protobuf.ITimestamp|null} [createTime] TokenProperties createTime + * @property {string|null} [hostname] TokenProperties hostname + * @property {string|null} [action] TokenProperties action + */ + + /** + * Constructs a new TokenProperties. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents a TokenProperties. + * @implements ITokenProperties + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.ITokenProperties=} [properties] Properties to set + */ + function TokenProperties(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenProperties valid. + * @member {boolean} valid + * @memberof google.cloud.recaptchaenterprise.v1beta1.TokenProperties + * @instance + */ + TokenProperties.prototype.valid = false; + + /** + * TokenProperties invalidReason. + * @member {google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason} invalidReason + * @memberof google.cloud.recaptchaenterprise.v1beta1.TokenProperties + * @instance + */ + TokenProperties.prototype.invalidReason = 0; + + /** + * TokenProperties createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.recaptchaenterprise.v1beta1.TokenProperties + * @instance + */ + TokenProperties.prototype.createTime = null; + + /** + * TokenProperties hostname. + * @member {string} hostname + * @memberof google.cloud.recaptchaenterprise.v1beta1.TokenProperties + * @instance + */ + TokenProperties.prototype.hostname = ""; + + /** + * TokenProperties action. + * @member {string} action + * @memberof google.cloud.recaptchaenterprise.v1beta1.TokenProperties + * @instance + */ + TokenProperties.prototype.action = ""; + + /** + * Creates a new TokenProperties instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.TokenProperties + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.ITokenProperties=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.TokenProperties} TokenProperties instance + */ + TokenProperties.create = function create(properties) { + return new TokenProperties(properties); + }; + + /** + * Encodes the specified TokenProperties message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TokenProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TokenProperties + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.ITokenProperties} message TokenProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.valid != null && message.hasOwnProperty("valid")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid); + if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.invalidReason); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.hostname != null && message.hasOwnProperty("hostname")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.hostname); + if (message.action != null && message.hasOwnProperty("action")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.action); + return writer; + }; + + /** + * Encodes the specified TokenProperties message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TokenProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.TokenProperties + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.ITokenProperties} message TokenProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.TokenProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.TokenProperties} TokenProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valid = reader.bool(); + break; + case 2: + message.invalidReason = reader.int32(); + break; + case 3: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.hostname = reader.string(); + break; + case 5: + message.action = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.TokenProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.TokenProperties} TokenProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenProperties message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.TokenProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.valid != null && message.hasOwnProperty("valid")) + if (typeof message.valid !== "boolean") + return "valid: boolean expected"; + if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) + switch (message.invalidReason) { + default: + return "invalidReason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.hostname != null && message.hasOwnProperty("hostname")) + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + return null; + }; + + /** + * Creates a TokenProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.TokenProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.TokenProperties} TokenProperties + */ + TokenProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties(); + if (object.valid != null) + message.valid = Boolean(object.valid); + switch (object.invalidReason) { + case "INVALID_REASON_UNSPECIFIED": + case 0: + message.invalidReason = 0; + break; + case "UNKNOWN_INVALID_REASON": + case 1: + message.invalidReason = 1; + break; + case "MALFORMED": + case 2: + message.invalidReason = 2; + break; + case "EXPIRED": + case 3: + message.invalidReason = 3; + break; + case "DUPE": + case 4: + message.invalidReason = 4; + break; + case "SITE_MISMATCH": + case 5: + message.invalidReason = 5; + break; + case "MISSING": + case 6: + message.invalidReason = 6; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.TokenProperties.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.hostname != null) + message.hostname = String(object.hostname); + if (object.action != null) + message.action = String(object.action); + return message; + }; + + /** + * Creates a plain object from a TokenProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.TokenProperties + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.TokenProperties} message TokenProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.valid = false; + object.invalidReason = options.enums === String ? "INVALID_REASON_UNSPECIFIED" : 0; + object.createTime = null; + object.hostname = ""; + object.action = ""; + } + if (message.valid != null && message.hasOwnProperty("valid")) + object.valid = message.valid; + if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) + object.invalidReason = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason[message.invalidReason] : message.invalidReason; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.hostname != null && message.hasOwnProperty("hostname")) + object.hostname = message.hostname; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + return object; + }; + + /** + * Converts this TokenProperties to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.TokenProperties + * @instance + * @returns {Object.} JSON object + */ + TokenProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * InvalidReason enum. + * @name google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason + * @enum {string} + * @property {number} INVALID_REASON_UNSPECIFIED=0 INVALID_REASON_UNSPECIFIED value + * @property {number} UNKNOWN_INVALID_REASON=1 UNKNOWN_INVALID_REASON value + * @property {number} MALFORMED=2 MALFORMED value + * @property {number} EXPIRED=3 EXPIRED value + * @property {number} DUPE=4 DUPE value + * @property {number} SITE_MISMATCH=5 SITE_MISMATCH value + * @property {number} MISSING=6 MISSING value + */ + TokenProperties.InvalidReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INVALID_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNKNOWN_INVALID_REASON"] = 1; + values[valuesById[2] = "MALFORMED"] = 2; + values[valuesById[3] = "EXPIRED"] = 3; + values[valuesById[4] = "DUPE"] = 4; + values[valuesById[5] = "SITE_MISMATCH"] = 5; + values[valuesById[6] = "MISSING"] = 6; + return values; + })(); + + return TokenProperties; + })(); + + return v1beta1; + })(); + + return recaptchaenterprise; + })(); + + 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 + */ + + /** + * 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; + + /** + * 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); + 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; + 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; + } + 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; + } + 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; + } + 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; + 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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(); + 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; + 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; + } + } + 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]); + } + } + 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 = []; + 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); + } + 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 + */ + + /** + * 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; + + /** + * 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.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; + 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"; + } + 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]); + } + 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.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.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.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; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index 3f449b77682..77fc186b238 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -18,13 +18,18 @@ }, "nested": { "RecaptchaEnterpriseServiceV1Beta1": { + "options": { + "(google.api.default_host)": "recaptchaenterprise.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, "methods": { "CreateAssessment": { "requestType": "CreateAssessmentRequest", "responseType": "Assessment", "options": { "(google.api.http).post": "/v1beta1/{parent=projects/*}/assessments", - "(google.api.http).body": "assessment" + "(google.api.http).body": "assessment", + "(google.api.method_signature)": "parent,assessment" } }, "AnnotateAssessment": { @@ -32,7 +37,8 @@ "responseType": "AnnotateAssessmentResponse", "options": { "(google.api.http).post": "/v1beta1/{name=projects/*/assessments/*}:annotate", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,annotation" } } } @@ -41,11 +47,18 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } }, "assessment": { "type": "Assessment", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -53,11 +66,18 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/Assessment" + } }, "annotation": { "type": "Annotation", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } }, "nested": { @@ -74,10 +94,17 @@ "fields": {} }, "Assessment": { + "options": { + "(google.api.resource).type": "recaptchaenterprise.googleapis.com/Assessment", + "(google.api.resource).pattern": "projects/{project}/assessments/{assessment}" + }, "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "event": { "type": "Event", @@ -85,16 +112,25 @@ }, "score": { "type": "float", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "tokenProperties": { "type": "TokenProperties", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "reasons": { "rule": "repeated", "type": "ClassificationReason", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -103,8 +139,9 @@ "CLASSIFICATION_REASON_UNSPECIFIED": 0, "AUTOMATION": 1, "UNEXPECTED_ENVIRONMENT": 2, + "TOO_MUCH_TRAFFIC": 3, "UNEXPECTED_USAGE_PATTERNS": 4, - "PROVISIONAL_RISK_ANALYSIS": 5 + "LOW_CONFIDENCE_SCORE": 5 } } } @@ -113,11 +150,17 @@ "fields": { "token": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "siteKey": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -168,7 +211,7 @@ "options": { "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "HttpProto", + "java_outer_classname": "ResourceProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true @@ -260,6 +303,90 @@ "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" + }, + "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 + } + }, + "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 + } + } } } }, diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/cloud/recaptchaenterprise/v1beta1/doc_recaptchaenterprise.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/cloud/recaptchaenterprise/v1beta1/doc_recaptchaenterprise.js index 178aab3b3da..3da58d9b748 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/cloud/recaptchaenterprise/v1beta1/doc_recaptchaenterprise.js +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/cloud/recaptchaenterprise/v1beta1/doc_recaptchaenterprise.js @@ -23,7 +23,7 @@ * in the format "projects/{project_number}". * * @property {Object} assessment - * The asessment details. + * Required. The assessment details. * * This object should have the same structure as [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment} * @@ -43,7 +43,7 @@ const CreateAssessmentRequest = { * "projects/{project_number}/assessments/{assessment_id}". * * @property {number} annotation - * The annotation that will be assigned to the Event. + * Required. The annotation that will be assigned to the Event. * * The number should be among the values of [Annotation]{@link google.cloud.recaptchaenterprise.v1beta1.Annotation} * @@ -138,18 +138,23 @@ const Assessment = { CLASSIFICATION_REASON_UNSPECIFIED: 0, /** - * The event appeared to be automated. + * Interactions matched the behavior of an automated agent. */ AUTOMATION: 1, /** - * The event was not made from the proper context on the real site. + * The event originated from an illegitimate environment. */ UNEXPECTED_ENVIRONMENT: 2, /** - * Browsing behavior leading up to the event was generated was out of the - * ordinary. + * Traffic volume from the event source is higher than normal. + */ + TOO_MUCH_TRAFFIC: 3, + + /** + * Interactions with the site were significantly different than expected + * patterns. */ UNEXPECTED_USAGE_PATTERNS: 4, @@ -157,17 +162,17 @@ const Assessment = { * Too little traffic has been received from this site thus far to generate * quality risk analysis. */ - PROVISIONAL_RISK_ANALYSIS: 5 + LOW_CONFIDENCE_SCORE: 5 } }; /** * @property {string} token - * The user response token provided by the reCAPTCHA client-side integration + * Required. The user response token provided by the reCAPTCHA client-side integration * on your site. * * @property {string} siteKey - * The site key that was used to invoke reCAPTCHA on your site and generate + * Required. The site key that was used to invoke reCAPTCHA on your site and generate * the token. * * @typedef Event @@ -180,23 +185,23 @@ const Event = { /** * @property {boolean} valid - * Output only. Whether the provided user response token is valid. + * Whether the provided user response token is valid. * * @property {number} invalidReason - * Output only. Reason associated with the response when valid = false. + * Reason associated with the response when valid = false. * * The number should be among the values of [InvalidReason]{@link google.cloud.recaptchaenterprise.v1beta1.InvalidReason} * * @property {Object} createTime - * Output only. The timestamp corresponding to the generation of the token. + * The timestamp corresponding to the generation of the token. * * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} * * @property {string} hostname - * Output only. The hostname of the page on which the token was generated. + * The hostname of the page on which the token was generated. * * @property {string} action - * Output only. Action name provided at token generation. + * Action name provided at token generation. * * @typedef TokenProperties * @memberof google.cloud.recaptchaenterprise.v1beta1 @@ -206,6 +211,7 @@ const TokenProperties = { // This is for documentation. Actual contents will be loaded by gRPC. /** + * LINT.IfChange * Enum that represents the types of invalid token reasons. * * @enum {number} @@ -239,7 +245,7 @@ const TokenProperties = { DUPE: 4, /** - * The user verification token did not match the provided site secret. + * The user verification token did not match the provided site key. * This may be a configuration error (e.g. development keys used in * production) or end users trying to use verification tokens from other * sites. diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js index e3ac9d680b7..09118ba9d8e 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js @@ -231,7 +231,7 @@ class RecaptchaEnterpriseServiceV1Beta1Client { * Required. The name of the project in which the assessment will be created, * in the format "projects/{project_number}". * @param {Object} request.assessment - * The asessment details. + * Required. The assessment details. * * This object should have the same structure as [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment} * @param {Object} [options] @@ -296,7 +296,7 @@ class RecaptchaEnterpriseServiceV1Beta1Client { * Required. The resource name of the Assessment, in the format * "projects/{project_number}/assessments/{assessment_id}". * @param {number} request.annotation - * The annotation that will be assigned to the Event. + * Required. The annotation that will be assigned to the Event. * * The number should be among the values of [Annotation]{@link google.cloud.recaptchaenterprise.v1beta1.Annotation} * @param {Object} [options] diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 72e7040bbef..88848324985 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,18 +1,19 @@ { - "updateTime": "2019-09-10T11:20:43.095715Z", + "updateTime": "2019-09-27T11:23:28.678418Z", "sources": [ { "generator": { "name": "artman", - "version": "0.36.2", - "dockerImage": "googleapis/artman@sha256:0e6f3a668cd68afc768ecbe08817cf6e56a0e64fcbdb1c58c3b97492d12418a1" + "version": "0.37.1", + "dockerImage": "googleapis/artman@sha256:6068f67900a3f0bdece596b97bda8fc70406ca0e137a941f4c81d3217c994a80" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "26e189ad03ba63591fb26eecb6aaade7ad39f57a" + "sha": "cd112d8d255e0099df053643d4bd12c228ef7b1b", + "internalRef": "271468707" } }, { From 6e31ca3e99631f31e026b6f0d69c364094b751c4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2019 12:01:39 -0700 Subject: [PATCH 047/253] chore: release 1.3.0 (#66) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- .../google-cloud-recaptchaenterprise/CHANGELOG.md | 12 ++++++++++++ .../google-cloud-recaptchaenterprise/package.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index ff5e35d2b08..de79444a3ef 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [1.3.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.2.0...v1.3.0) (2019-10-12) + + +### Features + +* update scopes and classifications ([#60](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/60)) ([b216630](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/b216630a5abd910e908d0b81d0dfe24a4ddd66b5)) + + +### Bug Fixes + +* use compatible version of google-gax ([dfb174a](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/dfb174aa8848f66e83d4f9f125ce3b7aaac282e2)) + ## [1.2.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.1.4...v1.2.0) (2019-09-16) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 663b63e5a9f..3a6abf10692 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.2.0", + "version": "1.3.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "src/index.js", From 6303c1569a0c37e17da990dd5e94ed1ac5f3349d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 14 Oct 2019 10:07:51 -0700 Subject: [PATCH 048/253] docs: fix pull request template to link to correct issue list (#67) --- .../google-cloud-recaptchaenterprise/synth.metadata | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 88848324985..886d11c54a2 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-09-27T11:23:28.678418Z", + "updateTime": "2019-10-13T11:25:26.587650Z", "sources": [ { "generator": { "name": "artman", - "version": "0.37.1", - "dockerImage": "googleapis/artman@sha256:6068f67900a3f0bdece596b97bda8fc70406ca0e137a941f4c81d3217c994a80" + "version": "0.39.0", + "dockerImage": "googleapis/artman@sha256:72554d0b3bdc0b4ac7d6726a6a606c00c14b454339037ed86be94574fb05d9f3" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "cd112d8d255e0099df053643d4bd12c228ef7b1b", - "internalRef": "271468707" + "sha": "af8dd2c1750558b538eaa6bdaa3bc899079533ee", + "internalRef": "274260771" } }, { From 4fd737e852237c9c79fd1209336336ab51f405f5 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 21 Oct 2019 18:45:28 -0700 Subject: [PATCH 049/253] fix(deps): bump google-gax to 1.7.5 (#68) --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 3a6abf10692..1ff0a4c1e36 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -25,7 +25,7 @@ "reCAPTCHA Enterprise API" ], "dependencies": { - "google-gax": "^1.6.3" + "google-gax": "^1.7.5" }, "devDependencies": { "eslint": "^6.0.0", From 8656321980b5db8c1f616b7f9d9b85e397a075a2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2019 13:24:00 -0700 Subject: [PATCH 050/253] chore: release 1.3.1 (#69) --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index de79444a3ef..f4d0f02bd2a 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [1.3.1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.3.0...v1.3.1) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#68](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/68)) ([0605bb8](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/0605bb8ce6a246fb31f4d54f4fbc126f1924f331)) + ## [1.3.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.2.0...v1.3.0) (2019-10-12) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 1ff0a4c1e36..f47af398b7d 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.3.0", + "version": "1.3.1", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index f1a613e998c..bf6c157af97 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.2.0" + "@google-cloud/recaptcha-enterprise": "^1.3.1" }, "devDependencies": { "chai": "^4.2.0", From 1486d7d16ddc1ff5e9a5f898083ce81b57763307 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 1 Nov 2019 12:42:28 -0700 Subject: [PATCH 051/253] test: don't exclude src/ in coverage --- packages/google-cloud-recaptchaenterprise/.nycrc | 1 - .../google-cloud-recaptchaenterprise/synth.metadata | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.nycrc b/packages/google-cloud-recaptchaenterprise/.nycrc index 23e322204ec..367688844eb 100644 --- a/packages/google-cloud-recaptchaenterprise/.nycrc +++ b/packages/google-cloud-recaptchaenterprise/.nycrc @@ -10,7 +10,6 @@ "**/docs", "**/samples", "**/scripts", - "**/src/**/v*/**/*.js", "**/protos", "**/test", ".jsdoc.js", diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 886d11c54a2..9a3492277b6 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-10-13T11:25:26.587650Z", + "updateTime": "2019-11-01T19:17:46.664096Z", "sources": [ { "generator": { "name": "artman", - "version": "0.39.0", - "dockerImage": "googleapis/artman@sha256:72554d0b3bdc0b4ac7d6726a6a606c00c14b454339037ed86be94574fb05d9f3" + "version": "0.41.0", + "dockerImage": "googleapis/artman@sha256:75b38a3b073a7b243545f2332463096624c802bb1e56b8cb6f22ba1ecd325fa9" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "af8dd2c1750558b538eaa6bdaa3bc899079533ee", - "internalRef": "274260771" + "sha": "bba93d7148ff203d400a4929cd0fbc7dafd8dae2", + "internalRef": "277920288" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.5.2" + "version": "2019.10.17" } } ], From 7240c5713b8d78df80b3014da0a746ee83234cff Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 13 Nov 2019 12:45:53 -0800 Subject: [PATCH 052/253] fix(docs): snippets are now replaced in jsdoc comments (#74) --- packages/google-cloud-recaptchaenterprise/.jsdoc.js | 3 ++- packages/google-cloud-recaptchaenterprise/package.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/.jsdoc.js b/packages/google-cloud-recaptchaenterprise/.jsdoc.js index 52f4bb3395f..51be5a4f396 100644 --- a/packages/google-cloud-recaptchaenterprise/.jsdoc.js +++ b/packages/google-cloud-recaptchaenterprise/.jsdoc.js @@ -26,7 +26,8 @@ module.exports = { destination: './docs/' }, plugins: [ - 'plugins/markdown' + 'plugins/markdown', + 'jsdoc-region-tag' ], source: { excludePattern: '(^|\\/|\\\\)[._]', diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index f47af398b7d..042382f8c0d 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -34,6 +34,7 @@ "eslint-plugin-prettier": "^3.0.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", + "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^6.0.0", "nyc": "^14.1.1", From 6ac060df48b6e4739e3b8d702c1198610ecdd44a Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 14 Nov 2019 16:01:32 -0800 Subject: [PATCH 053/253] fix(docs): bump the release level to beta (#76) --- .../.repo-metadata.json | 4 ++-- packages/google-cloud-recaptchaenterprise/README.md | 9 +++++---- .../google-cloud-recaptchaenterprise/synth.metadata | 10 +++++----- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.repo-metadata.json b/packages/google-cloud-recaptchaenterprise/.repo-metadata.json index 6f32e715008..30ed2bd2ad1 100644 --- a/packages/google-cloud-recaptchaenterprise/.repo-metadata.json +++ b/packages/google-cloud-recaptchaenterprise/.repo-metadata.json @@ -4,10 +4,10 @@ "product_documentation": "https://cloud.google.com/recaptcha-enterprise/docs/", "client_documentation": "https://googleapis.dev/nodejs/recaptcha-enterprise/latest", "issue_tracker": "", - "release_level": "alpha", + "release_level": "beta", "language": "nodejs", "repo": "googleapis/nodejs-recaptcha-enterprise", "distribution_name": "@google-cloud/recaptcha-enterprise", "api_id": "recaptchaenterprise.googleapis.com", "requires_billing": true -} \ No newline at end of file +} diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index 401ce585570..294e21ff80b 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -4,7 +4,7 @@ # [Google Cloud reCAPTCHA Enterprise: Node.js Client](https://github.com/googleapis/nodejs-recaptcha-enterprise) -[![release level](https://img.shields.io/badge/release%20level-alpha-orange.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![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/recaptcha-enterprise.svg)](https://www.npmjs.org/package/@google-cloud/recaptcha-enterprise) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-recaptcha-enterprise/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-recaptcha-enterprise) @@ -104,10 +104,11 @@ 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 **alpha**. This means it is still a -work-in-progress and under active development. Any release is subject to -backwards-incompatible changes at any time. diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 9a3492277b6..a92e5915ff9 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-11-01T19:17:46.664096Z", + "updateTime": "2019-11-14T03:52:09.794198Z", "sources": [ { "generator": { "name": "artman", - "version": "0.41.0", - "dockerImage": "googleapis/artman@sha256:75b38a3b073a7b243545f2332463096624c802bb1e56b8cb6f22ba1ecd325fa9" + "version": "0.41.1", + "dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "bba93d7148ff203d400a4929cd0fbc7dafd8dae2", - "internalRef": "277920288" + "sha": "218164b3deba1075979c9dca5f71461379e42dd1", + "internalRef": "280279014" } }, { From 7495d8cd51699ae91d4ac8a8112b794a0fd9c3df Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 22 Nov 2019 13:13:23 -0800 Subject: [PATCH 054/253] feat: add plural and singular resource descriptor (#78) --- .../protos/protos.d.ts | 30 +++++ .../protos/protos.js | 104 +++++++++++++++++- .../protos/protos.json | 14 +++ .../synth.metadata | 10 +- 4 files changed, 152 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index c96a45c8cc2..8f730e1c0d6 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -1,3 +1,18 @@ +// 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. + +import * as Long from "long"; import * as $protobuf from "protobufjs"; /** Namespace google. */ export namespace google { @@ -1083,6 +1098,12 @@ export namespace google { /** ResourceDescriptor history */ history?: (google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); } /** Represents a ResourceDescriptor. */ @@ -1106,6 +1127,12 @@ export namespace google { /** ResourceDescriptor history. */ public history: 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 @@ -2842,6 +2869,9 @@ export namespace google { /** FileOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); } /** Represents a FileOptions. */ diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index e395c3620f0..94e9f43862c 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -1,3 +1,17 @@ +// 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. + /*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 */ @@ -2647,6 +2661,8 @@ * @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 */ /** @@ -2697,6 +2713,22 @@ */ 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 @@ -2730,6 +2762,10 @@ 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; }; @@ -2778,6 +2814,12 @@ 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; @@ -2835,6 +2877,12 @@ 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; }; @@ -2875,6 +2923,10 @@ message.history = 2; break; } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); return message; }; @@ -2897,6 +2949,8 @@ 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; @@ -2909,6 +2963,10 @@ 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; }; @@ -7323,6 +7381,7 @@ * @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 */ /** @@ -7335,6 +7394,7 @@ */ 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) @@ -7509,6 +7569,14 @@ */ 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 @@ -7576,6 +7644,9 @@ 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; }; @@ -7675,6 +7746,11 @@ 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; @@ -7785,6 +7861,15 @@ 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; }; @@ -7862,6 +7947,16 @@ 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; }; @@ -7878,8 +7973,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } if (options.defaults) { object.javaPackage = ""; object.javaOuterClassname = ""; @@ -7947,6 +8044,11 @@ 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; }; diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index 77fc186b238..6bc37b91cca 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -341,6 +341,12 @@ "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, @@ -364,6 +370,14 @@ "history": { "type": "History", "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 } }, "nested": { diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index a92e5915ff9..fcf2e002051 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-11-14T03:52:09.794198Z", + "updateTime": "2019-11-19T12:24:42.593913Z", "sources": [ { "generator": { "name": "artman", - "version": "0.41.1", - "dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e" + "version": "0.42.1", + "dockerImage": "googleapis/artman@sha256:c773192618c608a7a0415dd95282f841f8e6bcdef7dd760a988c93b77a64bd57" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "218164b3deba1075979c9dca5f71461379e42dd1", - "internalRef": "280279014" + "sha": "d8dd7fe8d5304f7bd1c52207703d7f27d5328c5a", + "internalRef": "281088257" } }, { From be6c1d512147d8eb4284641e104e2ee52ac58ec9 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 25 Nov 2019 08:54:45 -0800 Subject: [PATCH 055/253] chore: update license headers --- .../samples/quickstart.js | 27 +++++++++---------- .../system-test/test.js | 27 +++++++++---------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/samples/quickstart.js b/packages/google-cloud-recaptchaenterprise/samples/quickstart.js index 80e8f6aa5d7..170c97784f6 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/quickstart.js +++ b/packages/google-cloud-recaptchaenterprise/samples/quickstart.js @@ -1,17 +1,16 @@ -/** - * Copyright 2019, Google, Inc. - * Licensed under the Apache License, Version 2.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. - */ +// 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. 'use strict'; diff --git a/packages/google-cloud-recaptchaenterprise/system-test/test.js b/packages/google-cloud-recaptchaenterprise/system-test/test.js index 4bd12fbbc9f..ddc5feb5953 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/test.js +++ b/packages/google-cloud-recaptchaenterprise/system-test/test.js @@ -1,17 +1,16 @@ -/** - * Copyright 2019, Google, Inc. - * Licensed under the Apache License, Version 2.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. - */ +// 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. 'use strict'; From 0f5638d8dbd55f4785b2811ca3cbfa88463c3a77 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 10 Dec 2019 10:48:55 -0800 Subject: [PATCH 056/253] feat: add crud support for keys (#84) --- .../v1beta1/recaptchaenterprise.proto | 240 +- .../protos/protos.d.ts | 1581 ++++++++- .../protos/protos.js | 2996 ++++++++++++++++- .../protos/protos.json | 275 +- .../v1beta1/doc_recaptchaenterprise.js | 294 +- .../v1beta1/doc/google/protobuf/doc_empty.js | 34 + .../doc/google/protobuf/doc_field_mask.js | 228 ++ ...tcha_enterprise_service_v1_beta1_client.js | 443 ++- ...rprise_service_v1_beta1_client_config.json | 25 + .../synth.metadata | 6 +- .../test/gapic-v1beta1.js | 318 ++ 11 files changed, 6274 insertions(+), 166 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_empty.js create mode 100644 packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_field_mask.js diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto index c2025d4500e..12e99b488f9 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto @@ -21,6 +21,8 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.RecaptchaEnterprise.V1Beta1"; @@ -54,6 +56,43 @@ service RecaptchaEnterpriseServiceV1Beta1 { }; option (google.api.method_signature) = "name,annotation"; } + + // Creates a new reCAPTCHA Enterprise key. + rpc CreateKey(CreateKeyRequest) returns (Key) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/keys" + body: "key" + }; + } + + // Returns the list of all keys that belong to a project. + rpc ListKeys(ListKeysRequest) returns (ListKeysResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/keys" + }; + } + + // Returns the specified key. + rpc GetKey(GetKeyRequest) returns (Key) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/keys/*}" + }; + } + + // Updates the specified key. + rpc UpdateKey(UpdateKeyRequest) returns (Key) { + option (google.api.http) = { + patch: "/v1beta1/{key.name=projects/*/keys/*}" + body: "key" + }; + } + + // Deletes the specified key. + rpc DeleteKey(DeleteKeyRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/keys/*}" + }; + } } // The create assessment request message. @@ -154,13 +193,25 @@ message Assessment { } message Event { - // Required. The user response token provided by the reCAPTCHA client-side integration + // Optional. The user response token provided by the reCAPTCHA client-side integration // on your site. - string token = 1 [(google.api.field_behavior) = REQUIRED]; + string token = 1 [(google.api.field_behavior) = OPTIONAL]; - // Required. The site key that was used to invoke reCAPTCHA on your site and generate + // Optional. The site key that was used to invoke reCAPTCHA on your site and generate // the token. - string site_key = 2 [(google.api.field_behavior) = REQUIRED]; + string site_key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The user agent present in the request from the user's device related to + // this event. + string user_agent = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The IP address in the request from the user's device related to this event. + string user_ip_address = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The expected action for this type of event. This should be the same action + // provided at token generation time on client-side platforms already + // integrated with recaptcha enterprise. + string expected_action = 5 [(google.api.field_behavior) = OPTIONAL]; } message TokenProperties { @@ -207,3 +258,184 @@ message TokenProperties { // Action name provided at token generation. string action = 5; } + +// The create key request message. +message CreateKeyRequest { + // Required. The name of the project in which the key will be created, in the + // format "projects/{project_number}". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. Information to create a reCAPTCHA Enterprise key. + Key key = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The list keys request message. +message ListKeysRequest { + // Required. The name of the project that contains the keys that will be + // listed, in the format "projects/{project_number}". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. The maximum number of keys to return. Default is 10. Max limit is + // 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous. + // ListKeysRequest, if any. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response to request to list keys in a project. +message ListKeysResponse { + // Key details. + repeated Key keys = 1; + + // Token to retrieve the next page of results. It is set to empty if no keys + // remain in results. + string next_page_token = 2; +} + +// The get key request message. +message GetKeyRequest { + // Required. The name of the requested key, in the format + // "projects/{project_number}/keys/{key_id}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/Key" + } + ]; +} + +// The update key request message. +message UpdateKeyRequest { + // Required. The key to update. + Key key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The mask to control which field of the key get updated. If the mask is not + // present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The delete key request message. +message DeleteKeyRequest { + // Required. The name of the key to be deleted, in the format + // "projects/{project_number}/keys/{key_id}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/Key" + } + ]; +} + +// A key used to identify and configure applications (web and/or mobile) that +// use reCAPTCHA Enterprise. +message Key { + option (google.api.resource) = { + type: "recaptchaenterprise.googleapis.com/Key" + pattern: "projects/{project}/keys/{key}" + }; + + // The resource name for the Key in the format + // "projects/{project_number}/keys/{key_id}". + string name = 1; + + // Human-readable display name of this key. Modifiable by user. + string display_name = 2; + + // Platform specific settings for this key. The key can only be used on one + // platform, the one it has settings for. + oneof platform_settings { + // Settings for keys that can be used by websites. + WebKeySettings web_settings = 3; + + // Settings for keys that can be used by Android apps. + AndroidKeySettings android_settings = 4; + + // Settings for keys that can be used by iOS apps. + IOSKeySettings ios_settings = 5; + } +} + +// Settings specific to keys that can be used by websites. +message WebKeySettings { + // Enum that represents the integration types for web keys. + enum IntegrationType { + // Default type that indicates this enum hasn't been specified. This is not + // a valid IntegrationType, one of the other types must be specified + // instead. + INTEGRATION_TYPE_UNSPECIFIED = 0; + + // Only used to produce scores. It doesn't display the "I'm not a robot" + // checkbox and never shows captcha challenges. + SCORE_ONLY = 1; + + // Displays the "I'm not a robot" checkbox and may show captcha challenges + // after it is checked. + CHECKBOX_CHALLENGE = 2; + + // Doesn't display the "I'm not a robot" checkbox, but may show captcha + // challenges after risk analysis. + INVISIBLE_CHALLENGE = 3; + } + + // Enum that represents the possible challenge frequency and difficulty + // configurations for a web key. + enum ChallengeSecurityPreference { + // Default type that indicates this enum hasn't been specified. + CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0; + + // Key tends to show fewer and easier challenges. + USABILITY = 1; + + // Key tends to show balanced (in amount and difficulty) challenges. + BALANCED = 2; + + // Key tends to show more and harder challenges. + SECURITY = 3; + } + + // Whether allowed_domains is enforced or not. + bool enforce_allowed_domains = 3; + + // Domains or subdomains of websites allowed to use the key. All subdomains + // of an allowed domain are automatically allowed. A valid domain requires a + // host and must not include any path, port, query or fragment. + // Examples: 'example.com' or 'subdomain.example.com' + repeated string allowed_domains = 1; + + // Whether this key can be used on AMP (Accelerated Mobile Pages) websites. + bool allow_amp_traffic = 2; + + // Required. Describes how this key is integrated with the website. + IntegrationType integration_type = 4 [(google.api.field_behavior) = REQUIRED]; + + // Settings for the frequency and difficulty at which this key triggers + // captcha challenges. This should only be specified for IntegrationTypes + // CHECKBOX_CHALLENGE and INVISIBLE_CHALLENGE. + ChallengeSecurityPreference challenge_security_preference = 5; +} + +// Settings specific to keys that can be used by Android apps. +message AndroidKeySettings { + // Android package names of apps allowed to use the key. + // Example: 'com.companyname.appname' + repeated string allowed_package_names = 1; +} + +// Settings specific to keys that can be used by iOS apps. +message IOSKeySettings { + // iOS bundle ids of apps allowed to use the key. + // Example: 'com.companyname.productname.appname' + repeated string allowed_bundle_ids = 1; +} diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 8f730e1c0d6..e8983bc226b 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -73,6 +73,76 @@ export namespace google { * @returns Promise */ public annotateAssessment(request: google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest): Promise; + + /** + * Calls CreateKey. + * @param request CreateKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Key + */ + public createKey(request: google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, callback: google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateKeyCallback): void; + + /** + * Calls CreateKey. + * @param request CreateKeyRequest message or plain object + * @returns Promise + */ + public createKey(request: google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest): Promise; + + /** + * Calls ListKeys. + * @param request ListKeysRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListKeysResponse + */ + public listKeys(request: google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, callback: google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.ListKeysCallback): void; + + /** + * Calls ListKeys. + * @param request ListKeysRequest message or plain object + * @returns Promise + */ + public listKeys(request: google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest): Promise; + + /** + * Calls GetKey. + * @param request GetKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Key + */ + public getKey(request: google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, callback: google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.GetKeyCallback): void; + + /** + * Calls GetKey. + * @param request GetKeyRequest message or plain object + * @returns Promise + */ + public getKey(request: google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest): Promise; + + /** + * Calls UpdateKey. + * @param request UpdateKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Key + */ + public updateKey(request: google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, callback: google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.UpdateKeyCallback): void; + + /** + * Calls UpdateKey. + * @param request UpdateKeyRequest message or plain object + * @returns Promise + */ + public updateKey(request: google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest): Promise; + + /** + * Calls DeleteKey. + * @param request DeleteKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteKey(request: google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, callback: google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.DeleteKeyCallback): void; + + /** + * Calls DeleteKey. + * @param request DeleteKeyRequest message or plain object + * @returns Promise + */ + public deleteKey(request: google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest): Promise; } namespace RecaptchaEnterpriseServiceV1Beta1 { @@ -90,6 +160,41 @@ export namespace google { * @param [response] AnnotateAssessmentResponse */ type AnnotateAssessmentCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#createKey}. + * @param error Error, if any + * @param [response] Key + */ + type CreateKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1beta1.Key) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#listKeys}. + * @param error Error, if any + * @param [response] ListKeysResponse + */ + type ListKeysCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#getKey}. + * @param error Error, if any + * @param [response] Key + */ + type GetKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1beta1.Key) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#updateKey}. + * @param error Error, if any + * @param [response] Key + */ + type UpdateKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1beta1.Key) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#deleteKey}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteKeyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } /** Properties of a CreateAssessmentRequest. */ @@ -422,312 +527,1330 @@ export namespace google { public reasons: google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason[]; /** - * Creates a new Assessment instance using the specified properties. + * Creates a new Assessment instance using the specified properties. + * @param [properties] Properties to set + * @returns Assessment instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IAssessment): google.cloud.recaptchaenterprise.v1beta1.Assessment; + + /** + * Encodes the specified Assessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Assessment.verify|verify} messages. + * @param message Assessment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Assessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Assessment.verify|verify} messages. + * @param message Assessment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Assessment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Assessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.Assessment; + + /** + * Decodes an Assessment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Assessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.Assessment; + + /** + * Verifies an Assessment message. + * @param message Plain 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 Assessment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Assessment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.Assessment; + + /** + * Creates a plain object from an Assessment message. Also converts values to other types if specified. + * @param message Assessment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.Assessment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Assessment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Assessment { + + /** ClassificationReason enum. */ + enum ClassificationReason { + CLASSIFICATION_REASON_UNSPECIFIED = 0, + AUTOMATION = 1, + UNEXPECTED_ENVIRONMENT = 2, + TOO_MUCH_TRAFFIC = 3, + UNEXPECTED_USAGE_PATTERNS = 4, + LOW_CONFIDENCE_SCORE = 5 + } + } + + /** Properties of an Event. */ + interface IEvent { + + /** Event token */ + token?: (string|null); + + /** Event siteKey */ + siteKey?: (string|null); + + /** Event userAgent */ + userAgent?: (string|null); + + /** Event userIpAddress */ + userIpAddress?: (string|null); + + /** Event expectedAction */ + expectedAction?: (string|null); + } + + /** Represents an Event. */ + class Event implements IEvent { + + /** + * Constructs a new Event. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IEvent); + + /** Event token. */ + public token: string; + + /** Event siteKey. */ + public siteKey: string; + + /** Event userAgent. */ + public userAgent: string; + + /** Event userIpAddress. */ + public userIpAddress: string; + + /** Event expectedAction. */ + public expectedAction: string; + + /** + * Creates a new Event instance using the specified properties. + * @param [properties] Properties to set + * @returns Event instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IEvent): google.cloud.recaptchaenterprise.v1beta1.Event; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Event message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.Event; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.Event; + + /** + * Verifies an Event message. + * @param message Plain 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 Event message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Event + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.Event; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @param message Event + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.Event, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Event to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TokenProperties. */ + interface ITokenProperties { + + /** TokenProperties valid */ + valid?: (boolean|null); + + /** TokenProperties invalidReason */ + invalidReason?: (google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason|null); + + /** TokenProperties createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** TokenProperties hostname */ + hostname?: (string|null); + + /** TokenProperties action */ + action?: (string|null); + } + + /** Represents a TokenProperties. */ + class TokenProperties implements ITokenProperties { + + /** + * Constructs a new TokenProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.ITokenProperties); + + /** TokenProperties valid. */ + public valid: boolean; + + /** TokenProperties invalidReason. */ + public invalidReason: google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason; + + /** TokenProperties createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** TokenProperties hostname. */ + public hostname: string; + + /** TokenProperties action. */ + public action: string; + + /** + * Creates a new TokenProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenProperties instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.ITokenProperties): google.cloud.recaptchaenterprise.v1beta1.TokenProperties; + + /** + * Encodes the specified TokenProperties message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TokenProperties.verify|verify} messages. + * @param message TokenProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.ITokenProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TokenProperties message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TokenProperties.verify|verify} messages. + * @param message TokenProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.ITokenProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TokenProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.TokenProperties; + + /** + * Decodes a TokenProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TokenProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.TokenProperties; + + /** + * Verifies a TokenProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TokenProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TokenProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.TokenProperties; + + /** + * Creates a plain object from a TokenProperties message. Also converts values to other types if specified. + * @param message TokenProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.TokenProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TokenProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TokenProperties { + + /** InvalidReason enum. */ + enum InvalidReason { + INVALID_REASON_UNSPECIFIED = 0, + UNKNOWN_INVALID_REASON = 1, + MALFORMED = 2, + EXPIRED = 3, + DUPE = 4, + SITE_MISMATCH = 5, + MISSING = 6 + } + } + + /** Properties of a CreateKeyRequest. */ + interface ICreateKeyRequest { + + /** CreateKeyRequest parent */ + parent?: (string|null); + + /** CreateKeyRequest key */ + key?: (google.cloud.recaptchaenterprise.v1beta1.IKey|null); + } + + /** Represents a CreateKeyRequest. */ + class CreateKeyRequest implements ICreateKeyRequest { + + /** + * Constructs a new CreateKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest); + + /** CreateKeyRequest parent. */ + public parent: string; + + /** CreateKeyRequest key. */ + public key?: (google.cloud.recaptchaenterprise.v1beta1.IKey|null); + + /** + * Creates a new CreateKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateKeyRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest): google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest; + + /** + * Encodes the specified CreateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest.verify|verify} messages. + * @param message CreateKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest.verify|verify} messages. + * @param message CreateKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest; + + /** + * Decodes a CreateKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest; + + /** + * Verifies a CreateKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest; + + /** + * Creates a plain object from a CreateKeyRequest message. Also converts values to other types if specified. + * @param message CreateKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListKeysRequest. */ + interface IListKeysRequest { + + /** ListKeysRequest parent */ + parent?: (string|null); + + /** ListKeysRequest pageSize */ + pageSize?: (number|null); + + /** ListKeysRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListKeysRequest. */ + class ListKeysRequest implements IListKeysRequest { + + /** + * Constructs a new ListKeysRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest); + + /** ListKeysRequest parent. */ + public parent: string; + + /** ListKeysRequest pageSize. */ + public pageSize: number; + + /** ListKeysRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListKeysRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListKeysRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest): google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest; + + /** + * Encodes the specified ListKeysRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest.verify|verify} messages. + * @param message ListKeysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListKeysRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest.verify|verify} messages. + * @param message ListKeysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListKeysRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest; + + /** + * Decodes a ListKeysRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest; + + /** + * Verifies a ListKeysRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListKeysRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListKeysRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest; + + /** + * Creates a plain object from a ListKeysRequest message. Also converts values to other types if specified. + * @param message ListKeysRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListKeysRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListKeysResponse. */ + interface IListKeysResponse { + + /** ListKeysResponse keys */ + keys?: (google.cloud.recaptchaenterprise.v1beta1.IKey[]|null); + + /** ListKeysResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListKeysResponse. */ + class ListKeysResponse implements IListKeysResponse { + + /** + * Constructs a new ListKeysResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse); + + /** ListKeysResponse keys. */ + public keys: google.cloud.recaptchaenterprise.v1beta1.IKey[]; + + /** ListKeysResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListKeysResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListKeysResponse instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse): google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse; + + /** + * Encodes the specified ListKeysResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse.verify|verify} messages. + * @param message ListKeysResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListKeysResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse.verify|verify} messages. + * @param message ListKeysResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListKeysResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse; + + /** + * Decodes a ListKeysResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse; + + /** + * Verifies a ListKeysResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListKeysResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListKeysResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse; + + /** + * Creates a plain object from a ListKeysResponse message. Also converts values to other types if specified. + * @param message ListKeysResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListKeysResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetKeyRequest. */ + interface IGetKeyRequest { + + /** GetKeyRequest name */ + name?: (string|null); + } + + /** Represents a GetKeyRequest. */ + class GetKeyRequest implements IGetKeyRequest { + + /** + * Constructs a new GetKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest); + + /** GetKeyRequest name. */ + public name: string; + + /** + * Creates a new GetKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetKeyRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest): google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest; + + /** + * Encodes the specified GetKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest.verify|verify} messages. + * @param message GetKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest.verify|verify} messages. + * @param message GetKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest; + + /** + * Decodes a GetKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest; + + /** + * Verifies a GetKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest; + + /** + * Creates a plain object from a GetKeyRequest message. Also converts values to other types if specified. + * @param message GetKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateKeyRequest. */ + interface IUpdateKeyRequest { + + /** UpdateKeyRequest key */ + key?: (google.cloud.recaptchaenterprise.v1beta1.IKey|null); + + /** UpdateKeyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateKeyRequest. */ + class UpdateKeyRequest implements IUpdateKeyRequest { + + /** + * Constructs a new UpdateKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest); + + /** UpdateKeyRequest key. */ + public key?: (google.cloud.recaptchaenterprise.v1beta1.IKey|null); + + /** UpdateKeyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateKeyRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest): google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest; + + /** + * Encodes the specified UpdateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest.verify|verify} messages. + * @param message UpdateKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest.verify|verify} messages. + * @param message UpdateKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest; + + /** + * Decodes an UpdateKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest; + + /** + * Verifies an UpdateKeyRequest message. + * @param message Plain 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 UpdateKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest; + + /** + * Creates a plain object from an UpdateKeyRequest message. Also converts values to other types if specified. + * @param message UpdateKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteKeyRequest. */ + interface IDeleteKeyRequest { + + /** DeleteKeyRequest name */ + name?: (string|null); + } + + /** Represents a DeleteKeyRequest. */ + class DeleteKeyRequest implements IDeleteKeyRequest { + + /** + * Constructs a new DeleteKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest); + + /** DeleteKeyRequest name. */ + public name: string; + + /** + * Creates a new DeleteKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteKeyRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest): google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest; + + /** + * Encodes the specified DeleteKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest.verify|verify} messages. + * @param message DeleteKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest.verify|verify} messages. + * @param message DeleteKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest; + + /** + * Decodes a DeleteKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest; + + /** + * Verifies a DeleteKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest; + + /** + * Creates a plain object from a DeleteKeyRequest message. Also converts values to other types if specified. + * @param message DeleteKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Key. */ + interface IKey { + + /** Key name */ + name?: (string|null); + + /** Key displayName */ + displayName?: (string|null); + + /** Key webSettings */ + webSettings?: (google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings|null); + + /** Key androidSettings */ + androidSettings?: (google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings|null); + + /** Key iosSettings */ + iosSettings?: (google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings|null); + } + + /** Represents a Key. */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IKey); + + /** Key name. */ + public name: string; + + /** Key displayName. */ + public displayName: string; + + /** Key webSettings. */ + public webSettings?: (google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings|null); + + /** Key androidSettings. */ + public androidSettings?: (google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings|null); + + /** Key iosSettings. */ + public iosSettings?: (google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings|null); + + /** Key platformSettings. */ + public platformSettings?: ("webSettings"|"androidSettings"|"iosSettings"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IKey): google.cloud.recaptchaenterprise.v1beta1.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Key.verify|verify} messages. + * @param message Key message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Key message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Key.verify|verify} messages. + * @param message Key message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.Key; + + /** + * Decodes a Key message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.Key; + + /** + * Verifies a Key message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Key message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Key + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.Key; + + /** + * Creates a plain object from a Key message. Also converts values to other types if specified. + * @param message Key + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.Key, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Key to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebKeySettings. */ + interface IWebKeySettings { + + /** WebKeySettings enforceAllowedDomains */ + enforceAllowedDomains?: (boolean|null); + + /** WebKeySettings allowedDomains */ + allowedDomains?: (string[]|null); + + /** WebKeySettings allowAmpTraffic */ + allowAmpTraffic?: (boolean|null); + + /** WebKeySettings integrationType */ + integrationType?: (google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType|null); + + /** WebKeySettings challengeSecurityPreference */ + challengeSecurityPreference?: (google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference|null); + } + + /** Represents a WebKeySettings. */ + class WebKeySettings implements IWebKeySettings { + + /** + * Constructs a new WebKeySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings); + + /** WebKeySettings enforceAllowedDomains. */ + public enforceAllowedDomains: boolean; + + /** WebKeySettings allowedDomains. */ + public allowedDomains: string[]; + + /** WebKeySettings allowAmpTraffic. */ + public allowAmpTraffic: boolean; + + /** WebKeySettings integrationType. */ + public integrationType: google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType; + + /** WebKeySettings challengeSecurityPreference. */ + public challengeSecurityPreference: google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference; + + /** + * Creates a new WebKeySettings instance using the specified properties. * @param [properties] Properties to set - * @returns Assessment instance + * @returns WebKeySettings instance */ - public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IAssessment): google.cloud.recaptchaenterprise.v1beta1.Assessment; + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings): google.cloud.recaptchaenterprise.v1beta1.WebKeySettings; /** - * Encodes the specified Assessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Assessment.verify|verify} messages. - * @param message Assessment message or plain object to encode + * Encodes the specified WebKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.verify|verify} messages. + * @param message WebKeySettings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Assessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Assessment.verify|verify} messages. - * @param message Assessment message or plain object to encode + * Encodes the specified WebKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.verify|verify} messages. + * @param message WebKeySettings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Assessment message from the specified reader or buffer. + * Decodes a WebKeySettings message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Assessment + * @returns WebKeySettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.Assessment; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.WebKeySettings; /** - * Decodes an Assessment message from the specified reader or buffer, length delimited. + * Decodes a WebKeySettings message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Assessment + * @returns WebKeySettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.Assessment; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.WebKeySettings; /** - * Verifies an Assessment message. + * Verifies a WebKeySettings message. * @param message Plain 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 Assessment message from a plain object. Also converts values to their respective internal types. + * Creates a WebKeySettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Assessment + * @returns WebKeySettings */ - public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.Assessment; + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.WebKeySettings; /** - * Creates a plain object from an Assessment message. Also converts values to other types if specified. - * @param message Assessment + * Creates a plain object from a WebKeySettings message. Also converts values to other types if specified. + * @param message WebKeySettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.Assessment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.WebKeySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Assessment to JSON. + * Converts this WebKeySettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Assessment { + namespace WebKeySettings { - /** ClassificationReason enum. */ - enum ClassificationReason { - CLASSIFICATION_REASON_UNSPECIFIED = 0, - AUTOMATION = 1, - UNEXPECTED_ENVIRONMENT = 2, - TOO_MUCH_TRAFFIC = 3, - UNEXPECTED_USAGE_PATTERNS = 4, - LOW_CONFIDENCE_SCORE = 5 + /** IntegrationType enum. */ + enum IntegrationType { + INTEGRATION_TYPE_UNSPECIFIED = 0, + SCORE_ONLY = 1, + CHECKBOX_CHALLENGE = 2, + INVISIBLE_CHALLENGE = 3 } - } - /** Properties of an Event. */ - interface IEvent { + /** ChallengeSecurityPreference enum. */ + enum ChallengeSecurityPreference { + CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0, + USABILITY = 1, + BALANCED = 2, + SECURITY = 3 + } + } - /** Event token */ - token?: (string|null); + /** Properties of an AndroidKeySettings. */ + interface IAndroidKeySettings { - /** Event siteKey */ - siteKey?: (string|null); + /** AndroidKeySettings allowedPackageNames */ + allowedPackageNames?: (string[]|null); } - /** Represents an Event. */ - class Event implements IEvent { + /** Represents an AndroidKeySettings. */ + class AndroidKeySettings implements IAndroidKeySettings { /** - * Constructs a new Event. + * Constructs a new AndroidKeySettings. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IEvent); - - /** Event token. */ - public token: string; + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings); - /** Event siteKey. */ - public siteKey: string; + /** AndroidKeySettings allowedPackageNames. */ + public allowedPackageNames: string[]; /** - * Creates a new Event instance using the specified properties. + * Creates a new AndroidKeySettings instance using the specified properties. * @param [properties] Properties to set - * @returns Event instance + * @returns AndroidKeySettings instance */ - public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IEvent): google.cloud.recaptchaenterprise.v1beta1.Event; + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings): google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings; /** - * Encodes the specified Event message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Event.verify|verify} messages. - * @param message Event message or plain object to encode + * Encodes the specified AndroidKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.verify|verify} messages. + * @param message AndroidKeySettings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Event.verify|verify} messages. - * @param message Event message or plain object to encode + * Encodes the specified AndroidKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.verify|verify} messages. + * @param message AndroidKeySettings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Event message from the specified reader or buffer. + * Decodes an AndroidKeySettings message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Event + * @returns AndroidKeySettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.Event; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings; /** - * Decodes an Event message from the specified reader or buffer, length delimited. + * Decodes an AndroidKeySettings message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Event + * @returns AndroidKeySettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.Event; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings; /** - * Verifies an Event message. + * Verifies an AndroidKeySettings message. * @param message Plain 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 Event message from a plain object. Also converts values to their respective internal types. + * Creates an AndroidKeySettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Event + * @returns AndroidKeySettings */ - public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.Event; + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings; /** - * Creates a plain object from an Event message. Also converts values to other types if specified. - * @param message Event + * Creates a plain object from an AndroidKeySettings message. Also converts values to other types if specified. + * @param message AndroidKeySettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.Event, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Event to JSON. + * Converts this AndroidKeySettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TokenProperties. */ - interface ITokenProperties { - - /** TokenProperties valid */ - valid?: (boolean|null); - - /** TokenProperties invalidReason */ - invalidReason?: (google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason|null); - - /** TokenProperties createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** TokenProperties hostname */ - hostname?: (string|null); + /** Properties of a IOSKeySettings. */ + interface IIOSKeySettings { - /** TokenProperties action */ - action?: (string|null); + /** IOSKeySettings allowedBundleIds */ + allowedBundleIds?: (string[]|null); } - /** Represents a TokenProperties. */ - class TokenProperties implements ITokenProperties { + /** Represents a IOSKeySettings. */ + class IOSKeySettings implements IIOSKeySettings { /** - * Constructs a new TokenProperties. + * Constructs a new IOSKeySettings. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.ITokenProperties); - - /** TokenProperties valid. */ - public valid: boolean; + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings); - /** TokenProperties invalidReason. */ - public invalidReason: google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason; - - /** TokenProperties createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** TokenProperties hostname. */ - public hostname: string; - - /** TokenProperties action. */ - public action: string; + /** IOSKeySettings allowedBundleIds. */ + public allowedBundleIds: string[]; /** - * Creates a new TokenProperties instance using the specified properties. + * Creates a new IOSKeySettings instance using the specified properties. * @param [properties] Properties to set - * @returns TokenProperties instance + * @returns IOSKeySettings instance */ - public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.ITokenProperties): google.cloud.recaptchaenterprise.v1beta1.TokenProperties; + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings): google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings; /** - * Encodes the specified TokenProperties message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TokenProperties.verify|verify} messages. - * @param message TokenProperties message or plain object to encode + * Encodes the specified IOSKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.verify|verify} messages. + * @param message IOSKeySettings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.recaptchaenterprise.v1beta1.ITokenProperties, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TokenProperties message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.TokenProperties.verify|verify} messages. - * @param message TokenProperties message or plain object to encode + * Encodes the specified IOSKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.verify|verify} messages. + * @param message IOSKeySettings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.ITokenProperties, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TokenProperties message from the specified reader or buffer. + * Decodes a IOSKeySettings message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TokenProperties + * @returns IOSKeySettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.TokenProperties; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings; /** - * Decodes a TokenProperties message from the specified reader or buffer, length delimited. + * Decodes a IOSKeySettings message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TokenProperties + * @returns IOSKeySettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.TokenProperties; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings; /** - * Verifies a TokenProperties message. + * Verifies a IOSKeySettings message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TokenProperties message from a plain object. Also converts values to their respective internal types. + * Creates a IOSKeySettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TokenProperties + * @returns IOSKeySettings */ - public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.TokenProperties; + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings; /** - * Creates a plain object from a TokenProperties message. Also converts values to other types if specified. - * @param message TokenProperties + * Creates a plain object from a IOSKeySettings message. Also converts values to other types if specified. + * @param message IOSKeySettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.TokenProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TokenProperties to JSON. + * Converts this IOSKeySettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - - namespace TokenProperties { - - /** InvalidReason enum. */ - enum InvalidReason { - INVALID_REASON_UNSPECIFIED = 0, - UNKNOWN_INVALID_REASON = 1, - MALFORMED = 2, - EXPIRED = 3, - DUPE = 4, - SITE_MISMATCH = 5, - MISSING = 6 - } - } } } } @@ -4434,6 +5557,180 @@ export namespace google { } } + /** 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 { diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 94e9f43862c..460d897245d 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -164,6 +164,171 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#createKey}. + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @typedef CreateKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1beta1.Key} [response] Key + */ + + /** + * Calls CreateKey. + * @function createKey + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @instance + * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest} request CreateKeyRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateKeyCallback} callback Node-style callback called with the error, if any, and Key + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseServiceV1Beta1.prototype.createKey = function createKey(request, callback) { + return this.rpcCall(createKey, $root.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest, $root.google.cloud.recaptchaenterprise.v1beta1.Key, request, callback); + }, "name", { value: "CreateKey" }); + + /** + * Calls CreateKey. + * @function createKey + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @instance + * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest} request CreateKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#listKeys}. + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @typedef ListKeysCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse} [response] ListKeysResponse + */ + + /** + * Calls ListKeys. + * @function listKeys + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @instance + * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest} request ListKeysRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.ListKeysCallback} callback Node-style callback called with the error, if any, and ListKeysResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseServiceV1Beta1.prototype.listKeys = function listKeys(request, callback) { + return this.rpcCall(listKeys, $root.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest, $root.google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse, request, callback); + }, "name", { value: "ListKeys" }); + + /** + * Calls ListKeys. + * @function listKeys + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @instance + * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest} request ListKeysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#getKey}. + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @typedef GetKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1beta1.Key} [response] Key + */ + + /** + * Calls GetKey. + * @function getKey + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @instance + * @param {google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest} request GetKeyRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.GetKeyCallback} callback Node-style callback called with the error, if any, and Key + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseServiceV1Beta1.prototype.getKey = function getKey(request, callback) { + return this.rpcCall(getKey, $root.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest, $root.google.cloud.recaptchaenterprise.v1beta1.Key, request, callback); + }, "name", { value: "GetKey" }); + + /** + * Calls GetKey. + * @function getKey + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @instance + * @param {google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest} request GetKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#updateKey}. + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @typedef UpdateKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1beta1.Key} [response] Key + */ + + /** + * Calls UpdateKey. + * @function updateKey + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @instance + * @param {google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest} request UpdateKeyRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.UpdateKeyCallback} callback Node-style callback called with the error, if any, and Key + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseServiceV1Beta1.prototype.updateKey = function updateKey(request, callback) { + return this.rpcCall(updateKey, $root.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest, $root.google.cloud.recaptchaenterprise.v1beta1.Key, request, callback); + }, "name", { value: "UpdateKey" }); + + /** + * Calls UpdateKey. + * @function updateKey + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @instance + * @param {google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest} request UpdateKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#deleteKey}. + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @typedef DeleteKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteKey. + * @function deleteKey + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @instance + * @param {google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest} request DeleteKeyRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.DeleteKeyCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseServiceV1Beta1.prototype.deleteKey = function deleteKey(request, callback) { + return this.rpcCall(deleteKey, $root.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteKey" }); + + /** + * Calls DeleteKey. + * @function deleteKey + * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 + * @instance + * @param {google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest} request DeleteKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return RecaptchaEnterpriseServiceV1Beta1; })(); @@ -1162,6 +1327,9 @@ * @interface IEvent * @property {string|null} [token] Event token * @property {string|null} [siteKey] Event siteKey + * @property {string|null} [userAgent] Event userAgent + * @property {string|null} [userIpAddress] Event userIpAddress + * @property {string|null} [expectedAction] Event expectedAction */ /** @@ -1195,6 +1363,30 @@ */ Event.prototype.siteKey = ""; + /** + * Event userAgent. + * @member {string} userAgent + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @instance + */ + Event.prototype.userAgent = ""; + + /** + * Event userIpAddress. + * @member {string} userIpAddress + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @instance + */ + Event.prototype.userIpAddress = ""; + + /** + * Event expectedAction. + * @member {string} expectedAction + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @instance + */ + Event.prototype.expectedAction = ""; + /** * Creates a new Event instance using the specified properties. * @function create @@ -1223,6 +1415,12 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); if (message.siteKey != null && message.hasOwnProperty("siteKey")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.siteKey); + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userAgent); + if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.userIpAddress); + if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.expectedAction); return writer; }; @@ -1263,6 +1461,15 @@ case 2: message.siteKey = reader.string(); break; + case 3: + message.userAgent = reader.string(); + break; + case 4: + message.userIpAddress = reader.string(); + break; + case 5: + message.expectedAction = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1304,6 +1511,15 @@ if (message.siteKey != null && message.hasOwnProperty("siteKey")) if (!$util.isString(message.siteKey)) return "siteKey: string expected"; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + if (!$util.isString(message.userAgent)) + return "userAgent: string expected"; + if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) + if (!$util.isString(message.userIpAddress)) + return "userIpAddress: string expected"; + if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) + if (!$util.isString(message.expectedAction)) + return "expectedAction: string expected"; return null; }; @@ -1323,6 +1539,12 @@ message.token = String(object.token); if (object.siteKey != null) message.siteKey = String(object.siteKey); + if (object.userAgent != null) + message.userAgent = String(object.userAgent); + if (object.userIpAddress != null) + message.userIpAddress = String(object.userIpAddress); + if (object.expectedAction != null) + message.expectedAction = String(object.expectedAction); return message; }; @@ -1342,11 +1564,20 @@ if (options.defaults) { object.token = ""; object.siteKey = ""; + object.userAgent = ""; + object.userIpAddress = ""; + object.expectedAction = ""; } if (message.token != null && message.hasOwnProperty("token")) object.token = message.token; if (message.siteKey != null && message.hasOwnProperty("siteKey")) object.siteKey = message.siteKey; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + object.userAgent = message.userAgent; + if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) + object.userIpAddress = message.userIpAddress; + if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) + object.expectedAction = message.expectedAction; return object; }; @@ -1692,19 +1923,2397 @@ * @property {number} SITE_MISMATCH=5 SITE_MISMATCH value * @property {number} MISSING=6 MISSING value */ - TokenProperties.InvalidReason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INVALID_REASON_UNSPECIFIED"] = 0; - values[valuesById[1] = "UNKNOWN_INVALID_REASON"] = 1; - values[valuesById[2] = "MALFORMED"] = 2; - values[valuesById[3] = "EXPIRED"] = 3; - values[valuesById[4] = "DUPE"] = 4; - values[valuesById[5] = "SITE_MISMATCH"] = 5; - values[valuesById[6] = "MISSING"] = 6; - return values; - })(); + TokenProperties.InvalidReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INVALID_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNKNOWN_INVALID_REASON"] = 1; + values[valuesById[2] = "MALFORMED"] = 2; + values[valuesById[3] = "EXPIRED"] = 3; + values[valuesById[4] = "DUPE"] = 4; + values[valuesById[5] = "SITE_MISMATCH"] = 5; + values[valuesById[6] = "MISSING"] = 6; + return values; + })(); + + return TokenProperties; + })(); + + v1beta1.CreateKeyRequest = (function() { + + /** + * Properties of a CreateKeyRequest. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface ICreateKeyRequest + * @property {string|null} [parent] CreateKeyRequest parent + * @property {google.cloud.recaptchaenterprise.v1beta1.IKey|null} [key] CreateKeyRequest key + */ + + /** + * Constructs a new CreateKeyRequest. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents a CreateKeyRequest. + * @implements ICreateKeyRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest=} [properties] Properties to set + */ + function CreateKeyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateKeyRequest parent. + * @member {string} parent + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @instance + */ + CreateKeyRequest.prototype.parent = ""; + + /** + * CreateKeyRequest key. + * @member {google.cloud.recaptchaenterprise.v1beta1.IKey|null|undefined} key + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @instance + */ + CreateKeyRequest.prototype.key = null; + + /** + * Creates a new CreateKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest} CreateKeyRequest instance + */ + CreateKeyRequest.create = function create(properties) { + return new CreateKeyRequest(properties); + }; + + /** + * Encodes the specified CreateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest} message CreateKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateKeyRequest.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.key != null && message.hasOwnProperty("key")) + $root.google.cloud.recaptchaenterprise.v1beta1.Key.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest} message CreateKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest} CreateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.key = $root.google.cloud.recaptchaenterprise.v1beta1.Key.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest} CreateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateKeyRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateKeyRequest.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.key != null && message.hasOwnProperty("key")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.Key.verify(message.key); + if (error) + return "key." + error; + } + return null; + }; + + /** + * Creates a CreateKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest} CreateKeyRequest + */ + CreateKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest.key: object expected"); + message.key = $root.google.cloud.recaptchaenterprise.v1beta1.Key.fromObject(object.key); + } + return message; + }; + + /** + * Creates a plain object from a CreateKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest} message CreateKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.key = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.google.cloud.recaptchaenterprise.v1beta1.Key.toObject(message.key, options); + return object; + }; + + /** + * Converts this CreateKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateKeyRequest; + })(); + + v1beta1.ListKeysRequest = (function() { + + /** + * Properties of a ListKeysRequest. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface IListKeysRequest + * @property {string|null} [parent] ListKeysRequest parent + * @property {number|null} [pageSize] ListKeysRequest pageSize + * @property {string|null} [pageToken] ListKeysRequest pageToken + */ + + /** + * Constructs a new ListKeysRequest. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents a ListKeysRequest. + * @implements IListKeysRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest=} [properties] Properties to set + */ + function ListKeysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListKeysRequest parent. + * @member {string} parent + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest + * @instance + */ + ListKeysRequest.prototype.parent = ""; + + /** + * ListKeysRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest + * @instance + */ + ListKeysRequest.prototype.pageSize = 0; + + /** + * ListKeysRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest + * @instance + */ + ListKeysRequest.prototype.pageToken = ""; + + /** + * Creates a new ListKeysRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} ListKeysRequest instance + */ + ListKeysRequest.create = function create(properties) { + return new ListKeysRequest(properties); + }; + + /** + * Encodes the specified ListKeysRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest} message ListKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKeysRequest.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); + return writer; + }; + + /** + * Encodes the specified ListKeysRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest} message ListKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListKeysRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} ListKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKeysRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListKeysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} ListKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKeysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListKeysRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListKeysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListKeysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} ListKeysRequest + */ + ListKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListKeysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} message ListKeysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListKeysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListKeysRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest + * @instance + * @returns {Object.} JSON object + */ + ListKeysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListKeysRequest; + })(); + + v1beta1.ListKeysResponse = (function() { + + /** + * Properties of a ListKeysResponse. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface IListKeysResponse + * @property {Array.|null} [keys] ListKeysResponse keys + * @property {string|null} [nextPageToken] ListKeysResponse nextPageToken + */ + + /** + * Constructs a new ListKeysResponse. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents a ListKeysResponse. + * @implements IListKeysResponse + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse=} [properties] Properties to set + */ + function ListKeysResponse(properties) { + this.keys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListKeysResponse keys. + * @member {Array.} keys + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse + * @instance + */ + ListKeysResponse.prototype.keys = $util.emptyArray; + + /** + * ListKeysResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse + * @instance + */ + ListKeysResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListKeysResponse instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse} ListKeysResponse instance + */ + ListKeysResponse.create = function create(properties) { + return new ListKeysResponse(properties); + }; + + /** + * Encodes the specified ListKeysResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse} message ListKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKeysResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.google.cloud.recaptchaenterprise.v1beta1.Key.encode(message.keys[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 ListKeysResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse} message ListKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListKeysResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse} ListKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKeysResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.cloud.recaptchaenterprise.v1beta1.Key.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListKeysResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse} ListKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKeysResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListKeysResponse message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListKeysResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.Key.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListKeysResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse} ListKeysResponse + */ + ListKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse(); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse.keys: object expected"); + message.keys[i] = $root.google.cloud.recaptchaenterprise.v1beta1.Key.fromObject(object.keys[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListKeysResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse} message ListKeysResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListKeysResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keys = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.cloud.recaptchaenterprise.v1beta1.Key.toObject(message.keys[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListKeysResponse to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse + * @instance + * @returns {Object.} JSON object + */ + ListKeysResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListKeysResponse; + })(); + + v1beta1.GetKeyRequest = (function() { + + /** + * Properties of a GetKeyRequest. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface IGetKeyRequest + * @property {string|null} [name] GetKeyRequest name + */ + + /** + * Constructs a new GetKeyRequest. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents a GetKeyRequest. + * @implements IGetKeyRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest=} [properties] Properties to set + */ + function GetKeyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetKeyRequest name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest + * @instance + */ + GetKeyRequest.prototype.name = ""; + + /** + * Creates a new GetKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest} GetKeyRequest instance + */ + GetKeyRequest.create = function create(properties) { + return new GetKeyRequest(properties); + }; + + /** + * Encodes the specified GetKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest} message GetKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetKeyRequest.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 GetKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest} message GetKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest} GetKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest(); + 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 GetKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest} GetKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetKeyRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetKeyRequest.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 GetKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest} GetKeyRequest + */ + GetKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest} message GetKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetKeyRequest.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 GetKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest + * @instance + * @returns {Object.} JSON object + */ + GetKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetKeyRequest; + })(); + + v1beta1.UpdateKeyRequest = (function() { + + /** + * Properties of an UpdateKeyRequest. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface IUpdateKeyRequest + * @property {google.cloud.recaptchaenterprise.v1beta1.IKey|null} [key] UpdateKeyRequest key + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateKeyRequest updateMask + */ + + /** + * Constructs a new UpdateKeyRequest. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents an UpdateKeyRequest. + * @implements IUpdateKeyRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest=} [properties] Properties to set + */ + function UpdateKeyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateKeyRequest key. + * @member {google.cloud.recaptchaenterprise.v1beta1.IKey|null|undefined} key + * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest + * @instance + */ + UpdateKeyRequest.prototype.key = null; + + /** + * UpdateKeyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest + * @instance + */ + UpdateKeyRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest} UpdateKeyRequest instance + */ + UpdateKeyRequest.create = function create(properties) { + return new UpdateKeyRequest(properties); + }; + + /** + * Encodes the specified UpdateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest} message UpdateKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateKeyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && message.hasOwnProperty("key")) + $root.google.cloud.recaptchaenterprise.v1beta1.Key.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest} message UpdateKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest} UpdateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = $root.google.cloud.recaptchaenterprise.v1beta1.Key.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest} UpdateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateKeyRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateKeyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.Key.verify(message.key); + if (error) + return "key." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest} UpdateKeyRequest + */ + UpdateKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest.key: object expected"); + message.key = $root.google.cloud.recaptchaenterprise.v1beta1.Key.fromObject(object.key); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest} message UpdateKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = null; + object.updateMask = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.google.cloud.recaptchaenterprise.v1beta1.Key.toObject(message.key, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateKeyRequest; + })(); + + v1beta1.DeleteKeyRequest = (function() { + + /** + * Properties of a DeleteKeyRequest. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface IDeleteKeyRequest + * @property {string|null} [name] DeleteKeyRequest name + */ + + /** + * Constructs a new DeleteKeyRequest. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents a DeleteKeyRequest. + * @implements IDeleteKeyRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest=} [properties] Properties to set + */ + function DeleteKeyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteKeyRequest name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest + * @instance + */ + DeleteKeyRequest.prototype.name = ""; + + /** + * Creates a new DeleteKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest} DeleteKeyRequest instance + */ + DeleteKeyRequest.create = function create(properties) { + return new DeleteKeyRequest(properties); + }; + + /** + * Encodes the specified DeleteKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest} message DeleteKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteKeyRequest.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 DeleteKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest} message DeleteKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest} DeleteKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest(); + 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 DeleteKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest} DeleteKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteKeyRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteKeyRequest.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 DeleteKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest} DeleteKeyRequest + */ + DeleteKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest} message DeleteKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteKeyRequest.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 DeleteKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteKeyRequest; + })(); + + v1beta1.Key = (function() { + + /** + * Properties of a Key. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface IKey + * @property {string|null} [name] Key name + * @property {string|null} [displayName] Key displayName + * @property {google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings|null} [webSettings] Key webSettings + * @property {google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings|null} [androidSettings] Key androidSettings + * @property {google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings|null} [iosSettings] Key iosSettings + */ + + /** + * Constructs a new Key. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents a Key. + * @implements IKey + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.IKey=} [properties] Properties to set + */ + function Key(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Key name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1beta1.Key + * @instance + */ + Key.prototype.name = ""; + + /** + * Key displayName. + * @member {string} displayName + * @memberof google.cloud.recaptchaenterprise.v1beta1.Key + * @instance + */ + Key.prototype.displayName = ""; + + /** + * Key webSettings. + * @member {google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings|null|undefined} webSettings + * @memberof google.cloud.recaptchaenterprise.v1beta1.Key + * @instance + */ + Key.prototype.webSettings = null; + + /** + * Key androidSettings. + * @member {google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings|null|undefined} androidSettings + * @memberof google.cloud.recaptchaenterprise.v1beta1.Key + * @instance + */ + Key.prototype.androidSettings = null; + + /** + * Key iosSettings. + * @member {google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings|null|undefined} iosSettings + * @memberof google.cloud.recaptchaenterprise.v1beta1.Key + * @instance + */ + Key.prototype.iosSettings = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Key platformSettings. + * @member {"webSettings"|"androidSettings"|"iosSettings"|undefined} platformSettings + * @memberof google.cloud.recaptchaenterprise.v1beta1.Key + * @instance + */ + Object.defineProperty(Key.prototype, "platformSettings", { + get: $util.oneOfGetter($oneOfFields = ["webSettings", "androidSettings", "iosSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.Key + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IKey=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Key.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.Key + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IKey} message Key message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.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.webSettings != null && message.hasOwnProperty("webSettings")) + $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.encode(message.webSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) + $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.encode(message.androidSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) + $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.encode(message.iosSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Key message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Key.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.Key + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IKey} message Key message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.Key + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.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: + message.webSettings = $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.decode(reader, reader.uint32()); + break; + case 4: + message.androidSettings = $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.decode(reader, reader.uint32()); + break; + case 5: + message.iosSettings = $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Key message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.Key + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Key message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.Key + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Key.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.webSettings != null && message.hasOwnProperty("webSettings")) { + properties.platformSettings = 1; + { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.verify(message.webSettings); + if (error) + return "webSettings." + error; + } + } + if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) { + if (properties.platformSettings === 1) + return "platformSettings: multiple values"; + properties.platformSettings = 1; + { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.verify(message.androidSettings); + if (error) + return "androidSettings." + error; + } + } + if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) { + if (properties.platformSettings === 1) + return "platformSettings: multiple values"; + properties.platformSettings = 1; + { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.verify(message.iosSettings); + if (error) + return "iosSettings." + error; + } + } + return null; + }; + + /** + * Creates a Key message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.Key + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.Key} Key + */ + Key.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.Key) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.Key(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.webSettings != null) { + if (typeof object.webSettings !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Key.webSettings: object expected"); + message.webSettings = $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.fromObject(object.webSettings); + } + if (object.androidSettings != null) { + if (typeof object.androidSettings !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Key.androidSettings: object expected"); + message.androidSettings = $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.fromObject(object.androidSettings); + } + if (object.iosSettings != null) { + if (typeof object.iosSettings !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Key.iosSettings: object expected"); + message.iosSettings = $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.fromObject(object.iosSettings); + } + return message; + }; + + /** + * Creates a plain object from a Key message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.Key + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.Key} message Key + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Key.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.webSettings != null && message.hasOwnProperty("webSettings")) { + object.webSettings = $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.toObject(message.webSettings, options); + if (options.oneofs) + object.platformSettings = "webSettings"; + } + if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) { + object.androidSettings = $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.toObject(message.androidSettings, options); + if (options.oneofs) + object.platformSettings = "androidSettings"; + } + if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) { + object.iosSettings = $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.toObject(message.iosSettings, options); + if (options.oneofs) + object.platformSettings = "iosSettings"; + } + return object; + }; + + /** + * Converts this Key to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.Key + * @instance + * @returns {Object.} JSON object + */ + Key.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Key; + })(); + + v1beta1.WebKeySettings = (function() { + + /** + * Properties of a WebKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface IWebKeySettings + * @property {boolean|null} [enforceAllowedDomains] WebKeySettings enforceAllowedDomains + * @property {Array.|null} [allowedDomains] WebKeySettings allowedDomains + * @property {boolean|null} [allowAmpTraffic] WebKeySettings allowAmpTraffic + * @property {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType|null} [integrationType] WebKeySettings integrationType + * @property {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference|null} [challengeSecurityPreference] WebKeySettings challengeSecurityPreference + */ + + /** + * Constructs a new WebKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents a WebKeySettings. + * @implements IWebKeySettings + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings=} [properties] Properties to set + */ + function WebKeySettings(properties) { + this.allowedDomains = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebKeySettings enforceAllowedDomains. + * @member {boolean} enforceAllowedDomains + * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.enforceAllowedDomains = false; + + /** + * WebKeySettings allowedDomains. + * @member {Array.} allowedDomains + * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.allowedDomains = $util.emptyArray; + + /** + * WebKeySettings allowAmpTraffic. + * @member {boolean} allowAmpTraffic + * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.allowAmpTraffic = false; + + /** + * WebKeySettings integrationType. + * @member {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType} integrationType + * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.integrationType = 0; + + /** + * WebKeySettings challengeSecurityPreference. + * @member {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference} challengeSecurityPreference + * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.challengeSecurityPreference = 0; + + /** + * Creates a new WebKeySettings instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings} WebKeySettings instance + */ + WebKeySettings.create = function create(properties) { + return new WebKeySettings(properties); + }; + + /** + * Encodes the specified WebKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings} message WebKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebKeySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedDomains != null && message.allowedDomains.length) + for (var i = 0; i < message.allowedDomains.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedDomains[i]); + if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAmpTraffic); + if (message.enforceAllowedDomains != null && message.hasOwnProperty("enforceAllowedDomains")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enforceAllowedDomains); + if (message.integrationType != null && message.hasOwnProperty("integrationType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.integrationType); + if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.challengeSecurityPreference); + return writer; + }; + + /** + * Encodes the specified WebKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings} message WebKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebKeySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebKeySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings} WebKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebKeySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.enforceAllowedDomains = reader.bool(); + break; + case 1: + if (!(message.allowedDomains && message.allowedDomains.length)) + message.allowedDomains = []; + message.allowedDomains.push(reader.string()); + break; + case 2: + message.allowAmpTraffic = reader.bool(); + break; + case 4: + message.integrationType = reader.int32(); + break; + case 5: + message.challengeSecurityPreference = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebKeySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings} WebKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebKeySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebKeySettings message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebKeySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enforceAllowedDomains != null && message.hasOwnProperty("enforceAllowedDomains")) + if (typeof message.enforceAllowedDomains !== "boolean") + return "enforceAllowedDomains: boolean expected"; + if (message.allowedDomains != null && message.hasOwnProperty("allowedDomains")) { + if (!Array.isArray(message.allowedDomains)) + return "allowedDomains: array expected"; + for (var i = 0; i < message.allowedDomains.length; ++i) + if (!$util.isString(message.allowedDomains[i])) + return "allowedDomains: string[] expected"; + } + if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) + if (typeof message.allowAmpTraffic !== "boolean") + return "allowAmpTraffic: boolean expected"; + if (message.integrationType != null && message.hasOwnProperty("integrationType")) + switch (message.integrationType) { + default: + return "integrationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) + switch (message.challengeSecurityPreference) { + default: + return "challengeSecurityPreference: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a WebKeySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings} WebKeySettings + */ + WebKeySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings(); + if (object.enforceAllowedDomains != null) + message.enforceAllowedDomains = Boolean(object.enforceAllowedDomains); + if (object.allowedDomains) { + if (!Array.isArray(object.allowedDomains)) + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.allowedDomains: array expected"); + message.allowedDomains = []; + for (var i = 0; i < object.allowedDomains.length; ++i) + message.allowedDomains[i] = String(object.allowedDomains[i]); + } + if (object.allowAmpTraffic != null) + message.allowAmpTraffic = Boolean(object.allowAmpTraffic); + switch (object.integrationType) { + case "INTEGRATION_TYPE_UNSPECIFIED": + case 0: + message.integrationType = 0; + break; + case "SCORE_ONLY": + case 1: + message.integrationType = 1; + break; + case "CHECKBOX_CHALLENGE": + case 2: + message.integrationType = 2; + break; + case "INVISIBLE_CHALLENGE": + case 3: + message.integrationType = 3; + break; + } + switch (object.challengeSecurityPreference) { + case "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED": + case 0: + message.challengeSecurityPreference = 0; + break; + case "USABILITY": + case 1: + message.challengeSecurityPreference = 1; + break; + case "BALANCED": + case 2: + message.challengeSecurityPreference = 2; + break; + case "SECURITY": + case 3: + message.challengeSecurityPreference = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a WebKeySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings} message WebKeySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebKeySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedDomains = []; + if (options.defaults) { + object.allowAmpTraffic = false; + object.enforceAllowedDomains = false; + object.integrationType = options.enums === String ? "INTEGRATION_TYPE_UNSPECIFIED" : 0; + object.challengeSecurityPreference = options.enums === String ? "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED" : 0; + } + if (message.allowedDomains && message.allowedDomains.length) { + object.allowedDomains = []; + for (var j = 0; j < message.allowedDomains.length; ++j) + object.allowedDomains[j] = message.allowedDomains[j]; + } + if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) + object.allowAmpTraffic = message.allowAmpTraffic; + if (message.enforceAllowedDomains != null && message.hasOwnProperty("enforceAllowedDomains")) + object.enforceAllowedDomains = message.enforceAllowedDomains; + if (message.integrationType != null && message.hasOwnProperty("integrationType")) + object.integrationType = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType[message.integrationType] : message.integrationType; + if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) + object.challengeSecurityPreference = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference[message.challengeSecurityPreference] : message.challengeSecurityPreference; + return object; + }; + + /** + * Converts this WebKeySettings to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings + * @instance + * @returns {Object.} JSON object + */ + WebKeySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * IntegrationType enum. + * @name google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType + * @enum {string} + * @property {number} INTEGRATION_TYPE_UNSPECIFIED=0 INTEGRATION_TYPE_UNSPECIFIED value + * @property {number} SCORE_ONLY=1 SCORE_ONLY value + * @property {number} CHECKBOX_CHALLENGE=2 CHECKBOX_CHALLENGE value + * @property {number} INVISIBLE_CHALLENGE=3 INVISIBLE_CHALLENGE value + */ + WebKeySettings.IntegrationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTEGRATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCORE_ONLY"] = 1; + values[valuesById[2] = "CHECKBOX_CHALLENGE"] = 2; + values[valuesById[3] = "INVISIBLE_CHALLENGE"] = 3; + return values; + })(); + + /** + * ChallengeSecurityPreference enum. + * @name google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference + * @enum {string} + * @property {number} CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED=0 CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED value + * @property {number} USABILITY=1 USABILITY value + * @property {number} BALANCED=2 BALANCED value + * @property {number} SECURITY=3 SECURITY value + */ + WebKeySettings.ChallengeSecurityPreference = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USABILITY"] = 1; + values[valuesById[2] = "BALANCED"] = 2; + values[valuesById[3] = "SECURITY"] = 3; + return values; + })(); + + return WebKeySettings; + })(); + + v1beta1.AndroidKeySettings = (function() { + + /** + * Properties of an AndroidKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface IAndroidKeySettings + * @property {Array.|null} [allowedPackageNames] AndroidKeySettings allowedPackageNames + */ + + /** + * Constructs a new AndroidKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents an AndroidKeySettings. + * @implements IAndroidKeySettings + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings=} [properties] Properties to set + */ + function AndroidKeySettings(properties) { + this.allowedPackageNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AndroidKeySettings allowedPackageNames. + * @member {Array.} allowedPackageNames + * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings + * @instance + */ + AndroidKeySettings.prototype.allowedPackageNames = $util.emptyArray; + + /** + * Creates a new AndroidKeySettings instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings} AndroidKeySettings instance + */ + AndroidKeySettings.create = function create(properties) { + return new AndroidKeySettings(properties); + }; + + /** + * Encodes the specified AndroidKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings} message AndroidKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AndroidKeySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedPackageNames != null && message.allowedPackageNames.length) + for (var i = 0; i < message.allowedPackageNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedPackageNames[i]); + return writer; + }; + + /** + * Encodes the specified AndroidKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings} message AndroidKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AndroidKeySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AndroidKeySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings} AndroidKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AndroidKeySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.allowedPackageNames && message.allowedPackageNames.length)) + message.allowedPackageNames = []; + message.allowedPackageNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AndroidKeySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings} AndroidKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AndroidKeySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AndroidKeySettings message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AndroidKeySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedPackageNames != null && message.hasOwnProperty("allowedPackageNames")) { + if (!Array.isArray(message.allowedPackageNames)) + return "allowedPackageNames: array expected"; + for (var i = 0; i < message.allowedPackageNames.length; ++i) + if (!$util.isString(message.allowedPackageNames[i])) + return "allowedPackageNames: string[] expected"; + } + return null; + }; + + /** + * Creates an AndroidKeySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings} AndroidKeySettings + */ + AndroidKeySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings(); + if (object.allowedPackageNames) { + if (!Array.isArray(object.allowedPackageNames)) + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.allowedPackageNames: array expected"); + message.allowedPackageNames = []; + for (var i = 0; i < object.allowedPackageNames.length; ++i) + message.allowedPackageNames[i] = String(object.allowedPackageNames[i]); + } + return message; + }; + + /** + * Creates a plain object from an AndroidKeySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings} message AndroidKeySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AndroidKeySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedPackageNames = []; + if (message.allowedPackageNames && message.allowedPackageNames.length) { + object.allowedPackageNames = []; + for (var j = 0; j < message.allowedPackageNames.length; ++j) + object.allowedPackageNames[j] = message.allowedPackageNames[j]; + } + return object; + }; + + /** + * Converts this AndroidKeySettings to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings + * @instance + * @returns {Object.} JSON object + */ + AndroidKeySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AndroidKeySettings; + })(); + + v1beta1.IOSKeySettings = (function() { + + /** + * Properties of a IOSKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface IIOSKeySettings + * @property {Array.|null} [allowedBundleIds] IOSKeySettings allowedBundleIds + */ + + /** + * Constructs a new IOSKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents a IOSKeySettings. + * @implements IIOSKeySettings + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings=} [properties] Properties to set + */ + function IOSKeySettings(properties) { + this.allowedBundleIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IOSKeySettings allowedBundleIds. + * @member {Array.} allowedBundleIds + * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings + * @instance + */ + IOSKeySettings.prototype.allowedBundleIds = $util.emptyArray; + + /** + * Creates a new IOSKeySettings instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings} IOSKeySettings instance + */ + IOSKeySettings.create = function create(properties) { + return new IOSKeySettings(properties); + }; + + /** + * Encodes the specified IOSKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings} message IOSKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IOSKeySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedBundleIds != null && message.allowedBundleIds.length) + for (var i = 0; i < message.allowedBundleIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedBundleIds[i]); + return writer; + }; + + /** + * Encodes the specified IOSKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings} message IOSKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IOSKeySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a IOSKeySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings} IOSKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IOSKeySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.allowedBundleIds && message.allowedBundleIds.length)) + message.allowedBundleIds = []; + message.allowedBundleIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a IOSKeySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings} IOSKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IOSKeySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a IOSKeySettings message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IOSKeySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedBundleIds != null && message.hasOwnProperty("allowedBundleIds")) { + if (!Array.isArray(message.allowedBundleIds)) + return "allowedBundleIds: array expected"; + for (var i = 0; i < message.allowedBundleIds.length; ++i) + if (!$util.isString(message.allowedBundleIds[i])) + return "allowedBundleIds: string[] expected"; + } + return null; + }; + + /** + * Creates a IOSKeySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings} IOSKeySettings + */ + IOSKeySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings(); + if (object.allowedBundleIds) { + if (!Array.isArray(object.allowedBundleIds)) + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.allowedBundleIds: array expected"); + message.allowedBundleIds = []; + for (var i = 0; i < object.allowedBundleIds.length; ++i) + message.allowedBundleIds[i] = String(object.allowedBundleIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a IOSKeySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings} message IOSKeySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IOSKeySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedBundleIds = []; + if (message.allowedBundleIds && message.allowedBundleIds.length) { + object.allowedBundleIds = []; + for (var j = 0; j < message.allowedBundleIds.length; ++j) + object.allowedBundleIds[j] = message.allowedBundleIds[j]; + } + return object; + }; + + /** + * Converts this IOSKeySettings to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings + * @instance + * @returns {Object.} JSON object + */ + IOSKeySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return TokenProperties; + return IOSKeySettings; })(); return v1beta1; @@ -11875,6 +14484,369 @@ return GeneratedCodeInfo; })(); + 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() { /** diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index 6bc37b91cca..f71a34b50b6 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -40,6 +40,43 @@ "(google.api.http).body": "*", "(google.api.method_signature)": "name,annotation" } + }, + "CreateKey": { + "requestType": "CreateKeyRequest", + "responseType": "Key", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*}/keys", + "(google.api.http).body": "key" + } + }, + "ListKeys": { + "requestType": "ListKeysRequest", + "responseType": "ListKeysResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*}/keys" + } + }, + "GetKey": { + "requestType": "GetKeyRequest", + "responseType": "Key", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/keys/*}" + } + }, + "UpdateKey": { + "requestType": "UpdateKeyRequest", + "responseType": "Key", + "options": { + "(google.api.http).patch": "/v1beta1/{key.name=projects/*/keys/*}", + "(google.api.http).body": "key" + } + }, + "DeleteKey": { + "requestType": "DeleteKeyRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/keys/*}" + } } } }, @@ -152,14 +189,35 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } }, "siteKey": { "type": "string", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userAgent": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userIpAddress": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expectedAction": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } @@ -200,6 +258,207 @@ } } } + }, + "CreateKeyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "key": { + "type": "Key", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListKeysRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListKeysResponse": { + "fields": { + "keys": { + "rule": "repeated", + "type": "Key", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetKeyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/Key" + } + } + } + }, + "UpdateKeyRequest": { + "fields": { + "key": { + "type": "Key", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteKeyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/Key" + } + } + } + }, + "Key": { + "options": { + "(google.api.resource).type": "recaptchaenterprise.googleapis.com/Key", + "(google.api.resource).pattern": "projects/{project}/keys/{key}" + }, + "oneofs": { + "platformSettings": { + "oneof": [ + "webSettings", + "androidSettings", + "iosSettings" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "webSettings": { + "type": "WebKeySettings", + "id": 3 + }, + "androidSettings": { + "type": "AndroidKeySettings", + "id": 4 + }, + "iosSettings": { + "type": "IOSKeySettings", + "id": 5 + } + } + }, + "WebKeySettings": { + "fields": { + "enforceAllowedDomains": { + "type": "bool", + "id": 3 + }, + "allowedDomains": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "allowAmpTraffic": { + "type": "bool", + "id": 2 + }, + "integrationType": { + "type": "IntegrationType", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "challengeSecurityPreference": { + "type": "ChallengeSecurityPreference", + "id": 5 + } + }, + "nested": { + "IntegrationType": { + "values": { + "INTEGRATION_TYPE_UNSPECIFIED": 0, + "SCORE_ONLY": 1, + "CHECKBOX_CHALLENGE": 2, + "INVISIBLE_CHALLENGE": 3 + } + }, + "ChallengeSecurityPreference": { + "values": { + "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED": 0, + "USABILITY": 1, + "BALANCED": 2, + "SECURITY": 3 + } + } + } + }, + "AndroidKeySettings": { + "fields": { + "allowedPackageNames": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "IOSKeySettings": { + "fields": { + "allowedBundleIds": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } } } } @@ -1295,6 +1554,18 @@ } } }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, "Timestamp": { "fields": { "seconds": { diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/cloud/recaptchaenterprise/v1beta1/doc_recaptchaenterprise.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/cloud/recaptchaenterprise/v1beta1/doc_recaptchaenterprise.js index 3da58d9b748..d91ccbb02da 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/cloud/recaptchaenterprise/v1beta1/doc_recaptchaenterprise.js +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/cloud/recaptchaenterprise/v1beta1/doc_recaptchaenterprise.js @@ -168,13 +168,25 @@ const Assessment = { /** * @property {string} token - * Required. The user response token provided by the reCAPTCHA client-side integration + * Optional. The user response token provided by the reCAPTCHA client-side integration * on your site. * * @property {string} siteKey - * Required. The site key that was used to invoke reCAPTCHA on your site and generate + * Optional. The site key that was used to invoke reCAPTCHA on your site and generate * the token. * + * @property {string} userAgent + * Optional. The user agent present in the request from the user's device related to + * this event. + * + * @property {string} userIpAddress + * Optional. The IP address in the request from the user's device related to this event. + * + * @property {string} expectedAction + * Optional. The expected action for this type of event. This should be the same action + * provided at token generation time on client-side platforms already + * integrated with recaptcha enterprise. + * * @typedef Event * @memberof google.cloud.recaptchaenterprise.v1beta1 * @see [google.cloud.recaptchaenterprise.v1beta1.Event definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} @@ -257,4 +269,282 @@ const TokenProperties = { */ MISSING: 6 } +}; + +/** + * The create key request message. + * + * @property {string} parent + * Required. The name of the project in which the key will be created, in the + * format "projects/{project_number}". + * + * @property {Object} key + * Required. Information to create a reCAPTCHA Enterprise key. + * + * This object should have the same structure as [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} + * + * @typedef CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @see [google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} + */ +const CreateKeyRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The list keys request message. + * + * @property {string} parent + * Required. The name of the project that contains the keys that will be + * listed, in the format "projects/{project_number}". + * + * @property {number} pageSize + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * + * @property {string} pageToken + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * + * @typedef ListKeysRequest + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @see [google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} + */ +const ListKeysRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Response to request to list keys in a project. + * + * @property {Object[]} keys + * Key details. + * + * This object should have the same structure as [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} + * + * @property {string} nextPageToken + * Token to retrieve the next page of results. It is set to empty if no keys + * remain in results. + * + * @typedef ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @see [google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} + */ +const ListKeysResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The get key request message. + * + * @property {string} name + * Required. The name of the requested key, in the format + * "projects/{project_number}/keys/{key_id}". + * + * @typedef GetKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @see [google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} + */ +const GetKeyRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The update key request message. + * + * @property {Object} key + * Required. The key to update. + * + * This object should have the same structure as [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} + * + * @property {Object} updateMask + * Optional. The mask to control which field of the key get updated. If the mask is not + * present, all fields will be updated. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * + * @typedef UpdateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @see [google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} + */ +const UpdateKeyRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * The delete key request message. + * + * @property {string} name + * Required. The name of the key to be deleted, in the format + * "projects/{project_number}/keys/{key_id}". + * + * @typedef DeleteKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @see [google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} + */ +const DeleteKeyRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * A key used to identify and configure applications (web and/or mobile) that + * use reCAPTCHA Enterprise. + * + * @property {string} name + * The resource name for the Key in the format + * "projects/{project_number}/keys/{key_id}". + * + * @property {string} displayName + * Human-readable display name of this key. Modifiable by user. + * + * @property {Object} webSettings + * Settings for keys that can be used by websites. + * + * This object should have the same structure as [WebKeySettings]{@link google.cloud.recaptchaenterprise.v1beta1.WebKeySettings} + * + * @property {Object} androidSettings + * Settings for keys that can be used by Android apps. + * + * This object should have the same structure as [AndroidKeySettings]{@link google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings} + * + * @property {Object} iosSettings + * Settings for keys that can be used by iOS apps. + * + * This object should have the same structure as [IOSKeySettings]{@link google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings} + * + * @typedef Key + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @see [google.cloud.recaptchaenterprise.v1beta1.Key definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} + */ +const Key = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Settings specific to keys that can be used by websites. + * + * @property {boolean} enforceAllowedDomains + * Whether allowed_domains is enforced or not. + * + * @property {string[]} allowedDomains + * Domains or subdomains of websites allowed to use the key. All subdomains + * of an allowed domain are automatically allowed. A valid domain requires a + * host and must not include any path, port, query or fragment. + * Examples: 'example.com' or 'subdomain.example.com' + * + * @property {boolean} allowAmpTraffic + * Whether this key can be used on AMP (Accelerated Mobile Pages) websites. + * + * @property {number} integrationType + * Required. Describes how this key is integrated with the website. + * + * The number should be among the values of [IntegrationType]{@link google.cloud.recaptchaenterprise.v1beta1.IntegrationType} + * + * @property {number} challengeSecurityPreference + * Settings for the frequency and difficulty at which this key triggers + * captcha challenges. This should only be specified for IntegrationTypes + * CHECKBOX_CHALLENGE and INVISIBLE_CHALLENGE. + * + * The number should be among the values of [ChallengeSecurityPreference]{@link google.cloud.recaptchaenterprise.v1beta1.ChallengeSecurityPreference} + * + * @typedef WebKeySettings + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @see [google.cloud.recaptchaenterprise.v1beta1.WebKeySettings definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} + */ +const WebKeySettings = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Enum that represents the possible challenge frequency and difficulty + * configurations for a web key. + * + * @enum {number} + * @memberof google.cloud.recaptchaenterprise.v1beta1 + */ + ChallengeSecurityPreference: { + + /** + * Default type that indicates this enum hasn't been specified. + */ + CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED: 0, + + /** + * Key tends to show fewer and easier challenges. + */ + USABILITY: 1, + + /** + * Key tends to show balanced (in amount and difficulty) challenges. + */ + BALANCED: 2, + + /** + * Key tends to show more and harder challenges. + */ + SECURITY: 3 + }, + + /** + * Enum that represents the integration types for web keys. + * + * @enum {number} + * @memberof google.cloud.recaptchaenterprise.v1beta1 + */ + IntegrationType: { + + /** + * Default type that indicates this enum hasn't been specified. This is not + * a valid IntegrationType, one of the other types must be specified + * instead. + */ + INTEGRATION_TYPE_UNSPECIFIED: 0, + + /** + * Only used to produce scores. It doesn't display the "I'm not a robot" + * checkbox and never shows captcha challenges. + */ + SCORE_ONLY: 1, + + /** + * Displays the "I'm not a robot" checkbox and may show captcha challenges + * after it is checked. + */ + CHECKBOX_CHALLENGE: 2, + + /** + * Doesn't display the "I'm not a robot" checkbox, but may show captcha + * challenges after risk analysis. + */ + INVISIBLE_CHALLENGE: 3 + } +}; + +/** + * Settings specific to keys that can be used by Android apps. + * + * @property {string[]} allowedPackageNames + * Android package names of apps allowed to use the key. + * Example: 'com.companyname.appname' + * + * @typedef AndroidKeySettings + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @see [google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} + */ +const AndroidKeySettings = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Settings specific to keys that can be used by iOS apps. + * + * @property {string[]} allowedBundleIds + * iOS bundle ids of apps allowed to use the key. + * Example: 'com.companyname.productname.appname' + * + * @typedef IOSKeySettings + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @see [google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} + */ +const IOSKeySettings = { + // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_empty.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_empty.js new file mode 100644 index 00000000000..0b446dd9ce4 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_empty.js @@ -0,0 +1,34 @@ +// 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 +// +// 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * The JSON representation for `Empty` is empty JSON object `{}`. + * @typedef Empty + * @memberof google.protobuf + * @see [google.protobuf.Empty definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/empty.proto} + */ +const Empty = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_field_mask.js new file mode 100644 index 00000000000..011207b8626 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_field_mask.js @@ -0,0 +1,228 @@ +// 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 +// +// 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. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * `FieldMask` represents a set of symbolic field paths, for example: + * + * paths: "f.a" + * paths: "f.b.d" + * + * Here `f` represents a field in some root message, `a` and `b` + * fields in the message found in `f`, and `d` a field found in the + * message in `f.b`. + * + * Field masks are used to specify a subset of fields that should be + * returned by a get operation or modified by an update operation. + * Field masks also have a custom JSON encoding (see below). + * + * # Field Masks in Projections + * + * When used in the context of a projection, a response message or + * sub-message is filtered by the API to only contain those fields as + * specified in the mask. For example, if the mask in the previous + * example is applied to a response message as follows: + * + * f { + * a : 22 + * b { + * d : 1 + * x : 2 + * } + * y : 13 + * } + * z: 8 + * + * The result will not contain specific values for fields x,y and z + * (their value will be set to the default, and omitted in proto text + * output): + * + * + * f { + * a : 22 + * b { + * d : 1 + * } + * } + * + * A repeated field is not allowed except at the last position of a + * paths string. + * + * If a FieldMask object is not present in a get operation, the + * operation applies to all fields (as if a FieldMask of all fields + * had been specified). + * + * Note that a field mask does not necessarily apply to the + * top-level response message. In case of a REST get operation, the + * field mask applies directly to the response, but in case of a REST + * list operation, the mask instead applies to each individual message + * in the returned resource list. In case of a REST custom method, + * other definitions may be used. Where the mask applies will be + * clearly documented together with its declaration in the API. In + * any case, the effect on the returned resource/resources is required + * behavior for APIs. + * + * # Field Masks in Update Operations + * + * A field mask in update operations specifies which fields of the + * targeted resource are going to be updated. The API is required + * to only change the values of the fields as specified in the mask + * and leave the others untouched. If a resource is passed in to + * describe the updated values, the API ignores the values of all + * fields not covered by the mask. + * + * If a repeated field is specified for an update operation, new values will + * be appended to the existing repeated field in the target resource. Note that + * a repeated field is only allowed in the last position of a `paths` string. + * + * If a sub-message is specified in the last position of the field mask for an + * update operation, then new value will be merged into the existing sub-message + * in the target resource. + * + * For example, given the target message: + * + * f { + * b { + * d: 1 + * x: 2 + * } + * c: [1] + * } + * + * And an update message: + * + * f { + * b { + * d: 10 + * } + * c: [2] + * } + * + * then if the field mask is: + * + * paths: ["f.b", "f.c"] + * + * then the result will be: + * + * f { + * b { + * d: 10 + * x: 2 + * } + * c: [1, 2] + * } + * + * An implementation may provide options to override this default behavior for + * repeated and message fields. + * + * In order to reset a field's value to the default, the field must + * be in the mask and set to the default value in the provided resource. + * Hence, in order to reset all fields of a resource, provide a default + * instance of the resource and set all fields in the mask, or do + * not provide a mask as described below. + * + * If a field mask is not present on update, the operation applies to + * all fields (as if a field mask of all fields has been specified). + * Note that in the presence of schema evolution, this may mean that + * fields the client does not know and has therefore not filled into + * the request will be reset to their default. If this is unwanted + * behavior, a specific service may require a client to always specify + * a field mask, producing an error if not. + * + * As with get operations, the location of the resource which + * describes the updated values in the request message depends on the + * operation kind. In any case, the effect of the field mask is + * required to be honored by the API. + * + * ## Considerations for HTTP REST + * + * The HTTP kind of an update operation which uses a field mask must + * be set to PATCH instead of PUT in order to satisfy HTTP semantics + * (PUT must only be used for full updates). + * + * # JSON Encoding of Field Masks + * + * In JSON, a field mask is encoded as a single string where paths are + * separated by a comma. Fields name in each path are converted + * to/from lower-camel naming conventions. + * + * As an example, consider the following message declarations: + * + * message Profile { + * User user = 1; + * Photo photo = 2; + * } + * message User { + * string display_name = 1; + * string address = 2; + * } + * + * In proto a field mask for `Profile` may look as such: + * + * mask { + * paths: "user.display_name" + * paths: "photo" + * } + * + * In JSON, the same mask is represented as below: + * + * { + * mask: "user.displayName,photo" + * } + * + * # Field Masks and Oneof Fields + * + * Field masks treat fields in oneofs just as regular fields. Consider the + * following message: + * + * message SampleMessage { + * oneof test_oneof { + * string name = 4; + * SubMessage sub_message = 9; + * } + * } + * + * The field mask can be: + * + * mask { + * paths: "name" + * } + * + * Or: + * + * mask { + * paths: "sub_message" + * } + * + * Note that oneof type names ("test_oneof" in this case) cannot be used in + * paths. + * + * ## Field Mask Verification + * + * The implementation of any API method which has a FieldMask type field in the + * request should verify the included field paths, and return an + * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. + * + * @property {string[]} paths + * The set of field mask paths. + * + * @typedef FieldMask + * @memberof google.protobuf + * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} + */ +const FieldMask = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js index 09118ba9d8e..6b2bb5b3355 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js @@ -128,9 +128,23 @@ class RecaptchaEnterpriseServiceV1Beta1Client { assessmentPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/assessments/{assessment}' ), + keyPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/keys/{key}' + ), projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), }; + // 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 = { + listKeys: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'keys' + ), + }; + // Put together the default options sent with requests. const defaults = gaxGrpc.constructSettings( 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1', @@ -161,6 +175,11 @@ class RecaptchaEnterpriseServiceV1Beta1Client { const recaptchaEnterpriseServiceV1Beta1StubMethods = [ 'createAssessment', 'annotateAssessment', + 'createKey', + 'listKeys', + 'getKey', + 'updateKey', + 'deleteKey', ]; for (const methodName of recaptchaEnterpriseServiceV1Beta1StubMethods) { const innerCallPromise = recaptchaEnterpriseServiceV1Beta1Stub.then( @@ -174,7 +193,7 @@ class RecaptchaEnterpriseServiceV1Beta1Client { this._innerApiCalls[methodName] = gaxModule.createApiCall( innerCallPromise, defaults[methodName], - null + this._descriptors.page[methodName] ); } } @@ -351,6 +370,392 @@ class RecaptchaEnterpriseServiceV1Beta1Client { return this._innerApiCalls.annotateAssessment(request, options, callback); } + /** + * Creates a new reCAPTCHA Enterprise key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the key will be created, in the + * format "projects/{project_number}". + * @param {Object} request.key + * Required. Information to create a reCAPTCHA Enterprise key. + * + * This object should have the same structure as [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const recaptchaenterprise = require('@google-cloud/recaptchaenterprise'); + * + * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.projectPath('[PROJECT]'); + * const key = {}; + * const request = { + * parent: formattedParent, + * key: key, + * }; + * client.createKey(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + createKey(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + 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, + }); + + return this._innerApiCalls.createKey(request, options, callback); + } + + /** + * Returns the list of all keys that belong to a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project that contains the keys that will be + * listed, in the format "projects/{project_number}". + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const recaptchaenterprise = require('@google-cloud/recaptchaenterprise'); + * + * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.projectPath('[PROJECT]'); + * + * client.listKeys({parent: formattedParent}) + * .then(responses => { + * const resources = responses[0]; + * for (const resource of resources) { + * // doThingsWith(resource) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.projectPath('[PROJECT]'); + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (const resource of resources) { + * // doThingsWith(resource); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.listKeys(nextRequest, options).then(callback); + * } + * } + * client.listKeys({parent: formattedParent}, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + listKeys(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + 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, + }); + + return this._innerApiCalls.listKeys(request, options, callback); + } + + /** + * Equivalent to {@link listKeys}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listKeys} 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 name of the project that contains the keys that will be + * listed, in the format "projects/{project_number}". + * @param {number} [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @returns {Stream} + * An object stream which emits an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} on 'data' event. + * + * @example + * + * const recaptchaenterprise = require('@google-cloud/recaptchaenterprise'); + * + * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.projectPath('[PROJECT]'); + * client.listKeysStream({parent: formattedParent}) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + listKeysStream(request, options) { + options = options || {}; + + return this._descriptors.page.listKeys.createStream( + this._innerApiCalls.listKeys, + request, + options + ); + } + + /** + * Returns the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the requested key, in the format + * "projects/{project_number}/keys/{key_id}". + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const recaptchaenterprise = require('@google-cloud/recaptchaenterprise'); + * + * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + * // optional auth parameters. + * }); + * + * const formattedName = client.keyPath('[PROJECT]', '[KEY]'); + * client.getKey({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getKey(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + 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, + }); + + return this._innerApiCalls.getKey(request, options, callback); + } + + /** + * Updates the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {Object} request.key + * Required. The key to update. + * + * This object should have the same structure as [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} + * @param {Object} [request.updateMask] + * Optional. The mask to control which field of the key get updated. If the mask is not + * present, all fields will be updated. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const recaptchaenterprise = require('@google-cloud/recaptchaenterprise'); + * + * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + * // optional auth parameters. + * }); + * + * const key = {}; + * client.updateKey({key: key}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + updateKey(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'key.name': request.key.name, + }); + + return this._innerApiCalls.updateKey(request, options, callback); + } + + /** + * Deletes the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the key to be deleted, in the format + * "projects/{project_number}/keys/{key_id}". + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error)} [callback] + * The function which will be called with the result of the API call. + * @returns {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const recaptchaenterprise = require('@google-cloud/recaptchaenterprise'); + * + * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + * // optional auth parameters. + * }); + * + * const formattedName = client.keyPath('[PROJECT]', '[KEY]'); + * client.deleteKey({name: formattedName}).catch(err => { + * console.error(err); + * }); + */ + deleteKey(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + 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, + }); + + return this._innerApiCalls.deleteKey(request, options, callback); + } + // -------------------- // -- Path templates -- // -------------------- @@ -369,6 +774,20 @@ class RecaptchaEnterpriseServiceV1Beta1Client { }); } + /** + * Return a fully-qualified key resource name string. + * + * @param {String} project + * @param {String} key + * @returns {String} + */ + keyPath(project, key) { + return this._pathTemplates.keyPathTemplate.render({ + project: project, + key: key, + }); + } + /** * Return a fully-qualified project resource name string. * @@ -405,6 +824,28 @@ class RecaptchaEnterpriseServiceV1Beta1Client { .assessment; } + /** + * Parse the keyName from a key resource. + * + * @param {String} keyName + * A fully-qualified path representing a key resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromKeyName(keyName) { + return this._pathTemplates.keyPathTemplate.match(keyName).project; + } + + /** + * Parse the keyName from a key resource. + * + * @param {String} keyName + * A fully-qualified path representing a key resources. + * @returns {String} - A string representing the key. + */ + matchKeyFromKeyName(keyName) { + return this._pathTemplates.keyPathTemplate.match(keyName).key; + } + /** * Parse the projectName from a project resource. * diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json index 0c189d6150b..3aa1afa8820 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json @@ -29,6 +29,31 @@ "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "CreateKey": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListKeys": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetKey": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateKey": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteKey": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index fcf2e002051..2f9c2670369 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-11-19T12:24:42.593913Z", + "updateTime": "2019-12-03T12:19:56.567157Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d8dd7fe8d5304f7bd1c52207703d7f27d5328c5a", - "internalRef": "281088257" + "sha": "38dc36a2a43cbab4a2a9183a43dd0441670098a9", + "internalRef": "283384331" } }, { diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js b/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js index 9ff1a38f540..7d5edb66232 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js +++ b/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js @@ -191,6 +191,324 @@ describe('RecaptchaEnterpriseServiceV1Beta1Client', () => { }); }); }); + + describe('createKey', () => { + it('invokes createKey without error', done => { + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + + // Mock request + const formattedParent = client.projectPath('[PROJECT]'); + const key = {}; + const request = { + parent: formattedParent, + key: key, + }; + + // Mock response + const name = 'name3373707'; + const displayName = 'displayName1615086568'; + const expectedResponse = { + name: name, + displayName: displayName, + }; + + // Mock Grpc layer + client._innerApiCalls.createKey = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.createKey(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createKey with error', done => { + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + + // Mock request + const formattedParent = client.projectPath('[PROJECT]'); + const key = {}; + const request = { + parent: formattedParent, + key: key, + }; + + // Mock Grpc layer + client._innerApiCalls.createKey = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.createKey(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('listKeys', () => { + it('invokes listKeys without error', done => { + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + + // Mock request + const formattedParent = client.projectPath('[PROJECT]'); + const request = { + parent: formattedParent, + }; + + // Mock response + const nextPageToken = ''; + const keysElement = {}; + const keys = [keysElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + keys: keys, + }; + + // Mock Grpc layer + client._innerApiCalls.listKeys = (actualRequest, options, callback) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.keys); + }; + + client.listKeys(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse.keys); + done(); + }); + }); + + it('invokes listKeys with error', done => { + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + + // Mock request + const formattedParent = client.projectPath('[PROJECT]'); + const request = { + parent: formattedParent, + }; + + // Mock Grpc layer + client._innerApiCalls.listKeys = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.listKeys(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('getKey', () => { + it('invokes getKey without error', done => { + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + + // Mock request + const formattedName = client.keyPath('[PROJECT]', '[KEY]'); + const request = { + name: formattedName, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const displayName = 'displayName1615086568'; + const expectedResponse = { + name: name2, + displayName: displayName, + }; + + // Mock Grpc layer + client._innerApiCalls.getKey = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getKey(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getKey with error', done => { + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + + // Mock request + const formattedName = client.keyPath('[PROJECT]', '[KEY]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.getKey = mockSimpleGrpcMethod(request, null, error); + + client.getKey(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('updateKey', () => { + it('invokes updateKey without error', done => { + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + + // Mock request + const key = {}; + const request = { + key: key, + }; + + // Mock response + const name = 'name3373707'; + const displayName = 'displayName1615086568'; + const expectedResponse = { + name: name, + displayName: displayName, + }; + + // Mock Grpc layer + client._innerApiCalls.updateKey = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.updateKey(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateKey with error', done => { + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + + // Mock request + const key = {}; + const request = { + key: key, + }; + + // Mock Grpc layer + client._innerApiCalls.updateKey = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.updateKey(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('deleteKey', () => { + it('invokes deleteKey without error', done => { + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + + // Mock request + const formattedName = client.keyPath('[PROJECT]', '[KEY]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteKey = mockSimpleGrpcMethod(request); + + client.deleteKey(request, err => { + assert.ifError(err); + done(); + }); + }); + + it('invokes deleteKey with error', done => { + const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + + // Mock request + const formattedName = client.keyPath('[PROJECT]', '[KEY]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteKey = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.deleteKey(request, err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); }); function mockSimpleGrpcMethod(expectedRequest, response, error) { From ddff48cd50fbafbea256db9105f90d8a1987c8fb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2019 11:35:41 -0800 Subject: [PATCH 057/253] chore: release 1.4.0 (#79) --- .../google-cloud-recaptchaenterprise/CHANGELOG.md | 15 +++++++++++++++ .../google-cloud-recaptchaenterprise/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index f4d0f02bd2a..50eb3fdf65c 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,21 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [1.4.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.3.1...v1.4.0) (2019-12-10) + + +### Features + +* add crud support for keys ([#84](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/84)) ([adfc3f9](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/adfc3f954f79110ad73425e2da9381fa6c02152d)) +* add plural and singular resource descriptor ([#78](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/78)) ([a67ffa7](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/a67ffa751551f4d6346c806e82b2311030b7ab61)) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([0e96508](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/0e965087f253c8474143051c06a955d2797cbcf4)) +* **docs:** bump the release level to beta ([#76](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/76)) ([8a2e2c0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/8a2e2c005d5d73a57cff2056cc212736610060a6)) +* **docs:** snippets are now replaced in jsdoc comments ([#74](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/74)) ([b3c31fc](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/b3c31fced63701a8e70b5f0ce3373466626ee960)) + ### [1.3.1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.3.0...v1.3.1) (2019-10-22) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 042382f8c0d..3f9efc38a85 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.3.1", + "version": "1.4.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index bf6c157af97..a68f0a56750 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.3.1" + "@google-cloud/recaptcha-enterprise": "^1.4.0" }, "devDependencies": { "chai": "^4.2.0", From fdbf238726448e0b7ffc8d27745fbcb476e7fbd8 Mon Sep 17 00:00:00 2001 From: Xiaozhen Liu Date: Fri, 20 Dec 2019 17:06:05 -0800 Subject: [PATCH 058/253] feat: move to typescript code generation (#87) * move code to typescript * run synthtool * fix test * add index.ts to src * lint --- .../.jsdoc.js | 2 +- .../package.json | 43 +- .../google/cloud/common_resources.proto | 52 + .../src/index.js | 82 -- .../src/index.ts | 25 + .../v1beta1/doc_recaptchaenterprise.js | 550 --------- .../v1beta1/doc/google/protobuf/doc_empty.js | 34 - .../doc/google/protobuf/doc_field_mask.js | 228 ---- .../doc/google/protobuf/doc_timestamp.js | 119 -- .../src/{browser.js => v1beta1/index.ts} | 12 +- ...tcha_enterprise_service_v1_beta1_client.js | 861 -------------- ...tcha_enterprise_service_v1_beta1_client.ts | 1029 +++++++++++++++++ ...rprise_service_v1_beta1_client_config.json | 28 +- .../synth.metadata | 323 +++++- .../google-cloud-recaptchaenterprise/synth.py | 19 +- .../system-test/.eslintrc | 3 - .../system-test/.eslintrc.yml | 4 + .../{test.js => fixtures/sample/src/index.js} | 21 +- .../fixtures/sample/src/index.ts} | 12 +- .../system-test/install.ts | 50 + ...cha_enterprise_service_v1_beta1-v1beta1.ts | 452 ++++++++ .../test/gapic-v1beta1.js | 525 --------- .../tsconfig.json | 19 + .../tslint.json | 3 + .../webpack.config.js | 38 +- 25 files changed, 2055 insertions(+), 2479 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/protos/google/cloud/common_resources.proto delete mode 100644 packages/google-cloud-recaptchaenterprise/src/index.js create mode 100644 packages/google-cloud-recaptchaenterprise/src/index.ts delete mode 100644 packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/cloud/recaptchaenterprise/v1beta1/doc_recaptchaenterprise.js delete mode 100644 packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_empty.js delete mode 100644 packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_field_mask.js delete mode 100644 packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_timestamp.js rename packages/google-cloud-recaptchaenterprise/src/{browser.js => v1beta1/index.ts} (65%) delete mode 100644 packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js create mode 100644 packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts delete mode 100644 packages/google-cloud-recaptchaenterprise/system-test/.eslintrc create mode 100644 packages/google-cloud-recaptchaenterprise/system-test/.eslintrc.yml rename packages/google-cloud-recaptchaenterprise/system-test/{test.js => fixtures/sample/src/index.js} (50%) rename packages/google-cloud-recaptchaenterprise/{src/v1beta1/index.js => system-test/fixtures/sample/src/index.ts} (58%) create mode 100644 packages/google-cloud-recaptchaenterprise/system-test/install.ts create mode 100644 packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts delete mode 100644 packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js create mode 100644 packages/google-cloud-recaptchaenterprise/tsconfig.json create mode 100644 packages/google-cloud-recaptchaenterprise/tslint.json diff --git a/packages/google-cloud-recaptchaenterprise/.jsdoc.js b/packages/google-cloud-recaptchaenterprise/.jsdoc.js index 51be5a4f396..78c206f407a 100644 --- a/packages/google-cloud-recaptchaenterprise/.jsdoc.js +++ b/packages/google-cloud-recaptchaenterprise/.jsdoc.js @@ -32,7 +32,7 @@ module.exports = { source: { excludePattern: '(^|\\/|\\\\)[._]', include: [ - 'src' + 'build/src' ], includePattern: '\\.js$' }, diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 3f9efc38a85..bfbe7ec85de 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -4,10 +4,10 @@ "version": "1.4.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", - "main": "src/index.js", + "main": "build/src/index.js", "files": [ - "protos", - "src", + "build/protos", + "build/src", "AUTHORS", "COPYING" ], @@ -25,32 +25,45 @@ "reCAPTCHA Enterprise API" ], "dependencies": { - "google-gax": "^1.7.5" + "google-gax": "^1.9.0" }, "devDependencies": { + "@types/mocha": "^5.2.5", + "@types/node": "^12.0.0", + "c8": "^6.0.0", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^10.0.0", "eslint-plugin-prettier": "^3.0.0", + "gts": "^1.0.0", + "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", - "mocha": "^6.0.0", - "nyc": "^14.1.1", - "prettier": "^1.17.1" + "mocha": "^6.1.4", + "null-loader": "^3.0.0", + "pack-n-play": "^1.0.0-2", + "power-assert": "^1.4.4", + "prettier": "^1.17.1", + "ts-loader": "^6.2.1", + "typescript": "^3.7.0", + "webpack": "^4.41.2", + "webpack-cli": "^3.3.10" }, "scripts": { - "cover": "nyc --reporter=lcov mocha test/*.js && nyc report", + "lint": "gts fix && eslint --fix samples/*.js", + "fix": "gts fix", + "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", + "system-test": "mocha build/system-test", "docs": "jsdoc -c .jsdoc.js", - "lint": "eslint '**/*.js'", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "mocha system-test/*.js --timeout 600000", - "test-no-cover": "mocha test/*.js", - "test": "npm run cover", - "fix": "eslint --fix '**/*.js'", + "test": "c8 mocha build/test", "docs-test": "linkinator docs", - "predocs-test": "npm run docs" + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "predocs-test": "npm run docs", + "prepare": "npm run compile" }, "license": "Apache-2.0", "engines": { diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/common_resources.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000000..56c9f800d5e --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/src/index.js b/packages/google-cloud-recaptchaenterprise/src/index.js deleted file mode 100644 index 41b6dd01099..00000000000 --- a/packages/google-cloud-recaptchaenterprise/src/index.js +++ /dev/null @@ -1,82 +0,0 @@ -// 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 -// -// 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. - -/** - * @namespace google - */ -/** - * @namespace google.cloud - */ -/** - * @namespace google.protobuf - */ -/** - * @namespace google.cloud.recaptchaenterprise - */ -/** - * @namespace google.cloud.recaptchaenterprise.v1beta1 - */ - -'use strict'; - -// Import the clients for each version supported by this package. -const gapic = Object.freeze({ - v1beta1: require('./v1beta1'), -}); - -/** - * The `recaptchaenterprise` package has the following named exports: - * - * - `RecaptchaEnterpriseServiceV1Beta1Client` - Reference to - * {@link v1beta1.RecaptchaEnterpriseServiceV1Beta1Client} - * - `v1beta1` - This is used for selecting or pinning a - * particular backend service version. It exports: - * - `RecaptchaEnterpriseServiceV1Beta1Client` - Reference to - * {@link v1beta1.RecaptchaEnterpriseServiceV1Beta1Client} - * - * @module {object} recaptchaenterprise - * @alias nodejs-recaptchaenterprise - * - * @example Install the client library with npm: - * npm install --save recaptchaenterprise - * - * @example Import the client library: - * const recaptchaenterprise = require('recaptchaenterprise'); - * - * @example Create a client that uses Application Default Credentials (ADC): - * const client = new recaptchaenterprise.RecaptchaEnterpriseServiceV1Beta1Client(); - * - * @example Create a client with explicit credentials: - * const client = new recaptchaenterprise.RecaptchaEnterpriseServiceV1Beta1Client({ - * projectId: 'your-project-id', - * keyFilename: '/path/to/keyfile.json', - * }); - */ - -/** - * @type {object} - * @property {constructor} RecaptchaEnterpriseServiceV1Beta1Client - * Reference to {@link v1beta1.RecaptchaEnterpriseServiceV1Beta1Client} - */ -module.exports = gapic.v1beta1; - -/** - * @type {object} - * @property {constructor} RecaptchaEnterpriseServiceV1Beta1Client - * Reference to {@link v1beta1.RecaptchaEnterpriseServiceV1Beta1Client} - */ -module.exports.v1beta1 = gapic.v1beta1; - -// Alias `module.exports` as `module.exports.default`, for future-proofing. -module.exports.default = Object.assign({}, module.exports); diff --git a/packages/google-cloud-recaptchaenterprise/src/index.ts b/packages/google-cloud-recaptchaenterprise/src/index.ts new file mode 100644 index 00000000000..6ef81cfdc58 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/index.ts @@ -0,0 +1,25 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta1 from './v1beta1'; +const RecaptchaEnterpriseServiceV1Beta1Client = + v1beta1.RecaptchaEnterpriseServiceV1Beta1Client; +export {v1beta1, RecaptchaEnterpriseServiceV1Beta1Client}; +// For compatibility with JavaScript libraries we need to provide this default export: +// tslint:disable-next-line no-default-export +export default {v1beta1, RecaptchaEnterpriseServiceV1Beta1Client}; diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/cloud/recaptchaenterprise/v1beta1/doc_recaptchaenterprise.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/cloud/recaptchaenterprise/v1beta1/doc_recaptchaenterprise.js deleted file mode 100644 index d91ccbb02da..00000000000 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/cloud/recaptchaenterprise/v1beta1/doc_recaptchaenterprise.js +++ /dev/null @@ -1,550 +0,0 @@ -// 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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The create assessment request message. - * - * @property {string} parent - * Required. The name of the project in which the assessment will be created, - * in the format "projects/{project_number}". - * - * @property {Object} assessment - * Required. The assessment details. - * - * This object should have the same structure as [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment} - * - * @typedef CreateAssessmentRequest - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @see [google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} - */ -const CreateAssessmentRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The request message to annotate an Assessment. - * - * @property {string} name - * Required. The resource name of the Assessment, in the format - * "projects/{project_number}/assessments/{assessment_id}". - * - * @property {number} annotation - * Required. The annotation that will be assigned to the Event. - * - * The number should be among the values of [Annotation]{@link google.cloud.recaptchaenterprise.v1beta1.Annotation} - * - * @typedef AnnotateAssessmentRequest - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @see [google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} - */ -const AnnotateAssessmentRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Enum that reprensents the types of annotations. - * - * @enum {number} - * @memberof google.cloud.recaptchaenterprise.v1beta1 - */ - Annotation: { - - /** - * Default unspecified type. - */ - ANNOTATION_UNSPECIFIED: 0, - - /** - * Provides information that the event turned out to be legitimate. - */ - LEGITIMATE: 1, - - /** - * Provides information that the event turned out to be fraudulent. - */ - FRAUDULENT: 2 - } -}; - -/** - * Empty response for AnnotateAssessment. - * @typedef AnnotateAssessmentResponse - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @see [google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} - */ -const AnnotateAssessmentResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A recaptcha assessment resource. - * - * @property {string} name - * Output only. The resource name for the Assessment in the format - * "projects/{project_number}/assessments/{assessment_id}". - * - * @property {Object} event - * The event being assessed. - * - * This object should have the same structure as [Event]{@link google.cloud.recaptchaenterprise.v1beta1.Event} - * - * @property {number} score - * Output only. Legitimate event score from 0.0 to 1.0. - * (1.0 means very likely legitimate traffic while 0.0 means very likely - * non-legitimate traffic). - * - * @property {Object} tokenProperties - * Output only. Properties of the provided event token. - * - * This object should have the same structure as [TokenProperties]{@link google.cloud.recaptchaenterprise.v1beta1.TokenProperties} - * - * @property {number[]} reasons - * Output only. Reasons contributing to the risk analysis verdict. - * - * The number should be among the values of [ClassificationReason]{@link google.cloud.recaptchaenterprise.v1beta1.ClassificationReason} - * - * @typedef Assessment - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @see [google.cloud.recaptchaenterprise.v1beta1.Assessment definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} - */ -const Assessment = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * LINT.IfChange(classification_reason) - * Reasons contributing to the risk analysis verdict. - * - * @enum {number} - * @memberof google.cloud.recaptchaenterprise.v1beta1 - */ - ClassificationReason: { - - /** - * Default unspecified type. - */ - CLASSIFICATION_REASON_UNSPECIFIED: 0, - - /** - * Interactions matched the behavior of an automated agent. - */ - AUTOMATION: 1, - - /** - * The event originated from an illegitimate environment. - */ - UNEXPECTED_ENVIRONMENT: 2, - - /** - * Traffic volume from the event source is higher than normal. - */ - TOO_MUCH_TRAFFIC: 3, - - /** - * Interactions with the site were significantly different than expected - * patterns. - */ - UNEXPECTED_USAGE_PATTERNS: 4, - - /** - * Too little traffic has been received from this site thus far to generate - * quality risk analysis. - */ - LOW_CONFIDENCE_SCORE: 5 - } -}; - -/** - * @property {string} token - * Optional. The user response token provided by the reCAPTCHA client-side integration - * on your site. - * - * @property {string} siteKey - * Optional. The site key that was used to invoke reCAPTCHA on your site and generate - * the token. - * - * @property {string} userAgent - * Optional. The user agent present in the request from the user's device related to - * this event. - * - * @property {string} userIpAddress - * Optional. The IP address in the request from the user's device related to this event. - * - * @property {string} expectedAction - * Optional. The expected action for this type of event. This should be the same action - * provided at token generation time on client-side platforms already - * integrated with recaptcha enterprise. - * - * @typedef Event - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @see [google.cloud.recaptchaenterprise.v1beta1.Event definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} - */ -const Event = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * @property {boolean} valid - * Whether the provided user response token is valid. - * - * @property {number} invalidReason - * Reason associated with the response when valid = false. - * - * The number should be among the values of [InvalidReason]{@link google.cloud.recaptchaenterprise.v1beta1.InvalidReason} - * - * @property {Object} createTime - * The timestamp corresponding to the generation of the token. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} hostname - * The hostname of the page on which the token was generated. - * - * @property {string} action - * Action name provided at token generation. - * - * @typedef TokenProperties - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @see [google.cloud.recaptchaenterprise.v1beta1.TokenProperties definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} - */ -const TokenProperties = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * LINT.IfChange - * Enum that represents the types of invalid token reasons. - * - * @enum {number} - * @memberof google.cloud.recaptchaenterprise.v1beta1 - */ - InvalidReason: { - - /** - * Default unspecified type. - */ - INVALID_REASON_UNSPECIFIED: 0, - - /** - * If the failure reason was not accounted for. - */ - UNKNOWN_INVALID_REASON: 1, - - /** - * The provided user verification token was malformed. - */ - MALFORMED: 2, - - /** - * The user verification token had expired. - */ - EXPIRED: 3, - - /** - * The user verification had already been seen. - */ - DUPE: 4, - - /** - * The user verification token did not match the provided site key. - * This may be a configuration error (e.g. development keys used in - * production) or end users trying to use verification tokens from other - * sites. - */ - SITE_MISMATCH: 5, - - /** - * The user verification token was not present. It is a required input. - */ - MISSING: 6 - } -}; - -/** - * The create key request message. - * - * @property {string} parent - * Required. The name of the project in which the key will be created, in the - * format "projects/{project_number}". - * - * @property {Object} key - * Required. Information to create a reCAPTCHA Enterprise key. - * - * This object should have the same structure as [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} - * - * @typedef CreateKeyRequest - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @see [google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} - */ -const CreateKeyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The list keys request message. - * - * @property {string} parent - * Required. The name of the project that contains the keys that will be - * listed, in the format "projects/{project_number}". - * - * @property {number} pageSize - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * - * @property {string} pageToken - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * - * @typedef ListKeysRequest - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @see [google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} - */ -const ListKeysRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response to request to list keys in a project. - * - * @property {Object[]} keys - * Key details. - * - * This object should have the same structure as [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} - * - * @property {string} nextPageToken - * Token to retrieve the next page of results. It is set to empty if no keys - * remain in results. - * - * @typedef ListKeysResponse - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @see [google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} - */ -const ListKeysResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The get key request message. - * - * @property {string} name - * Required. The name of the requested key, in the format - * "projects/{project_number}/keys/{key_id}". - * - * @typedef GetKeyRequest - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @see [google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} - */ -const GetKeyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The update key request message. - * - * @property {Object} key - * Required. The key to update. - * - * This object should have the same structure as [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} - * - * @property {Object} updateMask - * Optional. The mask to control which field of the key get updated. If the mask is not - * present, all fields will be updated. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateKeyRequest - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @see [google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} - */ -const UpdateKeyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The delete key request message. - * - * @property {string} name - * Required. The name of the key to be deleted, in the format - * "projects/{project_number}/keys/{key_id}". - * - * @typedef DeleteKeyRequest - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @see [google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} - */ -const DeleteKeyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A key used to identify and configure applications (web and/or mobile) that - * use reCAPTCHA Enterprise. - * - * @property {string} name - * The resource name for the Key in the format - * "projects/{project_number}/keys/{key_id}". - * - * @property {string} displayName - * Human-readable display name of this key. Modifiable by user. - * - * @property {Object} webSettings - * Settings for keys that can be used by websites. - * - * This object should have the same structure as [WebKeySettings]{@link google.cloud.recaptchaenterprise.v1beta1.WebKeySettings} - * - * @property {Object} androidSettings - * Settings for keys that can be used by Android apps. - * - * This object should have the same structure as [AndroidKeySettings]{@link google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings} - * - * @property {Object} iosSettings - * Settings for keys that can be used by iOS apps. - * - * This object should have the same structure as [IOSKeySettings]{@link google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings} - * - * @typedef Key - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @see [google.cloud.recaptchaenterprise.v1beta1.Key definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} - */ -const Key = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Settings specific to keys that can be used by websites. - * - * @property {boolean} enforceAllowedDomains - * Whether allowed_domains is enforced or not. - * - * @property {string[]} allowedDomains - * Domains or subdomains of websites allowed to use the key. All subdomains - * of an allowed domain are automatically allowed. A valid domain requires a - * host and must not include any path, port, query or fragment. - * Examples: 'example.com' or 'subdomain.example.com' - * - * @property {boolean} allowAmpTraffic - * Whether this key can be used on AMP (Accelerated Mobile Pages) websites. - * - * @property {number} integrationType - * Required. Describes how this key is integrated with the website. - * - * The number should be among the values of [IntegrationType]{@link google.cloud.recaptchaenterprise.v1beta1.IntegrationType} - * - * @property {number} challengeSecurityPreference - * Settings for the frequency and difficulty at which this key triggers - * captcha challenges. This should only be specified for IntegrationTypes - * CHECKBOX_CHALLENGE and INVISIBLE_CHALLENGE. - * - * The number should be among the values of [ChallengeSecurityPreference]{@link google.cloud.recaptchaenterprise.v1beta1.ChallengeSecurityPreference} - * - * @typedef WebKeySettings - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @see [google.cloud.recaptchaenterprise.v1beta1.WebKeySettings definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} - */ -const WebKeySettings = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Enum that represents the possible challenge frequency and difficulty - * configurations for a web key. - * - * @enum {number} - * @memberof google.cloud.recaptchaenterprise.v1beta1 - */ - ChallengeSecurityPreference: { - - /** - * Default type that indicates this enum hasn't been specified. - */ - CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED: 0, - - /** - * Key tends to show fewer and easier challenges. - */ - USABILITY: 1, - - /** - * Key tends to show balanced (in amount and difficulty) challenges. - */ - BALANCED: 2, - - /** - * Key tends to show more and harder challenges. - */ - SECURITY: 3 - }, - - /** - * Enum that represents the integration types for web keys. - * - * @enum {number} - * @memberof google.cloud.recaptchaenterprise.v1beta1 - */ - IntegrationType: { - - /** - * Default type that indicates this enum hasn't been specified. This is not - * a valid IntegrationType, one of the other types must be specified - * instead. - */ - INTEGRATION_TYPE_UNSPECIFIED: 0, - - /** - * Only used to produce scores. It doesn't display the "I'm not a robot" - * checkbox and never shows captcha challenges. - */ - SCORE_ONLY: 1, - - /** - * Displays the "I'm not a robot" checkbox and may show captcha challenges - * after it is checked. - */ - CHECKBOX_CHALLENGE: 2, - - /** - * Doesn't display the "I'm not a robot" checkbox, but may show captcha - * challenges after risk analysis. - */ - INVISIBLE_CHALLENGE: 3 - } -}; - -/** - * Settings specific to keys that can be used by Android apps. - * - * @property {string[]} allowedPackageNames - * Android package names of apps allowed to use the key. - * Example: 'com.companyname.appname' - * - * @typedef AndroidKeySettings - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @see [google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} - */ -const AndroidKeySettings = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Settings specific to keys that can be used by iOS apps. - * - * @property {string[]} allowedBundleIds - * iOS bundle ids of apps allowed to use the key. - * Example: 'com.companyname.productname.appname' - * - * @typedef IOSKeySettings - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @see [google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto} - */ -const IOSKeySettings = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_empty.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_empty.js deleted file mode 100644 index 0b446dd9ce4..00000000000 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_empty.js +++ /dev/null @@ -1,34 +0,0 @@ -// 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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request - * or the response type of an API method. For instance: - * - * service Foo { - * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - * } - * - * The JSON representation for `Empty` is empty JSON object `{}`. - * @typedef Empty - * @memberof google.protobuf - * @see [google.protobuf.Empty definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/empty.proto} - */ -const Empty = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_field_mask.js deleted file mode 100644 index 011207b8626..00000000000 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_field_mask.js +++ /dev/null @@ -1,228 +0,0 @@ -// 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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `FieldMask` represents a set of symbolic field paths, for example: - * - * paths: "f.a" - * paths: "f.b.d" - * - * Here `f` represents a field in some root message, `a` and `b` - * fields in the message found in `f`, and `d` a field found in the - * message in `f.b`. - * - * Field masks are used to specify a subset of fields that should be - * returned by a get operation or modified by an update operation. - * Field masks also have a custom JSON encoding (see below). - * - * # Field Masks in Projections - * - * When used in the context of a projection, a response message or - * sub-message is filtered by the API to only contain those fields as - * specified in the mask. For example, if the mask in the previous - * example is applied to a response message as follows: - * - * f { - * a : 22 - * b { - * d : 1 - * x : 2 - * } - * y : 13 - * } - * z: 8 - * - * The result will not contain specific values for fields x,y and z - * (their value will be set to the default, and omitted in proto text - * output): - * - * - * f { - * a : 22 - * b { - * d : 1 - * } - * } - * - * A repeated field is not allowed except at the last position of a - * paths string. - * - * If a FieldMask object is not present in a get operation, the - * operation applies to all fields (as if a FieldMask of all fields - * had been specified). - * - * Note that a field mask does not necessarily apply to the - * top-level response message. In case of a REST get operation, the - * field mask applies directly to the response, but in case of a REST - * list operation, the mask instead applies to each individual message - * in the returned resource list. In case of a REST custom method, - * other definitions may be used. Where the mask applies will be - * clearly documented together with its declaration in the API. In - * any case, the effect on the returned resource/resources is required - * behavior for APIs. - * - * # Field Masks in Update Operations - * - * A field mask in update operations specifies which fields of the - * targeted resource are going to be updated. The API is required - * to only change the values of the fields as specified in the mask - * and leave the others untouched. If a resource is passed in to - * describe the updated values, the API ignores the values of all - * fields not covered by the mask. - * - * If a repeated field is specified for an update operation, new values will - * be appended to the existing repeated field in the target resource. Note that - * a repeated field is only allowed in the last position of a `paths` string. - * - * If a sub-message is specified in the last position of the field mask for an - * update operation, then new value will be merged into the existing sub-message - * in the target resource. - * - * For example, given the target message: - * - * f { - * b { - * d: 1 - * x: 2 - * } - * c: [1] - * } - * - * And an update message: - * - * f { - * b { - * d: 10 - * } - * c: [2] - * } - * - * then if the field mask is: - * - * paths: ["f.b", "f.c"] - * - * then the result will be: - * - * f { - * b { - * d: 10 - * x: 2 - * } - * c: [1, 2] - * } - * - * An implementation may provide options to override this default behavior for - * repeated and message fields. - * - * In order to reset a field's value to the default, the field must - * be in the mask and set to the default value in the provided resource. - * Hence, in order to reset all fields of a resource, provide a default - * instance of the resource and set all fields in the mask, or do - * not provide a mask as described below. - * - * If a field mask is not present on update, the operation applies to - * all fields (as if a field mask of all fields has been specified). - * Note that in the presence of schema evolution, this may mean that - * fields the client does not know and has therefore not filled into - * the request will be reset to their default. If this is unwanted - * behavior, a specific service may require a client to always specify - * a field mask, producing an error if not. - * - * As with get operations, the location of the resource which - * describes the updated values in the request message depends on the - * operation kind. In any case, the effect of the field mask is - * required to be honored by the API. - * - * ## Considerations for HTTP REST - * - * The HTTP kind of an update operation which uses a field mask must - * be set to PATCH instead of PUT in order to satisfy HTTP semantics - * (PUT must only be used for full updates). - * - * # JSON Encoding of Field Masks - * - * In JSON, a field mask is encoded as a single string where paths are - * separated by a comma. Fields name in each path are converted - * to/from lower-camel naming conventions. - * - * As an example, consider the following message declarations: - * - * message Profile { - * User user = 1; - * Photo photo = 2; - * } - * message User { - * string display_name = 1; - * string address = 2; - * } - * - * In proto a field mask for `Profile` may look as such: - * - * mask { - * paths: "user.display_name" - * paths: "photo" - * } - * - * In JSON, the same mask is represented as below: - * - * { - * mask: "user.displayName,photo" - * } - * - * # Field Masks and Oneof Fields - * - * Field masks treat fields in oneofs just as regular fields. Consider the - * following message: - * - * message SampleMessage { - * oneof test_oneof { - * string name = 4; - * SubMessage sub_message = 9; - * } - * } - * - * The field mask can be: - * - * mask { - * paths: "name" - * } - * - * Or: - * - * mask { - * paths: "sub_message" - * } - * - * Note that oneof type names ("test_oneof" in this case) cannot be used in - * paths. - * - * ## Field Mask Verification - * - * The implementation of any API method which has a FieldMask type field in the - * request should verify the included field paths, and return an - * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. - * - * @property {string[]} paths - * The set of field mask paths. - * - * @typedef FieldMask - * @memberof google.protobuf - * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} - */ -const FieldMask = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_timestamp.js deleted file mode 100644 index 3bc1e986897..00000000000 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ /dev/null @@ -1,119 +0,0 @@ -// 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 -// -// 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://cloud.google.com - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - * - * @property {number} seconds - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - * - * @property {number} nanos - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - * - * @typedef Timestamp - * @memberof google.protobuf - * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} - */ -const Timestamp = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/src/browser.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/index.ts similarity index 65% rename from packages/google-cloud-recaptchaenterprise/src/browser.js rename to packages/google-cloud-recaptchaenterprise/src/v1beta1/index.ts index ddbcd7ecb9a..879b00358d3 100644 --- a/packages/google-cloud-recaptchaenterprise/src/browser.js +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/index.ts @@ -11,11 +11,9 @@ // WITHOUT 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'; - -// Set a flag that we are running in a browser bundle. -global.isBrowser = true; - -// Re-export all exports from ./index.js. -module.exports = require('./index'); +export {RecaptchaEnterpriseServiceV1Beta1Client} from './recaptcha_enterprise_service_v1_beta1_client'; diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js deleted file mode 100644 index 6b2bb5b3355..00000000000 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js +++ /dev/null @@ -1,861 +0,0 @@ -// 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 -// -// 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 gapicConfig = require('./recaptcha_enterprise_service_v1_beta1_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; - -/** - * Service to determine the likelihood an event is legitimate. - * - * @class - * @memberof v1beta1 - */ -class RecaptchaEnterpriseServiceV1Beta1Client { - /** - * Construct an instance of RecaptchaEnterpriseServiceV1Beta1Client. - * - * @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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - 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. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - 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' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? 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 = { - assessmentPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/assessments/{assessment}' - ), - keyPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/keys/{key}' - ), - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), - }; - - // 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 = { - listKeys: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'keys' - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1', - gapicConfig, - 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 = {}; - - // Put together the "service stub" for - // google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1. - const recaptchaEnterpriseServiceV1Beta1Stub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService( - 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1' - ) - : protos.google.cloud.recaptchaenterprise.v1beta1 - .RecaptchaEnterpriseServiceV1Beta1, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const recaptchaEnterpriseServiceV1Beta1StubMethods = [ - 'createAssessment', - 'annotateAssessment', - 'createKey', - 'listKeys', - 'getKey', - 'updateKey', - 'deleteKey', - ]; - for (const methodName of recaptchaEnterpriseServiceV1Beta1StubMethods) { - const innerCallPromise = recaptchaEnterpriseServiceV1Beta1Stub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'recaptchaenterprise.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'recaptchaenterprise.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']; - } - - /** - * 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) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Creates an Assessment of the likelihood an event is legitimate. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which the assessment will be created, - * in the format "projects/{project_number}". - * @param {Object} request.assessment - * Required. The assessment details. - * - * This object should have the same structure as [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const recaptchaenterprise = require('@google-cloud/recaptchaenterprise'); - * - * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * const assessment = {}; - * const request = { - * parent: formattedParent, - * assessment: assessment, - * }; - * client.createAssessment(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createAssessment(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.createAssessment(request, options, callback); - } - - /** - * Annotates a previously created Assessment to provide additional information - * on whether the event turned out to be authentic or fradulent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Assessment, in the format - * "projects/{project_number}/assessments/{assessment_id}". - * @param {number} request.annotation - * Required. The annotation that will be assigned to the Event. - * - * The number should be among the values of [Annotation]{@link google.cloud.recaptchaenterprise.v1beta1.Annotation} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const recaptchaenterprise = require('@google-cloud/recaptchaenterprise'); - * - * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - * // optional auth parameters. - * }); - * - * const formattedName = client.assessmentPath('[PROJECT]', '[ASSESSMENT]'); - * const annotation = 'ANNOTATION_UNSPECIFIED'; - * const request = { - * name: formattedName, - * annotation: annotation, - * }; - * client.annotateAssessment(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - annotateAssessment(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - 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, - }); - - return this._innerApiCalls.annotateAssessment(request, options, callback); - } - - /** - * Creates a new reCAPTCHA Enterprise key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which the key will be created, in the - * format "projects/{project_number}". - * @param {Object} request.key - * Required. Information to create a reCAPTCHA Enterprise key. - * - * This object should have the same structure as [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const recaptchaenterprise = require('@google-cloud/recaptchaenterprise'); - * - * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * const key = {}; - * const request = { - * parent: formattedParent, - * key: key, - * }; - * client.createKey(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createKey(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.createKey(request, options, callback); - } - - /** - * Returns the list of all keys that belong to a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project that contains the keys that will be - * listed, in the format "projects/{project_number}". - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const recaptchaenterprise = require('@google-cloud/recaptchaenterprise'); - * - * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.projectPath('[PROJECT]'); - * - * client.listKeys({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.projectPath('[PROJECT]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listKeys(nextRequest, options).then(callback); - * } - * } - * client.listKeys({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listKeys(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.listKeys(request, options, callback); - } - - /** - * Equivalent to {@link listKeys}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listKeys} 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 name of the project that contains the keys that will be - * listed, in the format "projects/{project_number}". - * @param {number} [request.pageSize] - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} on 'data' event. - * - * @example - * - * const recaptchaenterprise = require('@google-cloud/recaptchaenterprise'); - * - * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * client.listKeysStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listKeysStream(request, options) { - options = options || {}; - - return this._descriptors.page.listKeys.createStream( - this._innerApiCalls.listKeys, - request, - options - ); - } - - /** - * Returns the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the requested key, in the format - * "projects/{project_number}/keys/{key_id}". - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const recaptchaenterprise = require('@google-cloud/recaptchaenterprise'); - * - * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - * // optional auth parameters. - * }); - * - * const formattedName = client.keyPath('[PROJECT]', '[KEY]'); - * client.getKey({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getKey(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - 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, - }); - - return this._innerApiCalls.getKey(request, options, callback); - } - - /** - * Updates the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.key - * Required. The key to update. - * - * This object should have the same structure as [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} - * @param {Object} [request.updateMask] - * Optional. The mask to control which field of the key get updated. If the mask is not - * present, all fields will be updated. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const recaptchaenterprise = require('@google-cloud/recaptchaenterprise'); - * - * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - * // optional auth parameters. - * }); - * - * const key = {}; - * client.updateKey({key: key}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateKey(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'key.name': request.key.name, - }); - - return this._innerApiCalls.updateKey(request, options, callback); - } - - /** - * Deletes the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the key to be deleted, in the format - * "projects/{project_number}/keys/{key_id}". - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const recaptchaenterprise = require('@google-cloud/recaptchaenterprise'); - * - * const client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - * // optional auth parameters. - * }); - * - * const formattedName = client.keyPath('[PROJECT]', '[KEY]'); - * client.deleteKey({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - deleteKey(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - 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, - }); - - return this._innerApiCalls.deleteKey(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified assessment resource name string. - * - * @param {String} project - * @param {String} assessment - * @returns {String} - */ - assessmentPath(project, assessment) { - return this._pathTemplates.assessmentPathTemplate.render({ - project: project, - assessment: assessment, - }); - } - - /** - * Return a fully-qualified key resource name string. - * - * @param {String} project - * @param {String} key - * @returns {String} - */ - keyPath(project, key) { - return this._pathTemplates.keyPathTemplate.render({ - project: project, - key: key, - }); - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {String} project - * @returns {String} - */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the assessmentName from a assessment resource. - * - * @param {String} assessmentName - * A fully-qualified path representing a assessment resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromAssessmentName(assessmentName) { - return this._pathTemplates.assessmentPathTemplate.match(assessmentName) - .project; - } - - /** - * Parse the assessmentName from a assessment resource. - * - * @param {String} assessmentName - * A fully-qualified path representing a assessment resources. - * @returns {String} - A string representing the assessment. - */ - matchAssessmentFromAssessmentName(assessmentName) { - return this._pathTemplates.assessmentPathTemplate.match(assessmentName) - .assessment; - } - - /** - * Parse the keyName from a key resource. - * - * @param {String} keyName - * A fully-qualified path representing a key resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromKeyName(keyName) { - return this._pathTemplates.keyPathTemplate.match(keyName).project; - } - - /** - * Parse the keyName from a key resource. - * - * @param {String} keyName - * A fully-qualified path representing a key resources. - * @returns {String} - A string representing the key. - */ - matchKeyFromKeyName(keyName) { - return this._pathTemplates.keyPathTemplate.match(keyName).key; - } - - /** - * Parse the projectName from a project resource. - * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; - } -} - -module.exports = RecaptchaEnterpriseServiceV1Beta1Client; diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts new file mode 100644 index 00000000000..22bd220a24a --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -0,0 +1,1029 @@ +// 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 +// +// 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 { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './recaptcha_enterprise_service_v1_beta1_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service to determine the likelihood an event is legitimate. + * @class + * @memberof v1beta1 + */ +export class RecaptchaEnterpriseServiceV1Beta1Client { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + recaptchaEnterpriseServiceV1Beta1Stub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RecaptchaEnterpriseServiceV1Beta1Client. + * + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @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 RecaptchaEnterpriseServiceV1Beta1Client; + 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. + const 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 RecaptchaEnterpriseServiceV1Beta1Client).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${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' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? 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 = { + projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), + assessmentPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/assessments/{assessment}' + ), + keyPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/keys/{key}' + ), + }; + + // 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 = { + listKeys: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'keys' + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1', + 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 = {}; + + // Put together the "service stub" for + // google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1. + this.recaptchaEnterpriseServiceV1Beta1Stub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.recaptchaenterprise.v1beta1 + .RecaptchaEnterpriseServiceV1Beta1, + 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 recaptchaEnterpriseServiceV1Beta1StubMethods = [ + 'createAssessment', + 'annotateAssessment', + 'createKey', + 'listKeys', + 'getKey', + 'updateKey', + 'deleteKey', + ]; + + for (const methodName of recaptchaEnterpriseServiceV1Beta1StubMethods) { + const innerCallPromise = this.recaptchaEnterpriseServiceV1Beta1Stub.then( + stub => (...args: Array<{}>) => { + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'recaptchaenterprise.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'recaptchaenterprise.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 -- + // ------------------- + createAssessment( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | undefined + ), + {} | undefined + ] + >; + createAssessment( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates an Assessment of the likelihood an event is legitimate. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the assessment will be created, + * in the format "projects/{project_number}". + * @param {google.cloud.recaptchaenterprise.v1beta1.Assessment} request.assessment + * Required. The assessment details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createAssessment( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | 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 || '', + }); + return this._innerApiCalls.createAssessment(request, options, callback); + } + annotateAssessment( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | undefined + ), + {} | undefined + ] + >; + annotateAssessment( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | undefined, + {} | undefined + > + ): void; + /** + * Annotates a previously created Assessment to provide additional information + * on whether the event turned out to be authentic or fradulent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Assessment, in the format + * "projects/{project_number}/assessments/{assessment_id}". + * @param {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation} request.annotation + * Required. The annotation that will be assigned to the Event. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + annotateAssessment( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | 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 || '', + }); + return this._innerApiCalls.annotateAssessment(request, options, callback); + } + createKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | undefined + ), + {} | undefined + ] + >; + createKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates a new reCAPTCHA Enterprise key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the key will be created, in the + * format "projects/{project_number}". + * @param {google.cloud.recaptchaenterprise.v1beta1.Key} request.key + * Required. Information to create a reCAPTCHA Enterprise key. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | 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 || '', + }); + return this._innerApiCalls.createKey(request, options, callback); + } + getKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | undefined + ), + {} | undefined + ] + >; + getKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | undefined, + {} | undefined + > + ): void; + /** + * Returns the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the requested key, in the format + * "projects/{project_number}/keys/{key_id}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | 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 || '', + }); + return this._innerApiCalls.getKey(request, options, callback); + } + updateKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | undefined + ), + {} | undefined + ] + >; + updateKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.recaptchaenterprise.v1beta1.Key} request.key + * Required. The key to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which field of the key get updated. If the mask is not + * present, all fields will be 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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | 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({ + key_name: request.key!.name || '', + }); + return this._innerApiCalls.updateKey(request, options, callback); + } + deleteKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | undefined + ), + {} | undefined + ] + >; + deleteKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | undefined, + {} | undefined + > + ): void; + /** + * Deletes the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the key to be deleted, in the format + * "projects/{project_number}/keys/{key_id}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | 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 || '', + }); + return this._innerApiCalls.deleteKey(request, options, callback); + } + + listKeys( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey[], + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + ] + >; + listKeys( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey[], + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + > + ): void; + /** + * Returns the list of all keys that belong to a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project that contains the keys that will be + * listed, in the format "projects/{project_number}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * 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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} 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 [ListKeysRequest]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} + * 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 + * [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listKeys( + request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey[], + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + >, + callback?: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey[], + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + > + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey[], + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, + protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + ] + > | 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 || '', + }); + return this._innerApiCalls.listKeys(request, options, callback); + } + + /** + * Equivalent to {@link listKeys}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listKeys} 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 name of the project that contains the keys that will be + * listed, in the format "projects/{project_number}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} on 'data' event. + */ + listKeysStream( + request?: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listKeys.createStream( + this._innerApiCalls.listKeys as gax.GaxCall, + request, + callSettings + ); + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this._pathTemplates.projectPathTemplate.render({ + project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this._pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified assessment resource name string. + * + * @param {string} project + * @param {string} assessment + * @returns {string} Resource name string. + */ + assessmentPath(project: string, assessment: string) { + return this._pathTemplates.assessmentPathTemplate.render({ + project, + assessment, + }); + } + + /** + * Parse the project from Assessment resource. + * + * @param {string} assessmentName + * A fully-qualified path representing Assessment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAssessmentName(assessmentName: string) { + return this._pathTemplates.assessmentPathTemplate.match(assessmentName) + .project; + } + + /** + * Parse the assessment from Assessment resource. + * + * @param {string} assessmentName + * A fully-qualified path representing Assessment resource. + * @returns {string} A string representing the assessment. + */ + matchAssessmentFromAssessmentName(assessmentName: string) { + return this._pathTemplates.assessmentPathTemplate.match(assessmentName) + .assessment; + } + + /** + * Return a fully-qualified key resource name string. + * + * @param {string} project + * @param {string} key + * @returns {string} Resource name string. + */ + keyPath(project: string, key: string) { + return this._pathTemplates.keyPathTemplate.render({ + project, + key, + }); + } + + /** + * Parse the project from Key resource. + * + * @param {string} keyName + * A fully-qualified path representing Key resource. + * @returns {string} A string representing the project. + */ + matchProjectFromKeyName(keyName: string) { + return this._pathTemplates.keyPathTemplate.match(keyName).project; + } + + /** + * Parse the key from Key resource. + * + * @param {string} keyName + * A fully-qualified path representing Key resource. + * @returns {string} A string representing the key. + */ + matchKeyFromKeyName(keyName: string) { + return this._pathTemplates.keyPathTemplate.match(keyName).key; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.recaptchaEnterpriseServiceV1Beta1Stub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json index 3aa1afa8820..726aae13003 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json @@ -2,56 +2,56 @@ "interfaces": { "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, "methods": { "CreateAssessment": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "AnnotateAssessment": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateKey": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "ListKeys": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetKey": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateKey": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteKey": { - "timeout_millis": 60000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 2f9c2670369..aaf488f151a 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,19 +1,12 @@ { - "updateTime": "2019-12-03T12:19:56.567157Z", + "updateTime": "2019-12-20T23:47:04.933248Z", "sources": [ - { - "generator": { - "name": "artman", - "version": "0.42.1", - "dockerImage": "googleapis/artman@sha256:c773192618c608a7a0415dd95282f841f8e6bcdef7dd760a988c93b77a64bd57" - } - }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "38dc36a2a43cbab4a2a9183a43dd0441670098a9", - "internalRef": "283384331" + "sha": "1a380ea21dea9b6ac6ad28c60ad96d9d73574e19", + "internalRef": "286616241" } }, { @@ -30,10 +23,314 @@ "source": "googleapis", "apiName": "recaptchaenterprise", "apiVersion": "v1beta1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/recaptchaenterprise/artman_recaptchaenterprise_v1beta1.yaml" + "language": "typescript", + "generator": "gapic-generator-typescript" } } + ], + "newFiles": [ + { + "path": "CODE_OF_CONDUCT.md" + }, + { + "path": ".eslintrc.yml" + }, + { + "path": "LICENSE" + }, + { + "path": "codecov.yaml" + }, + { + "path": "renovate.json" + }, + { + "path": "webpack.config.js" + }, + { + "path": ".jsdoc.js" + }, + { + "path": ".prettierignore" + }, + { + "path": "README.md" + }, + { + "path": "tslint.json" + }, + { + "path": "CONTRIBUTING.md" + }, + { + "path": ".prettierrc" + }, + { + "path": "tsconfig.json" + }, + { + "path": ".eslintignore" + }, + { + "path": ".nycrc" + }, + { + "path": "linkinator.config.json" + }, + { + "path": "protos/protos.d.ts" + }, + { + "path": "protos/protos.json" + }, + { + "path": "protos/protos.js" + }, + { + "path": "protos/google/cloud/common_resources.proto" + }, + { + "path": "protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto" + }, + { + "path": "test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts" + }, + { + "path": "system-test/.eslintrc.yml" + }, + { + "path": "system-test/install.ts" + }, + { + "path": "system-test/fixtures/sample/src/index.js" + }, + { + "path": "system-test/fixtures/sample/src/index.ts" + }, + { + "path": "node_modules/protobufjs/cli/package-lock.json" + }, + { + "path": "node_modules/protobufjs/cli/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" + }, + { + "path": "samples/README.md" + }, + { + "path": ".github/PULL_REQUEST_TEMPLATE.md" + }, + { + "path": ".github/release-please.yml" + }, + { + "path": ".github/ISSUE_TEMPLATE/feature_request.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/bug_report.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/support_request.md" + }, + { + "path": "build/protos/.DS_Store" + }, + { + "path": "build/protos/protos.d.ts" + }, + { + "path": "build/protos/protos.json" + }, + { + "path": "build/protos/protos.js" + }, + { + "path": "build/protos/google/.DS_Store" + }, + { + "path": "build/protos/google/cloud/.DS_Store" + }, + { + "path": "build/protos/google/cloud/common_resources.proto" + }, + { + "path": "build/protos/google/cloud/recaptchaenterprise/.DS_Store" + }, + { + "path": "build/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto" + }, + { + "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.d.ts" + }, + { + "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.js.map" + }, + { + "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.js" + }, + { + "path": "build/system-test/install.js.map" + }, + { + "path": "build/system-test/install.js" + }, + { + "path": "build/system-test/install.d.ts" + }, + { + "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.d.ts" + }, + { + "path": "build/src/v1beta1/index.js" + }, + { + "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js" + }, + { + "path": "build/src/v1beta1/index.js.map" + }, + { + "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js.map" + }, + { + "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json" + }, + { + "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.d.ts" + }, + { + "path": "build/src/v1beta1/index.d.ts" + }, + { + "path": ".kokoro/test.bat" + }, + { + "path": ".kokoro/system-test.sh" + }, + { + "path": ".kokoro/trampoline.sh" + }, + { + "path": ".kokoro/samples-test.sh" + }, + { + "path": ".kokoro/publish.sh" + }, + { + "path": ".kokoro/lint.sh" + }, + { + "path": ".kokoro/common.cfg" + }, + { + "path": ".kokoro/test.sh" + }, + { + "path": ".kokoro/docs.sh" + }, + { + "path": ".kokoro/release/docs.cfg" + }, + { + "path": ".kokoro/release/publish.cfg" + }, + { + "path": ".kokoro/release/docs.sh" + }, + { + "path": ".kokoro/presubmit/node10/system-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/samples-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/docs.cfg" + }, + { + "path": ".kokoro/presubmit/node10/common.cfg" + }, + { + "path": ".kokoro/presubmit/node10/lint.cfg" + }, + { + "path": ".kokoro/presubmit/node8/test.cfg" + }, + { + "path": ".kokoro/presubmit/node8/common.cfg" + }, + { + "path": ".kokoro/presubmit/node12/test.cfg" + }, + { + "path": ".kokoro/presubmit/node12/common.cfg" + }, + { + "path": ".kokoro/presubmit/windows/test.cfg" + }, + { + "path": ".kokoro/presubmit/windows/common.cfg" + }, + { + "path": ".kokoro/continuous/node10/system-test.cfg" + }, + { + "path": ".kokoro/continuous/node10/samples-test.cfg" + }, + { + "path": ".kokoro/continuous/node10/test.cfg" + }, + { + "path": ".kokoro/continuous/node10/docs.cfg" + }, + { + "path": ".kokoro/continuous/node10/common.cfg" + }, + { + "path": ".kokoro/continuous/node10/lint.cfg" + }, + { + "path": ".kokoro/continuous/node8/test.cfg" + }, + { + "path": ".kokoro/continuous/node8/common.cfg" + }, + { + "path": ".kokoro/continuous/node12/test.cfg" + }, + { + "path": ".kokoro/continuous/node12/common.cfg" + }, + { + "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_proto_list.json" + }, + { + "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts" + }, + { + "path": "src/v1beta1/index.ts" + }, + { + "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json" + } ] } \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/synth.py b/packages/google-cloud-recaptchaenterprise/synth.py index 36abf1900fc..d6e84fe668f 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.py +++ b/packages/google-cloud-recaptchaenterprise/synth.py @@ -21,19 +21,26 @@ logging.basicConfig(level=logging.DEBUG) # run the gapic generator -gapic = gcp.GAPICGenerator() +gapic = gcp.GAPICMicrogenerator() versions = ['v1beta1'] for version in versions: - library = gapic.node_library( - 'recaptchaenterprise', - version) - s.copy(library, excludes=['package.json', 'src/index.js']) + library = gapic.typescript_library( + 'recaptchaenterprise', version, + generator_args={ + "grpc-service-config": f"google/cloud/recaptchaenterprise/{version}/recaptchaenterprise_grpc_service_config.json", + "package-name": f"@google-cloud/recaptcha-enterprise", + }, + proto_path=f'/google/cloud/recaptchaenterprise/{version}', + extra_proto_files=['google/cloud/common_resources.proto'] + ) + s.copy(library, excludes=['package.json', 'src/index.ts']) # Copy common templates common_templates = gcp.CommonTemplates() -templates = common_templates.node_library() +templates = common_templates.node_library(source_location='build/src') s.copy(templates) # Node.js specific cleanup subprocess.run(['npm', 'install']) subprocess.run(['npm', 'run', 'fix']) +subprocess.run(['npx', 'compileProtos', 'src']) diff --git a/packages/google-cloud-recaptchaenterprise/system-test/.eslintrc b/packages/google-cloud-recaptchaenterprise/system-test/.eslintrc deleted file mode 100644 index e28757c0a59..00000000000 --- a/packages/google-cloud-recaptchaenterprise/system-test/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ ---- -env: - mocha: true \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/system-test/.eslintrc.yml b/packages/google-cloud-recaptchaenterprise/system-test/.eslintrc.yml new file mode 100644 index 00000000000..dc5d9b0171b --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/system-test/.eslintrc.yml @@ -0,0 +1,4 @@ +--- +env: + mocha: true + diff --git a/packages/google-cloud-recaptchaenterprise/system-test/test.js b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js similarity index 50% rename from packages/google-cloud-recaptchaenterprise/system-test/test.js rename to packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js index ddc5feb5953..3d40ab80e39 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/test.js +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js @@ -4,19 +4,24 @@ // 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. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const recaptchaenterprise = require('@google-cloud/recaptcha-enterprise'); -'use strict'; +function main() { + const recaptchaEnterpriseServiceV1Beta1Client = new recaptchaenterprise.RecaptchaEnterpriseServiceV1Beta1Client(); +} -describe('RecaptchaEnterpriseSystemTest', () => { - it('creates a client', async () => { - const {RecaptchaEnterpriseServiceV1Beta1Client} = require('../'); - new RecaptchaEnterpriseServiceV1Beta1Client(); - }); -}); +main(); diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/index.js b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts similarity index 58% rename from packages/google-cloud-recaptchaenterprise/src/v1beta1/index.js rename to packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts index 69dd8e4eced..3f81a948f09 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/index.js +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts @@ -11,9 +11,15 @@ // WITHOUT 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'; +import {RecaptchaEnterpriseServiceV1Beta1Client} from '@google-cloud/recaptcha-enterprise'; -const RecaptchaEnterpriseServiceV1Beta1Client = require('./recaptcha_enterprise_service_v1_beta1_client'); +function main() { + const recaptchaEnterpriseServiceV1Beta1Client = new RecaptchaEnterpriseServiceV1Beta1Client(); +} -module.exports.RecaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client; +main(); diff --git a/packages/google-cloud-recaptchaenterprise/system-test/install.ts b/packages/google-cloud-recaptchaenterprise/system-test/install.ts new file mode 100644 index 00000000000..2736aee84f7 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/system-test/install.ts @@ -0,0 +1,50 @@ +// 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 +// +// 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'; + +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-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts new file mode 100644 index 00000000000..5971213bbd4 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts @@ -0,0 +1,452 @@ +// 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 +// +// 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +const recaptchaenterpriseservicev1beta1Module = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { + it('has servicePath', () => { + const servicePath = + recaptchaenterpriseservicev1beta1Module.v1beta1 + .RecaptchaEnterpriseServiceV1Beta1Client.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + recaptchaenterpriseservicev1beta1Module.v1beta1 + .RecaptchaEnterpriseServiceV1Beta1Client.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = + recaptchaenterpriseservicev1beta1Module.v1beta1 + .RecaptchaEnterpriseServiceV1Beta1Client.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + fallback: true, + } + ); + assert(client); + }); + describe('createAssessment', () => { + it('invokes createAssessment without error', done => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createAssessment = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createAssessment(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createAssessment with error', done => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createAssessment = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createAssessment(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('annotateAssessment', () => { + it('invokes annotateAssessment without error', done => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.annotateAssessment = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.annotateAssessment(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes annotateAssessment with error', done => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.annotateAssessment = mockSimpleGrpcMethod( + request, + null, + error + ); + client.annotateAssessment(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createKey', () => { + it('invokes createKey without error', done => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createKey = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createKey(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createKey with error', done => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createKey = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createKey(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getKey', () => { + it('invokes getKey without error', done => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getKey = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getKey(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getKey with error', done => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getKey = mockSimpleGrpcMethod(request, null, error); + client.getKey(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateKey', () => { + it('invokes updateKey without error', done => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest = {}; + request.key = {}; + request.key.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateKey = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateKey(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateKey with error', done => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest = {}; + request.key = {}; + request.key.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateKey = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateKey(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('deleteKey', () => { + it('invokes deleteKey without error', done => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteKey = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteKey(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteKey with error', done => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteKey = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteKey(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('listKeys', () => { + it('invokes listKeys without error', done => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listKeys = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listKeys(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listKeysStream', () => { + it('invokes listKeysStream without error', done => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listKeys = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listKeysStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); + }); + }); +}); diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js b/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js deleted file mode 100644 index 7d5edb66232..00000000000 --- a/packages/google-cloud-recaptchaenterprise/test/gapic-v1beta1.js +++ /dev/null @@ -1,525 +0,0 @@ -// 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 -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -'use strict'; - -const assert = require('assert'); - -const recaptchaenterpriseModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -const error = new Error(); -error.code = FAKE_STATUS_CODE; - -describe('RecaptchaEnterpriseServiceV1Beta1Client', () => { - it('has servicePath', () => { - const servicePath = - recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client - .servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client - .apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = - recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client - .port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - {fallback: true} - ); - assert(client); - }); - - describe('createAssessment', () => { - it('invokes createAssessment without error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const assessment = {}; - const request = { - parent: formattedParent, - assessment: assessment, - }; - - // Mock response - const name = 'name3373707'; - const score = 1.0926453e7; - const expectedResponse = { - name: name, - score: score, - }; - - // Mock Grpc layer - client._innerApiCalls.createAssessment = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createAssessment(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createAssessment with error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const assessment = {}; - const request = { - parent: formattedParent, - assessment: assessment, - }; - - // Mock Grpc layer - client._innerApiCalls.createAssessment = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createAssessment(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('annotateAssessment', () => { - it('invokes annotateAssessment without error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - - // Mock request - const formattedName = client.assessmentPath('[PROJECT]', '[ASSESSMENT]'); - const annotation = 'ANNOTATION_UNSPECIFIED'; - const request = { - name: formattedName, - annotation: annotation, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.annotateAssessment = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.annotateAssessment(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes annotateAssessment with error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - - // Mock request - const formattedName = client.assessmentPath('[PROJECT]', '[ASSESSMENT]'); - const annotation = 'ANNOTATION_UNSPECIFIED'; - const request = { - name: formattedName, - annotation: annotation, - }; - - // Mock Grpc layer - client._innerApiCalls.annotateAssessment = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.annotateAssessment(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createKey', () => { - it('invokes createKey without error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const key = {}; - const request = { - parent: formattedParent, - key: key, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name: name, - displayName: displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.createKey = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createKey(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createKey with error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const key = {}; - const request = { - parent: formattedParent, - key: key, - }; - - // Mock Grpc layer - client._innerApiCalls.createKey = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createKey(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listKeys', () => { - it('invokes listKeys without error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const keysElement = {}; - const keys = [keysElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - keys: keys, - }; - - // Mock Grpc layer - client._innerApiCalls.listKeys = (actualRequest, options, callback) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.keys); - }; - - client.listKeys(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.keys); - done(); - }); - }); - - it('invokes listKeys with error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listKeys = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listKeys(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getKey', () => { - it('invokes getKey without error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - - // Mock request - const formattedName = client.keyPath('[PROJECT]', '[KEY]'); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name: name2, - displayName: displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.getKey = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getKey(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getKey with error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - - // Mock request - const formattedName = client.keyPath('[PROJECT]', '[KEY]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getKey = mockSimpleGrpcMethod(request, null, error); - - client.getKey(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateKey', () => { - it('invokes updateKey without error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - - // Mock request - const key = {}; - const request = { - key: key, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name: name, - displayName: displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.updateKey = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateKey(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateKey with error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - - // Mock request - const key = {}; - const request = { - key: key, - }; - - // Mock Grpc layer - client._innerApiCalls.updateKey = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateKey(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteKey', () => { - it('invokes deleteKey without error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - - // Mock request - const formattedName = client.keyPath('[PROJECT]', '[KEY]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteKey = mockSimpleGrpcMethod(request); - - client.deleteKey(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteKey with error', done => { - const client = new recaptchaenterpriseModule.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - - // Mock request - const formattedName = client.keyPath('[PROJECT]', '[KEY]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteKey = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteKey(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); -}); - -function mockSimpleGrpcMethod(expectedRequest, response, error) { - return function(actualRequest, options, callback) { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} diff --git a/packages/google-cloud-recaptchaenterprise/tsconfig.json b/packages/google-cloud-recaptchaenterprise/tsconfig.json new file mode 100644 index 00000000000..613d35597b5 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/tslint.json b/packages/google-cloud-recaptchaenterprise/tslint.json new file mode 100644 index 00000000000..617dc975bae --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "gts/tslint.json" +} diff --git a/packages/google-cloud-recaptchaenterprise/webpack.config.js b/packages/google-cloud-recaptchaenterprise/webpack.config.js index 3eb4643e0c1..d49627b5ae2 100644 --- a/packages/google-cloud-recaptchaenterprise/webpack.config.js +++ b/packages/google-cloud-recaptchaenterprise/webpack.config.js @@ -12,11 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +const path = require('path'); + module.exports = { - entry: './src/browser.js', + entry: './src/index.ts', output: { - library: 'recaptchaenterprise', - filename: './recaptchaenterprise.js', + library: 'RecaptchaEnterpriseServiceV1Beta1', + filename: './recaptcha-enterprise-service-v1-beta1.js', }, node: { child_process: 'empty', @@ -24,21 +26,37 @@ module.exports = { crypto: 'empty', }, resolve: { - extensions: ['.js', '.json'], + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], }, module: { rules: [ { - test: /node_modules[\\/]retry-request[\\/]/, - use: 'null-loader', + 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[\\/]https?-proxy-agent/, + use: 'null-loader' }, { - test: /node_modules[\\/]gtoken[\\/]/, - use: 'null-loader', + test: /node_modules[\\/]gtoken/, + use: 'null-loader' }, ], }, From f3167d51525cc747343b6763fa6ebc4b7b507a88 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 26 Dec 2019 16:47:43 -0500 Subject: [PATCH 059/253] docs: update jsdoc license/samples-README (#86) --- .../.jsdoc.js | 29 +++++++++---------- .../samples/README.md | 10 +++++-- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.jsdoc.js b/packages/google-cloud-recaptchaenterprise/.jsdoc.js index 78c206f407a..04290c7f2d3 100644 --- a/packages/google-cloud-recaptchaenterprise/.jsdoc.js +++ b/packages/google-cloud-recaptchaenterprise/.jsdoc.js @@ -1,18 +1,17 @@ -/*! - * Copyright 2018 Google LLC. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.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. - */ +// 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 +// +// 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'; diff --git a/packages/google-cloud-recaptchaenterprise/samples/README.md b/packages/google-cloud-recaptchaenterprise/samples/README.md index fd64d549a98..29686772faa 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/README.md +++ b/packages/google-cloud-recaptchaenterprise/samples/README.md @@ -19,6 +19,12 @@ Before running the samples, make sure you've followed the steps outlined in [Using the client library](https://github.com/googleapis/nodejs-recaptcha-enterprise#using-the-client-library). +`cd samples` + +`npm install` + +`cd ..` + ## Samples @@ -32,7 +38,7 @@ View the [source code](https://github.com/googleapis/nodejs-recaptcha-enterprise __Usage:__ -`node quickstart.js` +`node samples/quickstart.js` @@ -41,4 +47,4 @@ __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-recaptcha-enterprise&page=editor&open_in_editor=samples/README.md -[product-docs]: https://cloud.google.com/recaptcha-enterprise/docs/ \ No newline at end of file +[product-docs]: https://cloud.google.com/recaptcha-enterprise/docs/ From 598dafed1211349b103a57efcc9570800ac0a83e Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 30 Dec 2019 12:02:27 -0800 Subject: [PATCH 060/253] refactor: use explicit mocha imports (#92) --- .../system-test/.eslintrc.yml | 4 ---- packages/google-cloud-recaptchaenterprise/test/.eslintrc | 3 --- .../gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts | 1 + 3 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 packages/google-cloud-recaptchaenterprise/system-test/.eslintrc.yml delete mode 100644 packages/google-cloud-recaptchaenterprise/test/.eslintrc diff --git a/packages/google-cloud-recaptchaenterprise/system-test/.eslintrc.yml b/packages/google-cloud-recaptchaenterprise/system-test/.eslintrc.yml deleted file mode 100644 index dc5d9b0171b..00000000000 --- a/packages/google-cloud-recaptchaenterprise/system-test/.eslintrc.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -env: - mocha: true - diff --git a/packages/google-cloud-recaptchaenterprise/test/.eslintrc b/packages/google-cloud-recaptchaenterprise/test/.eslintrc deleted file mode 100644 index e28757c0a59..00000000000 --- a/packages/google-cloud-recaptchaenterprise/test/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ ---- -env: - mocha: true \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts index 5971213bbd4..3e7d352f4af 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts @@ -18,6 +18,7 @@ import * as protosTypes from '../protos/protos'; import * as assert from 'assert'; +import {describe, it} from 'mocha'; const recaptchaenterpriseservicev1beta1Module = require('../src'); const FAKE_STATUS_CODE = 1; From e403cd6566bd14d2804d46705df1ffeccdabde0f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 31 Dec 2019 04:03:22 +0200 Subject: [PATCH 061/253] chore(deps): update dependency eslint-plugin-node to v11 (#91) --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index bfbe7ec85de..065b86204fe 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -33,7 +33,7 @@ "c8": "^6.0.0", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", - "eslint-plugin-node": "^10.0.0", + "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", "gts": "^1.0.0", "intelli-espower-loader": "^1.0.1", From 4c83baa867d4de1241c94077f398528f5c6fcbbb Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 31 Dec 2019 20:24:26 +0200 Subject: [PATCH 062/253] chore(deps): update dependency c8 to v7 (#90) --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 065b86204fe..843c2d71143 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -30,7 +30,7 @@ "devDependencies": { "@types/mocha": "^5.2.5", "@types/node": "^12.0.0", - "c8": "^6.0.0", + "c8": "^7.0.0", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^11.0.0", From 7dac6f3f15b74f9f35a1d38993691cc562ac8a5b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 2 Jan 2020 14:05:13 -0800 Subject: [PATCH 063/253] build: track files list in synth.metadata Co-authored-by: Benjamin E. Coe Co-authored-by: Justin Beckwith --- .../synth.metadata | 3459 ++++++++++++++++- 1 file changed, 3369 insertions(+), 90 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index aaf488f151a..c08d08fc377 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-12-20T23:47:04.933248Z", + "updateTime": "2019-12-21T12:24:03.013452Z", "sources": [ { "git": { @@ -30,248 +30,287 @@ ], "newFiles": [ { - "path": "CODE_OF_CONDUCT.md" + "path": ".repo-metadata.json" }, { - "path": ".eslintrc.yml" + "path": "README.md" }, { - "path": "LICENSE" + "path": "package.json" }, { - "path": "codecov.yaml" + "path": "CHANGELOG.md" }, { - "path": "renovate.json" + "path": ".gitignore" }, { - "path": "webpack.config.js" + "path": "CODE_OF_CONDUCT.md" }, { - "path": ".jsdoc.js" + "path": "webpack.config.js" }, { - "path": ".prettierignore" + "path": "CONTRIBUTING.md" }, { - "path": "README.md" + "path": ".prettierrc" }, { - "path": "tslint.json" + "path": "package-lock.json" }, { - "path": "CONTRIBUTING.md" + "path": ".eslintignore" }, { - "path": ".prettierrc" + "path": "linkinator.config.json" }, { - "path": "tsconfig.json" + "path": ".eslintrc.yml" }, { - "path": ".eslintignore" + "path": "renovate.json" }, { - "path": ".nycrc" + "path": "synth.metadata" }, { - "path": "linkinator.config.json" + "path": ".prettierignore" }, { - "path": "protos/protos.d.ts" + "path": "synth.py" }, { - "path": "protos/protos.json" + "path": "codecov.yaml" }, { - "path": "protos/protos.js" + "path": "tslint.json" }, { - "path": "protos/google/cloud/common_resources.proto" + "path": ".jsdoc.js" }, { - "path": "protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto" + "path": "LICENSE" }, { - "path": "test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts" + "path": ".nycrc" }, { - "path": "system-test/.eslintrc.yml" + "path": "tsconfig.json" }, { - "path": "system-test/install.ts" + "path": "src/index.ts" }, { - "path": "system-test/fixtures/sample/src/index.js" + "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts" }, { - "path": "system-test/fixtures/sample/src/index.ts" + "path": "src/v1beta1/index.ts" }, { - "path": "node_modules/protobufjs/cli/package-lock.json" + "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_proto_list.json" }, { - "path": "node_modules/protobufjs/cli/package.json" + "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" + "path": "build/src/index.d.ts" }, { - "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" + "path": "build/src/index.js.map" }, { - "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" + "path": "build/src/index.js" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" + "path": "build/src/v1beta1/index.d.ts" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" + "path": "build/src/v1beta1/index.js.map" }, { - "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" + "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.d.ts" }, { - "path": "samples/README.md" + "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js" }, { - "path": ".github/PULL_REQUEST_TEMPLATE.md" + "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js.map" }, { - "path": ".github/release-please.yml" + "path": "build/src/v1beta1/index.js" }, { - "path": ".github/ISSUE_TEMPLATE/feature_request.md" + "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json" }, { - "path": ".github/ISSUE_TEMPLATE/bug_report.md" + "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.d.ts" }, { - "path": ".github/ISSUE_TEMPLATE/support_request.md" + "path": "build/protos/protos.json" }, { - "path": "build/protos/.DS_Store" + "path": "build/protos/protos.js" }, { "path": "build/protos/protos.d.ts" }, { - "path": "build/protos/protos.json" + "path": "build/protos/google/cloud/common_resources.proto" }, { - "path": "build/protos/protos.js" + "path": "build/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto" }, { - "path": "build/protos/google/.DS_Store" + "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.js.map" }, { - "path": "build/protos/google/cloud/.DS_Store" + "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.js" }, { - "path": "build/protos/google/cloud/common_resources.proto" + "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.d.ts" }, { - "path": "build/protos/google/cloud/recaptchaenterprise/.DS_Store" + "path": "build/system-test/install.js.map" }, { - "path": "build/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto" + "path": "build/system-test/install.d.ts" }, { - "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.d.ts" + "path": "build/system-test/install.js" }, { - "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.js.map" + "path": "__pycache__/synth.cpython-36.pyc" }, { - "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.js" + "path": "samples/README.md" }, { - "path": "build/system-test/install.js.map" + "path": "samples/package.json" }, { - "path": "build/system-test/install.js" + "path": "samples/.eslintrc" }, { - "path": "build/system-test/install.d.ts" + "path": "samples/quickstart.js" }, { - "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.d.ts" + "path": "samples/test/.eslintrc" }, { - "path": "build/src/v1beta1/index.js" + "path": "samples/test/samples.test.js" }, { - "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js" + "path": ".github/PULL_REQUEST_TEMPLATE.md" }, { - "path": "build/src/v1beta1/index.js.map" + "path": ".github/release-please.yml" }, { - "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js.map" + "path": ".github/ISSUE_TEMPLATE/support_request.md" }, { - "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json" + "path": ".github/ISSUE_TEMPLATE/feature_request.md" }, { - "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.d.ts" + "path": ".github/ISSUE_TEMPLATE/bug_report.md" }, { - "path": "build/src/v1beta1/index.d.ts" + "path": ".kokoro/test.sh" }, { - "path": ".kokoro/test.bat" + "path": ".kokoro/docs.sh" }, { - "path": ".kokoro/system-test.sh" + "path": ".kokoro/samples-test.sh" + }, + { + "path": ".kokoro/.gitattributes" }, { "path": ".kokoro/trampoline.sh" }, { - "path": ".kokoro/samples-test.sh" + "path": ".kokoro/lint.sh" }, { "path": ".kokoro/publish.sh" }, { - "path": ".kokoro/lint.sh" + "path": ".kokoro/test.bat" }, { "path": ".kokoro/common.cfg" }, { - "path": ".kokoro/test.sh" + "path": ".kokoro/system-test.sh" }, { - "path": ".kokoro/docs.sh" + "path": ".kokoro/release/docs.cfg" }, { - "path": ".kokoro/release/docs.cfg" + "path": ".kokoro/release/docs.sh" }, { "path": ".kokoro/release/publish.cfg" }, { - "path": ".kokoro/release/docs.sh" + "path": ".kokoro/release/common.cfg" }, { - "path": ".kokoro/presubmit/node10/system-test.cfg" + "path": ".kokoro/continuous/node10/lint.cfg" }, { - "path": ".kokoro/presubmit/node10/samples-test.cfg" + "path": ".kokoro/continuous/node10/docs.cfg" }, { - "path": ".kokoro/presubmit/node10/test.cfg" + "path": ".kokoro/continuous/node10/test.cfg" }, { - "path": ".kokoro/presubmit/node10/docs.cfg" + "path": ".kokoro/continuous/node10/system-test.cfg" }, { - "path": ".kokoro/presubmit/node10/common.cfg" + "path": ".kokoro/continuous/node10/samples-test.cfg" + }, + { + "path": ".kokoro/continuous/node10/common.cfg" + }, + { + "path": ".kokoro/continuous/node8/test.cfg" + }, + { + "path": ".kokoro/continuous/node8/common.cfg" + }, + { + "path": ".kokoro/continuous/node12/test.cfg" + }, + { + "path": ".kokoro/continuous/node12/common.cfg" + }, + { + "path": ".kokoro/continuous/node6/test.cfg" + }, + { + "path": ".kokoro/continuous/node6/common.cfg" }, { "path": ".kokoro/presubmit/node10/lint.cfg" }, + { + "path": ".kokoro/presubmit/node10/docs.cfg" + }, + { + "path": ".kokoro/presubmit/node10/test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/system-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/samples-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/common.cfg" + }, { "path": ".kokoro/presubmit/node8/test.cfg" }, @@ -291,46 +330,3286 @@ "path": ".kokoro/presubmit/windows/common.cfg" }, { - "path": ".kokoro/continuous/node10/system-test.cfg" + "path": ".kokoro/presubmit/node6/test.cfg" }, { - "path": ".kokoro/continuous/node10/samples-test.cfg" + "path": ".kokoro/presubmit/node6/common.cfg" }, { - "path": ".kokoro/continuous/node10/test.cfg" + "path": "protos/protos.json" }, { - "path": ".kokoro/continuous/node10/docs.cfg" + "path": "protos/protos.js" }, { - "path": ".kokoro/continuous/node10/common.cfg" + "path": "protos/protos.d.ts" }, { - "path": ".kokoro/continuous/node10/lint.cfg" + "path": "protos/google/cloud/common_resources.proto" }, { - "path": ".kokoro/continuous/node8/test.cfg" + "path": "protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto" }, { - "path": ".kokoro/continuous/node8/common.cfg" + "path": ".git/packed-refs" }, { - "path": ".kokoro/continuous/node12/test.cfg" + "path": ".git/HEAD" }, { - "path": ".kokoro/continuous/node12/common.cfg" + "path": ".git/config" }, { - "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_proto_list.json" + "path": ".git/index" }, { - "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts" + "path": ".git/shallow" }, { - "path": "src/v1beta1/index.ts" + "path": ".git/logs/HEAD" }, { - "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json" + "path": ".git/logs/refs/remotes/origin/HEAD" + }, + { + "path": ".git/logs/refs/heads/autosynth" + }, + { + "path": ".git/logs/refs/heads/master" + }, + { + "path": ".git/refs/remotes/origin/HEAD" + }, + { + "path": ".git/refs/heads/autosynth" + }, + { + "path": ".git/refs/heads/master" + }, + { + "path": ".git/objects/pack/pack-30443dd22e6f5d39b3a7d4616916b3c33fdd170d.pack" + }, + { + "path": ".git/objects/pack/pack-30443dd22e6f5d39b3a7d4616916b3c33fdd170d.idx" + }, + { + "path": "test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts" + }, + { + "path": "test/.eslintrc" + }, + { + "path": "system-test/.eslintrc.yml" + }, + { + "path": "system-test/install.ts" + }, + { + "path": "system-test/fixtures/sample/src/index.ts" + }, + { + "path": "system-test/fixtures/sample/src/index.js" + }, + { + "path": "node_modules/strip-bom/package.json" + }, + { + "path": "node_modules/string-width/package.json" + }, + { + "path": "node_modules/is-callable/package.json" + }, + { + "path": "node_modules/copy-descriptor/package.json" + }, + { + "path": "node_modules/util-deprecate/package.json" + }, + { + "path": "node_modules/gts/package.json" + }, + { + "path": "node_modules/gts/node_modules/has-flag/package.json" + }, + { + "path": "node_modules/gts/node_modules/color-name/package.json" + }, + { + "path": "node_modules/gts/node_modules/color-convert/package.json" + }, + { + "path": "node_modules/gts/node_modules/supports-color/package.json" + }, + { + "path": "node_modules/gts/node_modules/ansi-styles/package.json" + }, + { + "path": "node_modules/gts/node_modules/chalk/package.json" + }, + { + "path": "node_modules/require-directory/package.json" + }, + { + "path": "node_modules/update-notifier/package.json" + }, + { + "path": "node_modules/esprima/package.json" + }, + { + "path": "node_modules/string_decoder/package.json" + }, + { + "path": "node_modules/mocha/package.json" + }, + { + "path": "node_modules/mocha/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/mocha/node_modules/find-up/package.json" + }, + { + "path": "node_modules/mocha/node_modules/diff/package.json" + }, + { + "path": "node_modules/mocha/node_modules/yargs-parser/package.json" + }, + { + "path": "node_modules/mocha/node_modules/supports-color/package.json" + }, + { + "path": "node_modules/mocha/node_modules/which/package.json" + }, + { + "path": "node_modules/mocha/node_modules/path-exists/package.json" + }, + { + "path": "node_modules/mocha/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/mocha/node_modules/glob/package.json" + }, + { + "path": "node_modules/mocha/node_modules/ms/package.json" + }, + { + "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" + }, + { + "path": "node_modules/mocha/node_modules/yargs/package.json" + }, + { + "path": "node_modules/arr-diff/package.json" + }, + { + "path": "node_modules/is-arguments/package.json" + }, + { + "path": "node_modules/loader-utils/package.json" + }, + { + "path": "node_modules/core-util-is/package.json" + }, + { + "path": "node_modules/wrap-ansi/package.json" + }, + { + "path": "node_modules/minimist-options/package.json" + }, + { + "path": "node_modules/minimist-options/node_modules/arrify/package.json" + }, + { + "path": "node_modules/underscore/package.json" + }, + { + "path": "node_modules/keyv/package.json" + }, + { + "path": "node_modules/glob-parent/package.json" + }, + { + "path": "node_modules/domain-browser/package.json" + }, + { + "path": "node_modules/minimalistic-crypto-utils/package.json" + }, + { + "path": "node_modules/walkdir/package.json" + }, + { + "path": "node_modules/@protobufjs/codegen/package.json" + }, + { + "path": "node_modules/@protobufjs/inquire/package.json" + }, + { + "path": "node_modules/@protobufjs/float/package.json" + }, + { + "path": "node_modules/@protobufjs/base64/package.json" + }, + { + "path": "node_modules/@protobufjs/aspromise/package.json" + }, + { + "path": "node_modules/@protobufjs/eventemitter/package.json" + }, + { + "path": "node_modules/@protobufjs/fetch/package.json" + }, + { + "path": "node_modules/@protobufjs/utf8/package.json" + }, + { + "path": "node_modules/@protobufjs/path/package.json" + }, + { + "path": "node_modules/@protobufjs/pool/package.json" + }, + { + "path": "node_modules/global-dirs/package.json" + }, + { + "path": "node_modules/has-flag/package.json" + }, + { + "path": "node_modules/locate-path/package.json" + }, + { + "path": "node_modules/empower-assert/package.json" + }, + { + "path": "node_modules/convert-source-map/package.json" + }, + { + "path": "node_modules/terser/package.json" + }, + { + "path": "node_modules/terser/node_modules/source-map-support/package.json" + }, + { + "path": "node_modules/minimalistic-assert/package.json" + }, + { + "path": "node_modules/require-main-filename/package.json" + }, + { + "path": "node_modules/bluebird/package.json" + }, + { + "path": "node_modules/string.prototype.trimleft/package.json" + }, + { + "path": "node_modules/range-parser/package.json" + }, + { + "path": "node_modules/espower-loader/package.json" + }, + { + "path": "node_modules/null-loader/package.json" + }, + { + "path": "node_modules/defer-to-connect/package.json" + }, + { + "path": "node_modules/duplexer3/package.json" + }, + { + "path": "node_modules/indent-string/package.json" + }, + { + "path": "node_modules/detect-file/package.json" + }, + { + "path": "node_modules/eslint/package.json" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/README.md" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/package.json" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/index.js" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/LICENSE" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/lib/parse.js" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/lib/enoent.js" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js" + }, + { + "path": "node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json" + }, + { + "path": "node_modules/eslint/node_modules/path-key/package.json" + }, + { + "path": "node_modules/eslint/node_modules/which/package.json" + }, + { + "path": "node_modules/eslint/node_modules/shebang-regex/package.json" + }, + { + "path": "node_modules/eslint/node_modules/shebang-command/package.json" + }, + { + "path": "node_modules/eslint/node_modules/debug/package.json" + }, + { + "path": "node_modules/got/package.json" + }, + { + "path": "node_modules/got/node_modules/get-stream/package.json" + }, + { + "path": "node_modules/estraverse/package.json" + }, + { + "path": "node_modules/prr/package.json" + }, + { + "path": "node_modules/mdurl/package.json" + }, + { + "path": "node_modules/eslint-plugin-node/package.json" + }, + { + "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" + }, + { + "path": "node_modules/setimmediate/package.json" + }, + { + "path": "node_modules/diffie-hellman/package.json" + }, + { + "path": "node_modules/resolve-from/package.json" + }, + { + "path": "node_modules/pascalcase/package.json" + }, + { + "path": "node_modules/emojis-list/package.json" + }, + { + "path": "node_modules/https-browserify/package.json" + }, + { + "path": "node_modules/assign-symbols/package.json" + }, + { + "path": "node_modules/browserify-aes/package.json" + }, + { + "path": "node_modules/type-name/package.json" + }, + { + "path": "node_modules/os-locale/package.json" + }, + { + "path": "node_modules/os-locale/node_modules/cross-spawn/README.md" + }, + { + "path": "node_modules/os-locale/node_modules/cross-spawn/package.json" + }, + { + "path": "node_modules/os-locale/node_modules/cross-spawn/CHANGELOG.md" + }, + { + "path": "node_modules/os-locale/node_modules/cross-spawn/index.js" + }, + { + "path": "node_modules/os-locale/node_modules/cross-spawn/LICENSE" + }, + { + "path": "node_modules/os-locale/node_modules/cross-spawn/lib/parse.js" + }, + { + "path": "node_modules/os-locale/node_modules/cross-spawn/lib/enoent.js" + }, + { + "path": "node_modules/os-locale/node_modules/cross-spawn/lib/util/escape.js" + }, + { + "path": "node_modules/os-locale/node_modules/cross-spawn/lib/util/resolveCommand.js" + }, + { + "path": "node_modules/os-locale/node_modules/cross-spawn/lib/util/readShebang.js" + }, + { + "path": "node_modules/os-locale/node_modules/get-stream/package.json" + }, + { + "path": "node_modules/os-locale/node_modules/semver/package.json" + }, + { + "path": "node_modules/os-locale/node_modules/path-key/package.json" + }, + { + "path": "node_modules/os-locale/node_modules/which/package.json" + }, + { + "path": "node_modules/os-locale/node_modules/shebang-regex/package.json" + }, + { + "path": "node_modules/os-locale/node_modules/is-stream/package.json" + }, + { + "path": "node_modules/os-locale/node_modules/shebang-command/package.json" + }, + { + "path": "node_modules/os-locale/node_modules/execa/package.json" + }, + { + "path": "node_modules/lodash/package.json" + }, + { + "path": "node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/safe-buffer/package.json" + }, + { + "path": "node_modules/@szmarczak/http-timer/package.json" + }, + { + "path": "node_modules/parent-module/package.json" + }, + { + "path": "node_modules/object-keys/package.json" + }, + { + "path": "node_modules/split-string/package.json" + }, + { + "path": "node_modules/base/package.json" + }, + { + "path": "node_modules/base/node_modules/is-data-descriptor/package.json" + }, + { + "path": "node_modules/base/node_modules/is-descriptor/package.json" + }, + { + "path": "node_modules/base/node_modules/is-accessor-descriptor/package.json" + }, + { + "path": "node_modules/base/node_modules/define-property/package.json" + }, + { + "path": "node_modules/write/package.json" + }, + { + "path": "node_modules/configstore/package.json" + }, + { + "path": "node_modules/configstore/node_modules/write-file-atomic/package.json" + }, + { + "path": "node_modules/configstore/node_modules/pify/package.json" + }, + { + "path": "node_modules/configstore/node_modules/make-dir/package.json" + }, + { + "path": "node_modules/v8-to-istanbul/package.json" + }, + { + "path": "node_modules/v8-to-istanbul/node_modules/source-map/package.json" + }, + { + "path": "node_modules/dot-prop/package.json" + }, + { + "path": "node_modules/tsutils/package.json" + }, + { + "path": "node_modules/npm-bundled/package.json" + }, + { + "path": "node_modules/import-fresh/package.json" + }, + { + "path": "node_modules/mute-stream/package.json" + }, + { + "path": "node_modules/browserify-des/package.json" + }, + { + "path": "node_modules/wide-align/package.json" + }, + { + "path": "node_modules/wide-align/node_modules/string-width/package.json" + }, + { + "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/eslint-scope/package.json" + }, + { + "path": "node_modules/readdirp/package.json" + }, + { + "path": "node_modules/readdirp/node_modules/braces/package.json" + }, + { + "path": "node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/package.json" + }, + { + "path": "node_modules/readdirp/node_modules/to-regex-range/package.json" + }, + { + "path": "node_modules/readdirp/node_modules/is-buffer/package.json" + }, + { + "path": "node_modules/readdirp/node_modules/fill-range/package.json" + }, + { + "path": "node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/package.json" + }, + { + "path": "node_modules/readdirp/node_modules/micromatch/README.md" + }, + { + "path": "node_modules/readdirp/node_modules/micromatch/package.json" + }, + { + "path": "node_modules/readdirp/node_modules/micromatch/CHANGELOG.md" + }, + { + "path": "node_modules/readdirp/node_modules/micromatch/index.js" + }, + { + "path": "node_modules/readdirp/node_modules/micromatch/LICENSE" + }, + { + "path": "node_modules/readdirp/node_modules/micromatch/lib/parsers.js" + }, + { + "path": "node_modules/readdirp/node_modules/micromatch/lib/.DS_Store" + }, + { + "path": "node_modules/readdirp/node_modules/micromatch/lib/utils.js" + }, + { + "path": "node_modules/readdirp/node_modules/micromatch/lib/compilers.js" + }, + { + "path": "node_modules/readdirp/node_modules/micromatch/lib/cache.js" + }, + { + "path": "node_modules/readdirp/node_modules/is-number/package.json" + }, + { + "path": "node_modules/readdirp/node_modules/is-number/node_modules/kind-of/package.json" + }, + { + "path": "node_modules/cache-base/package.json" + }, + { + "path": "node_modules/is-promise/package.json" + }, + { + "path": "node_modules/parallel-transform/package.json" + }, + { + "path": "node_modules/es6-map/package.json" + }, + { + "path": "node_modules/p-finally/package.json" + }, + { + "path": "node_modules/snapdragon-node/package.json" + }, + { + "path": "node_modules/snapdragon-node/node_modules/is-data-descriptor/package.json" + }, + { + "path": "node_modules/snapdragon-node/node_modules/is-descriptor/package.json" + }, + { + "path": "node_modules/snapdragon-node/node_modules/is-accessor-descriptor/package.json" + }, + { + "path": "node_modules/snapdragon-node/node_modules/define-property/package.json" + }, + { + "path": "node_modules/browserify-cipher/package.json" + }, + { + "path": "node_modules/es6-set/package.json" + }, + { + "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" + }, + { + "path": "node_modules/array-find/package.json" + }, + { + "path": "node_modules/arr-flatten/package.json" + }, + { + "path": "node_modules/evp_bytestokey/package.json" + }, + { + "path": "node_modules/js2xmlparser/package.json" + }, + { + "path": "node_modules/has-value/package.json" + }, + { + "path": "node_modules/istanbul-reports/package.json" + }, + { + "path": "node_modules/tty-browserify/package.json" + }, + { + "path": "node_modules/get-value/package.json" + }, + { + "path": "node_modules/@webassemblyjs/wasm-gen/package.json" + }, + { + "path": "node_modules/@webassemblyjs/helper-fsm/package.json" + }, + { + "path": "node_modules/@webassemblyjs/floating-point-hex-parser/package.json" + }, + { + "path": "node_modules/@webassemblyjs/helper-code-frame/package.json" + }, + { + "path": "node_modules/@webassemblyjs/helper-wasm-section/package.json" + }, + { + "path": "node_modules/@webassemblyjs/ast/package.json" + }, + { + "path": "node_modules/@webassemblyjs/wast-printer/package.json" + }, + { + "path": "node_modules/@webassemblyjs/helper-module-context/package.json" + }, + { + "path": "node_modules/@webassemblyjs/wasm-edit/package.json" + }, + { + "path": "node_modules/@webassemblyjs/leb128/package.json" + }, + { + "path": "node_modules/@webassemblyjs/wast-parser/package.json" + }, + { + "path": "node_modules/@webassemblyjs/ieee754/package.json" + }, + { + "path": "node_modules/@webassemblyjs/wasm-opt/package.json" + }, + { + "path": "node_modules/@webassemblyjs/utf8/package.json" + }, + { + "path": "node_modules/@webassemblyjs/helper-buffer/package.json" + }, + { + "path": "node_modules/@webassemblyjs/helper-wasm-bytecode/package.json" + }, + { + "path": "node_modules/@webassemblyjs/wasm-parser/package.json" + }, + { + "path": "node_modules/@webassemblyjs/helper-api-error/package.json" + }, + { + "path": "node_modules/indexof/package.json" + }, + { + "path": "node_modules/is-data-descriptor/package.json" + }, + { + "path": "node_modules/is-data-descriptor/node_modules/is-buffer/package.json" + }, + { + "path": "node_modules/is-data-descriptor/node_modules/kind-of/package.json" + }, + { + "path": "node_modules/progress/package.json" + }, + { + "path": "node_modules/registry-url/package.json" + }, + { + "path": "node_modules/google-gax/package.json" + }, + { + "path": "node_modules/class-utils/package.json" + }, + { + "path": "node_modules/class-utils/node_modules/define-property/package.json" + }, + { + "path": "node_modules/mimic-response/package.json" + }, + { + "path": "node_modules/figures/package.json" + }, + { + "path": "node_modules/eslint-config-prettier/package.json" + }, + { + "path": "node_modules/argparse/package.json" + }, + { + "path": "node_modules/type/package.json" + }, + { + "path": "node_modules/domhandler/package.json" + }, + { + "path": "node_modules/error-ex/package.json" + }, + { + "path": "node_modules/to-object-path/package.json" + }, + { + "path": "node_modules/to-object-path/node_modules/is-buffer/package.json" + }, + { + "path": "node_modules/to-object-path/node_modules/kind-of/package.json" + }, + { + "path": "node_modules/errno/package.json" + }, + { + "path": "node_modules/ansi-colors/package.json" + }, + { + "path": "node_modules/safer-buffer/package.json" + }, + { + "path": "node_modules/object.pick/package.json" + }, + { + "path": "node_modules/type-fest/package.json" + }, + { + "path": "node_modules/posix-character-classes/package.json" + }, + { + "path": "node_modules/strip-indent/package.json" + }, + { + "path": "node_modules/boxen/package.json" + }, + { + "path": "node_modules/boxen/node_modules/type-fest/package.json" + }, + { + "path": "node_modules/flat-cache/package.json" + }, + { + "path": "node_modules/flat-cache/node_modules/rimraf/package.json" + }, + { + "path": "node_modules/process/package.json" + }, + { + "path": "node_modules/querystring-es3/package.json" + }, + { + "path": "node_modules/ripemd160/package.json" + }, + { + "path": "node_modules/findup-sync/package.json" + }, + { + "path": "node_modules/findup-sync/node_modules/braces/package.json" + }, + { + "path": "node_modules/findup-sync/node_modules/braces/node_modules/extend-shallow/package.json" + }, + { + "path": "node_modules/findup-sync/node_modules/to-regex-range/package.json" + }, + { + "path": "node_modules/findup-sync/node_modules/is-buffer/package.json" + }, + { + "path": "node_modules/findup-sync/node_modules/fill-range/package.json" + }, + { + "path": "node_modules/findup-sync/node_modules/fill-range/node_modules/extend-shallow/package.json" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/README.md" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/package.json" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/CHANGELOG.md" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/index.js" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/LICENSE" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/lib/parsers.js" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/lib/.DS_Store" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/lib/utils.js" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/lib/compilers.js" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/lib/cache.js" + }, + { + "path": "node_modules/findup-sync/node_modules/is-number/package.json" + }, + { + "path": "node_modules/findup-sync/node_modules/is-number/node_modules/kind-of/package.json" + }, + { + "path": "node_modules/has-symbols/package.json" + }, + { + "path": "node_modules/gcp-metadata/package.json" + }, + { + "path": "node_modules/ansi-align/package.json" + }, + { + "path": "node_modules/find-up/package.json" + }, + { + "path": "node_modules/log-symbols/package.json" + }, + { + "path": "node_modules/merge-estraverse-visitors/package.json" + }, + { + "path": "node_modules/is-extglob/package.json" + }, + { + "path": "node_modules/json-stable-stringify-without-jsonify/package.json" + }, + { + "path": "node_modules/prettier/package.json" + }, + { + "path": "node_modules/jsonexport/package.json" + }, + { + "path": "node_modules/watchpack/package.json" + }, + { + "path": "node_modules/.bin/sha.js" + }, + { + "path": "node_modules/safe-regex/package.json" + }, + { + "path": "node_modules/wrappy/package.json" + }, + { + "path": "node_modules/npm-run-path/package.json" + }, + { + "path": "node_modules/npm-run-path/node_modules/path-key/package.json" + }, + { + "path": "node_modules/mississippi/package.json" + }, + { + "path": "node_modules/mississippi/node_modules/through2/package.json" + }, + { + "path": "node_modules/promise-inflight/package.json" + }, + { + "path": "node_modules/browserify-sign/package.json" + }, + { + "path": "node_modules/map-obj/package.json" + }, + { + "path": "node_modules/term-size/package.json" + }, + { + "path": "node_modules/pbkdf2/package.json" + }, + { + "path": "node_modules/stream-http/package.json" + }, + { + "path": "node_modules/destroy/package.json" + }, + { + "path": "node_modules/growl/package.json" + }, + { + "path": "node_modules/flush-write-stream/package.json" + }, + { + "path": "node_modules/json-schema-traverse/package.json" + }, + { + "path": "node_modules/npm-packlist/package.json" + }, + { + "path": "node_modules/taffydb/package.json" + }, + { + "path": "node_modules/cross-spawn/package.json" + }, + { + "path": "node_modules/loud-rejection/package.json" + }, + { + "path": "node_modules/is-glob/package.json" + }, + { + "path": "node_modules/get-stream/package.json" + }, + { + "path": "node_modules/uglify-js/package.json" + }, + { + "path": "node_modules/minipass/package.json" + }, + { + "path": "node_modules/minipass/node_modules/yallist/package.json" + }, + { + "path": "node_modules/repeat-element/package.json" + }, + { + "path": "node_modules/optimist/package.json" + }, + { + "path": "node_modules/empower/package.json" + }, + { + "path": "node_modules/cacheable-request/package.json" + }, + { + "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" + }, + { + "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" + }, + { + "path": "node_modules/is-ci/package.json" + }, + { + "path": "node_modules/server-destroy/package.json" + }, + { + "path": "node_modules/copy-concurrently/package.json" + }, + { + "path": "node_modules/copy-concurrently/node_modules/rimraf/package.json" + }, + { + "path": "node_modules/import-local/package.json" + }, + { + "path": "node_modules/json-parse-better-errors/package.json" + }, + { + "path": "node_modules/iferr/package.json" + }, + { + "path": "node_modules/core-js/package.json" + }, + { + "path": "node_modules/set-blocking/package.json" + }, + { + "path": "node_modules/p-defer/package.json" + }, + { + "path": "node_modules/create-hmac/package.json" + }, + { + "path": "node_modules/next-tick/package.json" + }, + { + "path": "node_modules/catharsis/package.json" + }, + { + "path": "node_modules/rimraf/package.json" + }, + { + "path": "node_modules/agent-base/package.json" + }, + { + "path": "node_modules/json-bigint/package.json" + }, + { + "path": "node_modules/spdx-exceptions/package.json" + }, + { + "path": "node_modules/color-name/package.json" + }, + { + "path": "node_modules/through/package.json" + }, + { + "path": "node_modules/braces/package.json" + }, + { + "path": "node_modules/jws/package.json" + }, + { + "path": "node_modules/inquirer/package.json" + }, + { + "path": "node_modules/inquirer/node_modules/string-width/package.json" + }, + { + "path": "node_modules/inquirer/node_modules/string-width/node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/inquirer/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/inquirer/node_modules/emoji-regex/package.json" + }, + { + "path": "node_modules/inquirer/node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/urix/package.json" + }, + { + "path": "node_modules/etag/package.json" + }, + { + "path": "node_modules/power-assert-formatter/package.json" + }, + { + "path": "node_modules/to-regex-range/package.json" + }, + { + "path": "node_modules/text-table/package.json" + }, + { + "path": "node_modules/color-convert/package.json" + }, + { + "path": "node_modules/escope/package.json" + }, + { + "path": "node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/is-installed-globally/package.json" + }, + { + "path": "node_modules/builtin-status-codes/package.json" + }, + { + "path": "node_modules/memory-fs/package.json" + }, + { + "path": "node_modules/redent/package.json" + }, + { + "path": "node_modules/schema-utils/package.json" + }, + { + "path": "node_modules/is-buffer/package.json" + }, + { + "path": "node_modules/esrecurse/package.json" + }, + { + "path": "node_modules/tslint/package.json" + }, + { + "path": "node_modules/tslint/node_modules/semver/package.json" + }, + { + "path": "node_modules/decamelize/package.json" + }, + { + "path": "node_modules/parse-json/package.json" + }, + { + "path": "node_modules/mime/package.json" + }, + { + "path": "node_modules/google-auth-library/package.json" + }, + { + "path": "node_modules/decode-uri-component/package.json" + }, + { + "path": "node_modules/randomfill/package.json" + }, + { + "path": "node_modules/ignore/package.json" + }, + { + "path": "node_modules/loader-runner/package.json" + }, + { + "path": "node_modules/homedir-polyfill/package.json" + }, + { + "path": "node_modules/depd/package.json" + }, + { + "path": "node_modules/union-value/package.json" + }, + { + "path": "node_modules/camelcase-keys/package.json" + }, + { + "path": "node_modules/camelcase-keys/node_modules/camelcase/package.json" + }, + { + "path": "node_modules/ansi-escapes/package.json" + }, + { + "path": "node_modules/concat-stream/package.json" + }, + { + "path": "node_modules/is-descriptor/package.json" + }, + { + "path": "node_modules/is-descriptor/node_modules/kind-of/package.json" + }, + { + "path": "node_modules/expand-brackets/package.json" + }, + { + "path": "node_modules/expand-brackets/node_modules/extend-shallow/package.json" + }, + { + "path": "node_modules/expand-brackets/node_modules/define-property/package.json" + }, + { + "path": "node_modules/expand-brackets/node_modules/ms/package.json" + }, + { + "path": "node_modules/expand-brackets/node_modules/debug/package.json" + }, + { + "path": "node_modules/decompress-response/package.json" + }, + { + "path": "node_modules/end-of-stream/package.json" + }, + { + "path": "node_modules/diff-match-patch/package.json" + }, + { + "path": "node_modules/big.js/package.json" + }, + { + "path": "node_modules/amdefine/package.json" + }, + { + "path": "node_modules/event-emitter/package.json" + }, + { + "path": "node_modules/has-values/package.json" + }, + { + "path": "node_modules/has-values/node_modules/is-buffer/package.json" + }, + { + "path": "node_modules/has-values/node_modules/kind-of/package.json" + }, + { + "path": "node_modules/has-values/node_modules/is-number/package.json" + }, + { + "path": "node_modules/has-values/node_modules/is-number/node_modules/kind-of/package.json" + }, + { + "path": "node_modules/is-windows/package.json" + }, + { + "path": "node_modules/diff/package.json" + }, + { + "path": "node_modules/tmp/package.json" + }, + { + "path": "node_modules/public-encrypt/package.json" + }, + { + "path": "node_modules/source-map/package.json" + }, + { + "path": "node_modules/is-obj/package.json" + }, + { + "path": "node_modules/asn1.js/package.json" + }, + { + "path": "node_modules/buffer/package.json" + }, + { + "path": "node_modules/yargs-parser/package.json" + }, + { + "path": "node_modules/escape-string-regexp/package.json" + }, + { + "path": "node_modules/es-abstract/package.json" + }, + { + "path": "node_modules/linkinator/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/has-flag/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/color-name/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/color-convert/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/supports-color/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/ansi-styles/package.json" + }, + { + "path": "node_modules/linkinator/node_modules/chalk/package.json" + }, + { + "path": "node_modules/import-lazy/package.json" + }, + { + "path": "node_modules/inflight/package.json" + }, + { + "path": "node_modules/use/package.json" + }, + { + "path": "node_modules/concat-map/package.json" + }, + { + "path": "node_modules/browserify-rsa/package.json" + }, + { + "path": "node_modules/object.assign/package.json" + }, + { + "path": "node_modules/es6-symbol/package.json" + }, + { + "path": "node_modules/hash.js/package.json" + }, + { + "path": "node_modules/expand-tilde/package.json" + }, + { + "path": "node_modules/semver/package.json" + }, + { + "path": "node_modules/jsdoc-fresh/package.json" + }, + { + "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" + }, + { + "path": "node_modules/ts-loader/package.json" + }, + { + "path": "node_modules/is-typedarray/package.json" + }, + { + "path": "node_modules/resolve-cwd/package.json" + }, + { + "path": "node_modules/resolve-cwd/node_modules/resolve-from/package.json" + }, + { + "path": "node_modules/htmlparser2/package.json" + }, + { + "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" + }, + { + "path": "node_modules/cli-boxes/package.json" + }, + { + "path": "node_modules/supports-color/package.json" + }, + { + "path": "node_modules/path-key/package.json" + }, + { + "path": "node_modules/lru-cache/package.json" + }, + { + "path": "node_modules/rc/package.json" + }, + { + "path": "node_modules/rc/node_modules/minimist/package.json" + }, + { + "path": "node_modules/rc/node_modules/strip-json-comments/package.json" + }, + { + "path": "node_modules/yargs-unparser/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/find-up/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/yargs-parser/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/path-exists/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/yargs/package.json" + }, + { + "path": "node_modules/worker-farm/package.json" + }, + { + "path": "node_modules/extend-shallow/package.json" + }, + { + "path": "node_modules/extend-shallow/node_modules/is-extendable/package.json" + }, + { + "path": "node_modules/abort-controller/package.json" + }, + { + "path": "node_modules/http-errors/package.json" + }, + { + "path": "node_modules/marked/package.json" + }, + { + "path": "node_modules/is-plain-obj/package.json" + }, + { + "path": "node_modules/minimatch/package.json" + }, + { + "path": "node_modules/parse-asn1/package.json" + }, + { + "path": "node_modules/send/package.json" + }, + { + "path": "node_modules/send/node_modules/mime/package.json" + }, + { + "path": "node_modules/send/node_modules/ms/package.json" + }, + { + "path": "node_modules/send/node_modules/debug/package.json" + }, + { + "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" + }, + { + "path": "node_modules/css-select/package.json" + }, + { + "path": "node_modules/uri-js/package.json" + }, + { + "path": "node_modules/google-p12-pem/package.json" + }, + { + "path": "node_modules/is-accessor-descriptor/package.json" + }, + { + "path": "node_modules/is-accessor-descriptor/node_modules/is-buffer/package.json" + }, + { + "path": "node_modules/is-accessor-descriptor/node_modules/kind-of/package.json" + }, + { + "path": "node_modules/component-emitter/package.json" + }, + { + "path": "node_modules/hmac-drbg/package.json" + }, + { + "path": "node_modules/npm-normalize-package-bin/package.json" + }, + { + "path": "node_modules/spdx-license-ids/package.json" + }, + { + "path": "node_modules/yallist/package.json" + }, + { + "path": "node_modules/setprototypeof/package.json" + }, + { + "path": "node_modules/hosted-git-info/package.json" + }, + { + "path": "node_modules/package-json/package.json" + }, + { + "path": "node_modules/from2/package.json" + }, + { + "path": "node_modules/elliptic/package.json" + }, + { + "path": "node_modules/write-file-atomic/package.json" + }, + { + "path": "node_modules/array-unique/package.json" + }, + { + "path": "node_modules/external-editor/package.json" + }, + { + "path": "node_modules/@sindresorhus/is/package.json" + }, + { + "path": "node_modules/lodash.camelcase/package.json" + }, + { + "path": "node_modules/path-dirname/package.json" + }, + { + "path": "node_modules/arrify/package.json" + }, + { + "path": "node_modules/ansi-styles/package.json" + }, + { + "path": "node_modules/parseurl/package.json" + }, + { + "path": "node_modules/boolbase/package.json" + }, + { + "path": "node_modules/cliui/package.json" + }, + { + "path": "node_modules/balanced-match/package.json" + }, + { + "path": "node_modules/acorn/package.json" + }, + { + "path": "node_modules/stream-browserify/package.json" + }, + { + "path": "node_modules/load-json-file/package.json" + }, + { + "path": "node_modules/load-json-file/node_modules/pify/package.json" + }, + { + "path": "node_modules/builtin-modules/package.json" + }, + { + "path": "node_modules/chokidar/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/glob-parent/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/glob-parent/node_modules/is-glob/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/braces/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/to-regex-range/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/is-buffer/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/extend-shallow/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/kind-of/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/fill-range/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/is-number/package.json" + }, + { + "path": "node_modules/atob/package.json" + }, + { + "path": "node_modules/mamacro/package.json" + }, + { + "path": "node_modules/snapdragon/README.md" + }, + { + "path": "node_modules/snapdragon/package.json" + }, + { + "path": "node_modules/snapdragon/index.js" + }, + { + "path": "node_modules/snapdragon/LICENSE" + }, + { + "path": "node_modules/snapdragon/lib/compiler.js" + }, + { + "path": "node_modules/snapdragon/lib/position.js" + }, + { + "path": "node_modules/snapdragon/lib/parser.js" + }, + { + "path": "node_modules/snapdragon/lib/source-maps.js" + }, + { + "path": "node_modules/snapdragon/lib/utils.js" + }, + { + "path": "node_modules/snapdragon/node_modules/source-map/package.json" + }, + { + "path": "node_modules/snapdragon/node_modules/extend-shallow/package.json" + }, + { + "path": "node_modules/snapdragon/node_modules/define-property/package.json" + }, + { + "path": "node_modules/snapdragon/node_modules/ms/package.json" + }, + { + "path": "node_modules/snapdragon/node_modules/debug/package.json" + }, + { + "path": "node_modules/widest-line/package.json" + }, + { + "path": "node_modules/widest-line/node_modules/string-width/package.json" + }, + { + "path": "node_modules/widest-line/node_modules/strip-ansi/package.json" + }, + { + "path": "node_modules/widest-line/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/which/package.json" + }, + { + "path": "node_modules/@bcoe/v8-coverage/package.json" + }, + { + "path": "node_modules/assert/package.json" + }, + { + "path": "node_modules/assert/node_modules/inherits/package.json" + }, + { + "path": "node_modules/assert/node_modules/util/package.json" + }, + { + "path": "node_modules/prettier-linter-helpers/package.json" + }, + { + "path": "node_modules/object-inspect/package.json" + }, + { + "path": "node_modules/retry-request/package.json" + }, + { + "path": "node_modules/retry-request/node_modules/debug/package.json" + }, + { + "path": "node_modules/is-arrayish/package.json" + }, + { + "path": "node_modules/shebang-regex/package.json" + }, + { + "path": "node_modules/clone-response/package.json" + }, + { + "path": "node_modules/ssri/package.json" + }, + { + "path": "node_modules/deep-is/package.json" + }, + { + "path": "node_modules/@xtuc/ieee754/package.json" + }, + { + "path": "node_modules/@xtuc/long/package.json" + }, + { + "path": "node_modules/regexpp/package.json" + }, + { + "path": "node_modules/sha.js/README.md" + }, + { + "path": "node_modules/sha.js/package.json" + }, + { + "path": "node_modules/sha.js/hash.js" + }, + { + "path": "node_modules/sha.js/.travis.yml" + }, + { + "path": "node_modules/sha.js/sha224.js" + }, + { + "path": "node_modules/sha.js/sha512.js" + }, + { + "path": "node_modules/sha.js/bin.js" + }, + { + "path": "node_modules/sha.js/sha.js" + }, + { + "path": "node_modules/sha.js/index.js" + }, + { + "path": "node_modules/sha.js/sha384.js" + }, + { + "path": "node_modules/sha.js/sha1.js" + }, + { + "path": "node_modules/sha.js/sha256.js" + }, + { + "path": "node_modules/sha.js/LICENSE" + }, + { + "path": "node_modules/sha.js/test/vectors.js" + }, + { + "path": "node_modules/sha.js/test/test.js" + }, + { + "path": "node_modules/sha.js/test/hash.js" + }, + { + "path": "node_modules/node-forge/package.json" + }, + { + "path": "node_modules/pako/package.json" + }, + { + "path": "node_modules/power-assert/package.json" + }, + { + "path": "node_modules/path-is-absolute/package.json" + }, + { + "path": "node_modules/ignore-walk/package.json" + }, + { + "path": "node_modules/finalhandler/package.json" + }, + { + "path": "node_modules/finalhandler/node_modules/ms/package.json" + }, + { + "path": "node_modules/finalhandler/node_modules/debug/package.json" + }, + { + "path": "node_modules/source-map-support/package.json" + }, + { + "path": "node_modules/source-map-support/node_modules/source-map/package.json" + }, + { + "path": "node_modules/buffer-equal-constant-time/package.json" + }, + { + "path": "node_modules/source-map-resolve/package.json" + }, + { + "path": "node_modules/path-parse/package.json" + }, + { + "path": "node_modules/binary-extensions/package.json" + }, + { + "path": "node_modules/decamelize-keys/package.json" + }, + { + "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" + }, + { + "path": "node_modules/os-tmpdir/package.json" + }, + { + "path": "node_modules/kind-of/package.json" + }, + { + "path": "node_modules/power-assert-util-string-width/package.json" + }, + { + "path": "node_modules/ajv-keywords/package.json" + }, + { + "path": "node_modules/url-parse-lax/package.json" + }, + { + "path": "node_modules/linkify-it/package.json" + }, + { + "path": "node_modules/url/package.json" + }, + { + "path": "node_modules/url/node_modules/punycode/package.json" + }, + { + "path": "node_modules/async-each/package.json" + }, + { + "path": "node_modules/minimist/package.json" + }, + { + "path": "node_modules/buffer-xor/package.json" + }, + { + "path": "node_modules/fresh/package.json" + }, + { + "path": "node_modules/power-assert-context-formatter/package.json" + }, + { + "path": "node_modules/is-stream/package.json" + }, + { + "path": "node_modules/call-matcher/package.json" + }, + { + "path": "node_modules/is-stream-ended/package.json" + }, + { + "path": "node_modules/slice-ansi/package.json" + }, + { + "path": "node_modules/onetime/package.json" + }, + { + "path": "node_modules/spdx-correct/package.json" + }, + { + "path": "node_modules/fast-deep-equal/package.json" + }, + { + "path": "node_modules/readable-stream/package.json" + }, + { + "path": "node_modules/xdg-basedir/package.json" + }, + { + "path": "node_modules/v8-compile-cache/package.json" + }, + { + "path": "node_modules/callsites/package.json" + }, + { + "path": "node_modules/power-assert-renderer-assertion/package.json" + }, + { + "path": "node_modules/pify/package.json" + }, + { + "path": "node_modules/source-map-url/package.json" + }, + { + "path": "node_modules/snapdragon-util/package.json" + }, + { + "path": "node_modules/snapdragon-util/node_modules/is-buffer/package.json" + }, + { + "path": "node_modules/snapdragon-util/node_modules/kind-of/package.json" + }, + { + "path": "node_modules/stream-shift/package.json" + }, + { + "path": "node_modules/crypto-random-string/package.json" + }, + { + "path": "node_modules/escodegen/package.json" + }, + { + "path": "node_modules/escodegen/node_modules/esprima/package.json" + }, + { + "path": "node_modules/entities/package.json" + }, + { + "path": "node_modules/object.getownpropertydescriptors/package.json" + }, + { + "path": "node_modules/power-assert-renderer-file/package.json" + }, + { + "path": "node_modules/events/package.json" + }, + { + "path": "node_modules/define-property/package.json" + }, + { + "path": "node_modules/define-property/node_modules/is-data-descriptor/package.json" + }, + { + "path": "node_modules/define-property/node_modules/is-descriptor/package.json" + }, + { + "path": "node_modules/define-property/node_modules/is-accessor-descriptor/package.json" + }, + { + "path": "node_modules/unpipe/package.json" + }, + { + "path": "node_modules/array-filter/package.json" + }, + { + "path": "node_modules/furi/package.json" + }, + { + "path": "node_modules/pack-n-play/package.json" + }, + { + "path": "node_modules/pack-n-play/node_modules/tmp/package.json" + }, + { + "path": "node_modules/pack-n-play/node_modules/tmp/node_modules/rimraf/package.json" + }, + { + "path": "node_modules/miller-rabin/package.json" + }, + { + "path": "node_modules/strip-eof/package.json" + }, + { + "path": "node_modules/map-cache/package.json" + }, + { + "path": "node_modules/is-path-inside/package.json" + }, + { + "path": "node_modules/ini/package.json" + }, + { + "path": "node_modules/currently-unhandled/package.json" + }, + { + "path": "node_modules/global-modules/package.json" + }, + { + "path": "node_modules/global-modules/node_modules/which/package.json" + }, + { + "path": "node_modules/global-modules/node_modules/global-prefix/package.json" + }, + { + "path": "node_modules/invert-kv/package.json" + }, + { + "path": "node_modules/validate-npm-package-license/package.json" + }, + { + "path": "node_modules/fill-range/package.json" + }, + { + "path": "node_modules/bignumber.js/package.json" + }, + { + "path": "node_modules/is-yarn-global/package.json" + }, + { + "path": "node_modules/lodash.has/package.json" + }, + { + "path": "node_modules/camelcase/package.json" + }, + { + "path": "node_modules/prelude-ls/package.json" + }, + { + "path": "node_modules/es6-promise/package.json" + }, + { + "path": "node_modules/doctrine/package.json" + }, + { + "path": "node_modules/path-exists/package.json" + }, + { + "path": "node_modules/deep-extend/package.json" + }, + { + "path": "node_modules/os-browserify/package.json" + }, + { + "path": "node_modules/nth-check/package.json" + }, + { + "path": "node_modules/regex-not/package.json" + }, + { + "path": "node_modules/isarray/package.json" + }, + { + "path": "node_modules/es-to-primitive/package.json" + }, + { + "path": "node_modules/https-proxy-agent/package.json" + }, + { + "path": "node_modules/to-regex/package.json" + }, + { + "path": "node_modules/eslint-plugin-es/package.json" + }, + { + "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" + }, + { + "path": "node_modules/path-type/package.json" + }, + { + "path": "node_modules/path-type/node_modules/pify/package.json" + }, + { + "path": "node_modules/fs-minipass/package.json" + }, + { + "path": "node_modules/pumpify/package.json" + }, + { + "path": "node_modules/pumpify/node_modules/pump/package.json" + }, + { + "path": "node_modules/fast-json-stable-stringify/package.json" + }, + { + "path": "node_modules/p-locate/package.json" + }, + { + "path": "node_modules/stream-each/package.json" + }, + { + "path": "node_modules/enhanced-resolve/package.json" + }, + { + "path": "node_modules/intelli-espower-loader/package.json" + }, + { + "path": "node_modules/node-fetch/package.json" + }, + { + "path": "node_modules/registry-auth-token/package.json" + }, + { + "path": "node_modules/repeat-string/package.json" + }, + { + "path": "node_modules/terser-webpack-plugin/package.json" + }, + { + "path": "node_modules/fragment-cache/package.json" + }, + { + "path": "node_modules/esutils/package.json" + }, + { + "path": "node_modules/run-queue/package.json" + }, + { + "path": "node_modules/which-module/package.json" + }, + { + "path": "node_modules/function-bind/package.json" + }, + { + "path": "node_modules/lcid/package.json" + }, + { + "path": "node_modules/map-visit/package.json" + }, + { + "path": "node_modules/trim-newlines/package.json" + }, + { + "path": "node_modules/event-target-shim/package.json" + }, + { + "path": "node_modules/commondir/package.json" + }, + { + "path": "node_modules/unset-value/package.json" + }, + { + "path": "node_modules/unset-value/node_modules/has-value/package.json" + }, + { + "path": "node_modules/unset-value/node_modules/has-value/node_modules/isobject/package.json" + }, + { + "path": "node_modules/unset-value/node_modules/has-values/package.json" + }, + { + "path": "node_modules/parse-passwd/package.json" + }, + { + "path": "node_modules/on-finished/package.json" + }, + { + "path": "node_modules/y18n/package.json" + }, + { + "path": "node_modules/cacache/package.json" + }, + { + "path": "node_modules/cacache/node_modules/rimraf/package.json" + }, + { + "path": "node_modules/quick-lru/package.json" + }, + { + "path": "node_modules/js-yaml/package.json" + }, + { + "path": "node_modules/flat/package.json" + }, + { + "path": "node_modules/normalize-package-data/package.json" + }, + { + "path": "node_modules/normalize-package-data/node_modules/semver/package.json" + }, + { + "path": "node_modules/es6-iterator/package.json" + }, + { + "path": "node_modules/remove-trailing-separator/package.json" + }, + { + "path": "node_modules/typescript/package.json" + }, + { + "path": "node_modules/mkdirp/package.json" + }, + { + "path": "node_modules/mkdirp/node_modules/minimist/package.json" + }, + { + "path": "node_modules/chrome-trace-event/package.json" + }, + { + "path": "node_modules/console-browserify/package.json" + }, + { + "path": "node_modules/fast-text-encoding/package.json" + }, + { + "path": "node_modules/acorn-es7-plugin/package.json" + }, + { + "path": "node_modules/through2/package.json" + }, + { + "path": "node_modules/eslint-visitor-keys/package.json" + }, + { + "path": "node_modules/glob/package.json" + }, + { + "path": "node_modules/inherits/package.json" + }, + { + "path": "node_modules/object-copy/package.json" + }, + { + "path": "node_modules/object-copy/node_modules/is-buffer/package.json" + }, + { + "path": "node_modules/object-copy/node_modules/kind-of/package.json" + }, + { + "path": "node_modules/object-copy/node_modules/define-property/package.json" + }, + { + "path": "node_modules/string.prototype.trimright/package.json" + }, + { + "path": "node_modules/punycode/package.json" + }, + { + "path": "node_modules/es5-ext/package.json" + }, + { + "path": "node_modules/is-date-object/package.json" + }, + { + "path": "node_modules/sprintf-js/package.json" + }, + { + "path": "node_modules/is-npm/package.json" + }, + { + "path": "node_modules/has-yarn/package.json" + }, + { + "path": "node_modules/get-stdin/package.json" + }, + { + "path": "node_modules/global-prefix/package.json" + }, + { + "path": "node_modules/global-prefix/node_modules/which/package.json" + }, + { + "path": "node_modules/extglob/package.json" + }, + { + "path": "node_modules/extglob/node_modules/is-data-descriptor/package.json" + }, + { + "path": "node_modules/extglob/node_modules/is-descriptor/package.json" + }, + { + "path": "node_modules/extglob/node_modules/extend-shallow/package.json" + }, + { + "path": "node_modules/extglob/node_modules/is-accessor-descriptor/package.json" + }, + { + "path": "node_modules/extglob/node_modules/define-property/package.json" + }, + { + "path": "node_modules/ajv-errors/package.json" + }, + { + "path": "node_modules/node-libs-browser/package.json" + }, + { + "path": "node_modules/node-libs-browser/node_modules/punycode/package.json" + }, + { + "path": "node_modules/constants-browserify/package.json" + }, + { + "path": "node_modules/shebang-command/package.json" + }, + { + "path": "node_modules/empower-core/package.json" + }, + { + "path": "node_modules/imurmurhash/package.json" + }, + { + "path": "node_modules/globals/package.json" + }, + { + "path": "node_modules/create-ecdh/package.json" + }, + { + "path": "node_modules/latest-version/package.json" + }, + { + "path": "node_modules/natural-compare/package.json" + }, + { + "path": "node_modules/commander/package.json" + }, + { + "path": "node_modules/timers-browserify/package.json" + }, + { + "path": "node_modules/path-is-inside/package.json" + }, + { + "path": "node_modules/rxjs/package.json" + }, + { + "path": "node_modules/node-environment-flags/package.json" + }, + { + "path": "node_modules/node-environment-flags/node_modules/semver/package.json" + }, + { + "path": "node_modules/p-limit/package.json" + }, + { + "path": "node_modules/call-signature/package.json" + }, + { + "path": "node_modules/istanbul-lib-coverage/package.json" + }, + { + "path": "node_modules/neo-async/package.json" + }, + { + "path": "node_modules/foreground-child/package.json" + }, + { + "path": "node_modules/des.js/package.json" + }, + { + "path": "node_modules/he/package.json" + }, + { + "path": "node_modules/tar/package.json" + }, + { + "path": "node_modules/tar/node_modules/yallist/package.json" + }, + { + "path": "node_modules/meow/package.json" + }, + { + "path": "node_modules/meow/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/meow/node_modules/find-up/package.json" + }, + { + "path": "node_modules/meow/node_modules/yargs-parser/package.json" + }, + { + "path": "node_modules/meow/node_modules/camelcase/package.json" + }, + { + "path": "node_modules/meow/node_modules/path-exists/package.json" + }, + { + "path": "node_modules/meow/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/meow/node_modules/p-limit/package.json" + }, + { + "path": "node_modules/meow/node_modules/p-try/package.json" + }, + { + "path": "node_modules/meow/node_modules/read-pkg-up/package.json" + }, + { + "path": "node_modules/chownr/package.json" + }, + { + "path": "node_modules/toidentifier/package.json" + }, + { + "path": "node_modules/execa/package.json" + }, + { + "path": "node_modules/execa/node_modules/cross-spawn/package.json" + }, + { + "path": "node_modules/execa/node_modules/lru-cache/package.json" + }, + { + "path": "node_modules/execa/node_modules/yallist/package.json" + }, + { + "path": "node_modules/execa/node_modules/which/package.json" + }, + { + "path": "node_modules/execa/node_modules/shebang-regex/package.json" + }, + { + "path": "node_modules/execa/node_modules/is-stream/package.json" + }, + { + "path": "node_modules/execa/node_modules/shebang-command/package.json" + }, + { + "path": "node_modules/levn/package.json" + }, + { + "path": "node_modules/unique-string/package.json" + }, + { + "path": "node_modules/gaxios/package.json" + }, + { + "path": "node_modules/create-hash/package.json" + }, + { + "path": "node_modules/figgy-pudding/package.json" + }, + { + "path": "node_modules/power-assert-renderer-base/package.json" + }, + { + "path": "node_modules/browser-stdout/package.json" + }, + { + "path": "node_modules/regexp.prototype.flags/package.json" + }, + { + "path": "node_modules/ieee754/package.json" + }, + { + "path": "node_modules/run-async/package.json" + }, + { + "path": "node_modules/cheerio/package.json" + }, + { + "path": "node_modules/eslint-utils/package.json" + }, + { + "path": "node_modules/prepend-http/package.json" + }, + { + "path": "node_modules/define-properties/package.json" + }, + { + "path": "node_modules/p-timeout/package.json" + }, + { + "path": "node_modules/cli-cursor/package.json" + }, + { + "path": "node_modules/unique-filename/package.json" + }, + { + "path": "node_modules/pump/package.json" + }, + { + "path": "node_modules/stringifier/package.json" + }, + { + "path": "node_modules/espower-location-detector/package.json" + }, + { + "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" + }, + { + "path": "node_modules/escape-html/package.json" + }, + { + "path": "node_modules/http-cache-semantics/package.json" + }, + { + "path": "node_modules/to-readable-stream/package.json" + }, + { + "path": "node_modules/eastasianwidth/package.json" + }, + { + "path": "node_modules/chardet/package.json" + }, + { + "path": "node_modules/js-tokens/package.json" + }, + { + "path": "node_modules/chalk/package.json" + }, + { + "path": "node_modules/chalk/node_modules/supports-color/package.json" + }, + { + "path": "node_modules/is-regex/package.json" + }, + { + "path": "node_modules/ajv/package.json" + }, + { + "path": "node_modules/spdx-expression-parse/package.json" + }, + { + "path": "node_modules/cli-width/package.json" + }, + { + "path": "node_modules/ms/package.json" + }, + { + "path": "node_modules/fs-write-stream-atomic/package.json" + }, + { + "path": "node_modules/istanbul-lib-report/package.json" + }, + { + "path": "node_modules/base64-js/package.json" + }, + { + "path": "node_modules/encodeurl/package.json" + }, + { + "path": "node_modules/to-arraybuffer/package.json" + }, + { + "path": "node_modules/micromatch/package.json" + }, + { + "path": "node_modules/json-buffer/package.json" + }, + { + "path": "node_modules/file-entry-cache/package.json" + }, + { + "path": "node_modules/mixin-deep/package.json" + }, + { + "path": "node_modules/mixin-deep/node_modules/is-extendable/package.json" + }, + { + "path": "node_modules/is-binary-path/package.json" + }, + { + "path": "node_modules/gtoken/package.json" + }, + { + "path": "node_modules/klaw/package.json" + }, + { + "path": "node_modules/functional-red-black-tree/package.json" + }, + { + "path": "node_modules/dom-serializer/package.json" + }, + { + "path": "node_modules/is-symbol/package.json" + }, + { + "path": "node_modules/vm-browserify/package.json" + }, + { + "path": "node_modules/picomatch/package.json" + }, + { + "path": "node_modules/source-list-map/package.json" + }, + { + "path": "node_modules/@babel/parser/package.json" + }, + { + "path": "node_modules/@babel/highlight/package.json" + }, + { + "path": "node_modules/@babel/code-frame/package.json" + }, + { + "path": "node_modules/move-concurrently/package.json" + }, + { + "path": "node_modules/move-concurrently/node_modules/rimraf/package.json" + }, + { + "path": "node_modules/type-check/package.json" + }, + { + "path": "node_modules/nanomatch/package.json" + }, + { + "path": "node_modules/iconv-lite/package.json" + }, + { + "path": "node_modules/querystring/package.json" + }, + { + "path": "node_modules/webpack/package.json" + }, + { + "path": "node_modules/webpack/node_modules/eslint-scope/package.json" + }, + { + "path": "node_modules/webpack/node_modules/braces/package.json" + }, + { + "path": "node_modules/webpack/node_modules/braces/node_modules/extend-shallow/package.json" + }, + { + "path": "node_modules/webpack/node_modules/to-regex-range/package.json" + }, + { + "path": "node_modules/webpack/node_modules/memory-fs/package.json" + }, + { + "path": "node_modules/webpack/node_modules/is-buffer/package.json" + }, + { + "path": "node_modules/webpack/node_modules/acorn/package.json" + }, + { + "path": "node_modules/webpack/node_modules/fill-range/package.json" + }, + { + "path": "node_modules/webpack/node_modules/fill-range/node_modules/extend-shallow/package.json" + }, + { + "path": "node_modules/webpack/node_modules/micromatch/README.md" + }, + { + "path": "node_modules/webpack/node_modules/micromatch/package.json" + }, + { + "path": "node_modules/webpack/node_modules/micromatch/CHANGELOG.md" + }, + { + "path": "node_modules/webpack/node_modules/micromatch/index.js" + }, + { + "path": "node_modules/webpack/node_modules/micromatch/LICENSE" + }, + { + "path": "node_modules/webpack/node_modules/micromatch/lib/parsers.js" + }, + { + "path": "node_modules/webpack/node_modules/micromatch/lib/.DS_Store" + }, + { + "path": "node_modules/webpack/node_modules/micromatch/lib/utils.js" + }, + { + "path": "node_modules/webpack/node_modules/micromatch/lib/compilers.js" + }, + { + "path": "node_modules/webpack/node_modules/micromatch/lib/cache.js" + }, + { + "path": "node_modules/webpack/node_modules/is-number/package.json" + }, + { + "path": "node_modules/webpack/node_modules/is-number/node_modules/kind-of/package.json" + }, + { + "path": "node_modules/is-url/package.json" + }, + { + "path": "node_modules/randombytes/package.json" + }, + { + "path": "node_modules/domutils/package.json" + }, + { + "path": "node_modules/browserify-zlib/package.json" + }, + { + "path": "node_modules/p-queue/package.json" + }, + { + "path": "node_modules/eventemitter3/package.json" + }, + { + "path": "node_modules/object-visit/package.json" + }, + { + "path": "node_modules/ext/package.json" + }, + { + "path": "node_modules/ext/node_modules/type/package.json" + }, + { + "path": "node_modules/pkg-dir/package.json" + }, + { + "path": "node_modules/pkg-dir/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/pkg-dir/node_modules/find-up/package.json" + }, + { + "path": "node_modules/pkg-dir/node_modules/path-exists/package.json" + }, + { + "path": "node_modules/pkg-dir/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/deep-equal/package.json" + }, + { + "path": "node_modules/parse5/package.json" + }, + { + "path": "node_modules/collection-visit/package.json" + }, + { + "path": "node_modules/flatted/package.json" + }, + { + "path": "node_modules/for-in/package.json" + }, + { + "path": "node_modules/util/package.json" + }, + { + "path": "node_modules/util/node_modules/inherits/package.json" + }, + { + "path": "node_modules/mem/package.json" + }, + { + "path": "node_modules/once/package.json" + }, + { + "path": "node_modules/universal-deep-strict-equal/package.json" + }, + { + "path": "node_modules/anymatch/package.json" + }, + { + "path": "node_modules/anymatch/node_modules/braces/package.json" + }, + { + "path": "node_modules/anymatch/node_modules/braces/node_modules/extend-shallow/package.json" + }, + { + "path": "node_modules/anymatch/node_modules/to-regex-range/package.json" + }, + { + "path": "node_modules/anymatch/node_modules/is-buffer/package.json" + }, + { + "path": "node_modules/anymatch/node_modules/fill-range/package.json" + }, + { + "path": "node_modules/anymatch/node_modules/fill-range/node_modules/extend-shallow/package.json" + }, + { + "path": "node_modules/anymatch/node_modules/micromatch/README.md" + }, + { + "path": "node_modules/anymatch/node_modules/micromatch/package.json" + }, + { + "path": "node_modules/anymatch/node_modules/micromatch/CHANGELOG.md" + }, + { + "path": "node_modules/anymatch/node_modules/micromatch/index.js" + }, + { + "path": "node_modules/anymatch/node_modules/micromatch/LICENSE" + }, + { + "path": "node_modules/anymatch/node_modules/micromatch/lib/parsers.js" + }, + { + "path": "node_modules/anymatch/node_modules/micromatch/lib/.DS_Store" + }, + { + "path": "node_modules/anymatch/node_modules/micromatch/lib/utils.js" + }, + { + "path": "node_modules/anymatch/node_modules/micromatch/lib/compilers.js" + }, + { + "path": "node_modules/anymatch/node_modules/micromatch/lib/cache.js" + }, + { + "path": "node_modules/anymatch/node_modules/is-number/package.json" + }, + { + "path": "node_modules/anymatch/node_modules/is-number/node_modules/kind-of/package.json" + }, + { + "path": "node_modules/anymatch/node_modules/normalize-path/package.json" + }, + { + "path": "node_modules/brace-expansion/package.json" + }, + { + "path": "node_modules/tapable/package.json" + }, + { + "path": "node_modules/is-number/package.json" + }, + { + "path": "node_modules/jsdoc-region-tag/package.json" + }, + { + "path": "node_modules/serialize-javascript/package.json" + }, + { + "path": "node_modules/webpack-cli/package.json" + }, + { + "path": "node_modules/webpack-cli/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/webpack-cli/node_modules/find-up/package.json" + }, + { + "path": "node_modules/webpack-cli/node_modules/cross-spawn/README.md" + }, + { + "path": "node_modules/webpack-cli/node_modules/cross-spawn/package.json" + }, + { + "path": "node_modules/webpack-cli/node_modules/cross-spawn/CHANGELOG.md" + }, + { + "path": "node_modules/webpack-cli/node_modules/cross-spawn/index.js" + }, + { + "path": "node_modules/webpack-cli/node_modules/cross-spawn/LICENSE" + }, + { + "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/parse.js" + }, + { + "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/enoent.js" + }, + { + "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/util/escape.js" + }, + { + "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/util/resolveCommand.js" + }, + { + "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/util/readShebang.js" + }, + { + "path": "node_modules/webpack-cli/node_modules/memory-fs/package.json" + }, + { + "path": "node_modules/webpack-cli/node_modules/yargs-parser/package.json" + }, + { + "path": "node_modules/webpack-cli/node_modules/semver/package.json" + }, + { + "path": "node_modules/webpack-cli/node_modules/path-key/package.json" + }, + { + "path": "node_modules/webpack-cli/node_modules/which/package.json" + }, + { + "path": "node_modules/webpack-cli/node_modules/shebang-regex/package.json" + }, + { + "path": "node_modules/webpack-cli/node_modules/v8-compile-cache/package.json" + }, + { + "path": "node_modules/webpack-cli/node_modules/path-exists/package.json" + }, + { + "path": "node_modules/webpack-cli/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/webpack-cli/node_modules/enhanced-resolve/package.json" + }, + { + "path": "node_modules/webpack-cli/node_modules/shebang-command/package.json" + }, + { + "path": "node_modules/webpack-cli/node_modules/yargs/package.json" + }, + { + "path": "node_modules/markdown-it-anchor/package.json" + }, + { + "path": "node_modules/traverse/package.json" + }, + { + "path": "node_modules/restore-cursor/package.json" + }, + { + "path": "node_modules/lodash.at/package.json" + }, + { + "path": "node_modules/graceful-fs/package.json" + }, + { + "path": "node_modules/isobject/package.json" + }, + { + "path": "node_modules/responselike/package.json" + }, + { + "path": "node_modules/pseudomap/package.json" + }, + { + "path": "node_modules/hash-base/package.json" + }, + { + "path": "node_modules/espurify/package.json" + }, + { + "path": "node_modules/espree/package.json" + }, + { + "path": "node_modules/crypto-browserify/package.json" + }, + { + "path": "node_modules/power-assert-renderer-diagram/package.json" + }, + { + "path": "node_modules/word-wrap/package.json" + }, + { + "path": "node_modules/espower-source/package.json" + }, + { + "path": "node_modules/espower-source/node_modules/acorn/package.json" + }, + { + "path": "node_modules/normalize-url/package.json" + }, + { + "path": "node_modules/infer-owner/package.json" + }, + { + "path": "node_modules/wordwrap/package.json" + }, + { + "path": "node_modules/ee-first/package.json" + }, + { + "path": "node_modules/table/package.json" + }, + { + "path": "node_modules/handlebars/package.json" + }, + { + "path": "node_modules/object-assign/package.json" + }, + { + "path": "node_modules/es6-weak-map/package.json" + }, + { + "path": "node_modules/protobufjs/package.json" + }, + { + "path": "node_modules/protobufjs/cli/package.json" + }, + { + "path": "node_modules/protobufjs/cli/package-lock.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" + }, + { + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" + }, + { + "path": "node_modules/protobufjs/node_modules/@types/node/package.json" + }, + { + "path": "node_modules/normalize-path/package.json" + }, + { + "path": "node_modules/cyclist/package.json" + }, + { + "path": "node_modules/espower/package.json" + }, + { + "path": "node_modules/espower/node_modules/source-map/package.json" + }, + { + "path": "node_modules/strip-json-comments/package.json" + }, + { + "path": "node_modules/process-nextick-args/package.json" + }, + { + "path": "node_modules/brorand/package.json" + }, + { + "path": "node_modules/p-is-promise/package.json" + }, + { + "path": "node_modules/array-find-index/package.json" + }, + { + "path": "node_modules/astral-regex/package.json" + }, + { + "path": "node_modules/@grpc/proto-loader/package.json" + }, + { + "path": "node_modules/@grpc/grpc-js/package.json" + }, + { + "path": "node_modules/test-exclude/package.json" + }, + { + "path": "node_modules/es6-promisify/package.json" + }, + { + "path": "node_modules/p-try/package.json" + }, + { + "path": "node_modules/optionator/package.json" + }, + { + "path": "node_modules/is-plain-object/package.json" + }, + { + "path": "node_modules/requizzle/package.json" + }, + { + "path": "node_modules/c8/package.json" + }, + { + "path": "node_modules/fast-levenshtein/package.json" + }, + { + "path": "node_modules/statuses/package.json" + }, + { + "path": "node_modules/semver-diff/package.json" + }, + { + "path": "node_modules/semver-diff/node_modules/semver/package.json" + }, + { + "path": "node_modules/signal-exit/package.json" + }, + { + "path": "node_modules/jsdoc/package.json" + }, + { + "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" + }, + { + "path": "node_modules/map-age-cleaner/package.json" + }, + { + "path": "node_modules/resolve-url/package.json" + }, + { + "path": "node_modules/duplexify/package.json" + }, + { + "path": "node_modules/ret/package.json" + }, + { + "path": "node_modules/object-is/package.json" + }, + { + "path": "node_modules/tslib/package.json" + }, + { + "path": "node_modules/extend/package.json" + }, + { + "path": "node_modules/is-wsl/package.json" + }, + { + "path": "node_modules/power-assert-context-reducer-ast/package.json" + }, + { + "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" + }, + { + "path": "node_modules/css-what/package.json" + }, + { + "path": "node_modules/power-assert-renderer-comparison/package.json" + }, + { + "path": "node_modules/ecdsa-sig-formatter/package.json" + }, + { + "path": "node_modules/unique-slug/package.json" + }, + { + "path": "node_modules/typedarray-to-buffer/README.md" + }, + { + "path": "node_modules/typedarray-to-buffer/package.json" + }, + { + "path": "node_modules/typedarray-to-buffer/.travis.yml" + }, + { + "path": "node_modules/typedarray-to-buffer/index.js" + }, + { + "path": "node_modules/typedarray-to-buffer/.airtap.yml" + }, + { + "path": "node_modules/typedarray-to-buffer/LICENSE" + }, + { + "path": "node_modules/typedarray-to-buffer/test/basic.js" + }, + { + "path": "node_modules/upath/package.json" + }, + { + "path": "node_modules/markdown-it/package.json" + }, + { + "path": "node_modules/tslint-config-prettier/package.json" + }, + { + "path": "node_modules/buffer-from/package.json" + }, + { + "path": "node_modules/minizlib/package.json" + }, + { + "path": "node_modules/minizlib/node_modules/yallist/package.json" + }, + { + "path": "node_modules/domelementtype/package.json" + }, + { + "path": "node_modules/ci-info/package.json" + }, + { + "path": "node_modules/@types/mocha/package.json" + }, + { + "path": "node_modules/@types/color-name/package.json" + }, + { + "path": "node_modules/@types/is-windows/package.json" + }, + { + "path": "node_modules/@types/istanbul-lib-coverage/package.json" + }, + { + "path": "node_modules/@types/node/package.json" + }, + { + "path": "node_modules/@types/long/package.json" + }, + { + "path": "node_modules/serve-static/package.json" + }, + { + "path": "node_modules/make-dir/package.json" + }, + { + "path": "node_modules/make-dir/node_modules/semver/package.json" + }, + { + "path": "node_modules/md5.js/package.json" + }, + { + "path": "node_modules/esquery/package.json" + }, + { + "path": "node_modules/ncp/package.json" + }, + { + "path": "node_modules/emoji-regex/package.json" + }, + { + "path": "node_modules/set-value/package.json" + }, + { + "path": "node_modules/set-value/node_modules/extend-shallow/package.json" + }, + { + "path": "node_modules/read-pkg/package.json" + }, + { + "path": "node_modules/fast-diff/package.json" + }, + { + "path": "node_modules/path-browserify/package.json" + }, + { + "path": "node_modules/xtend/package.json" + }, + { + "path": "node_modules/resolve/package.json" + }, + { + "path": "node_modules/lowercase-keys/package.json" + }, + { + "path": "node_modules/is-fullwidth-code-point/package.json" + }, + { + "path": "node_modules/webpack-sources/package.json" + }, + { + "path": "node_modules/is-extendable/package.json" + }, + { + "path": "node_modules/read-pkg-up/package.json" + }, + { + "path": "node_modules/read-pkg-up/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/read-pkg-up/node_modules/find-up/package.json" + }, + { + "path": "node_modules/read-pkg-up/node_modules/path-exists/package.json" + }, + { + "path": "node_modules/read-pkg-up/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/p-cancelable/package.json" + }, + { + "path": "node_modules/aproba/package.json" + }, + { + "path": "node_modules/resolve-dir/package.json" + }, + { + "path": "node_modules/resolve-dir/node_modules/global-modules/package.json" + }, + { + "path": "node_modules/acorn-jsx/package.json" + }, + { + "path": "node_modules/interpret/package.json" + }, + { + "path": "node_modules/power-assert-context-traversal/package.json" + }, + { + "path": "node_modules/long/package.json" + }, + { + "path": "node_modules/d/package.json" + }, + { + "path": "node_modules/debug/package.json" + }, + { + "path": "node_modules/mimic-fn/package.json" + }, + { + "path": "node_modules/bn.js/package.json" + }, + { + "path": "node_modules/arr-union/package.json" + }, + { + "path": "node_modules/cipher-base/package.json" + }, + { + "path": "node_modules/typedarray/package.json" + }, + { + "path": "node_modules/isexe/package.json" + }, + { + "path": "node_modules/multi-stage-sourcemap/package.json" + }, + { + "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" + }, + { + "path": "node_modules/find-cache-dir/package.json" + }, + { + "path": "node_modules/uc.micro/package.json" + }, + { + "path": "node_modules/fs.realpath/package.json" + }, + { + "path": "node_modules/eslint-plugin-prettier/package.json" + }, + { + "path": "node_modules/yargs/package.json" + }, + { + "path": "node_modules/yargs/node_modules/locate-path/package.json" + }, + { + "path": "node_modules/yargs/node_modules/find-up/package.json" + }, + { + "path": "node_modules/yargs/node_modules/path-exists/package.json" + }, + { + "path": "node_modules/yargs/node_modules/p-locate/package.json" + }, + { + "path": "node_modules/nice-try/package.json" + }, + { + "path": "node_modules/static-extend/package.json" + }, + { + "path": "node_modules/static-extend/node_modules/define-property/package.json" + }, + { + "path": "node_modules/has/package.json" + }, + { + "path": "node_modules/xmlcreate/package.json" + }, + { + "path": "node_modules/escallmatch/package.json" + }, + { + "path": "node_modules/escallmatch/node_modules/esprima/package.json" + }, + { + "path": "node_modules/get-caller-file/package.json" + }, + { + "path": "node_modules/jwa/package.json" + }, + { + "path": "node_modules/json5/package.json" + }, + { + "path": "node_modules/json5/node_modules/minimist/package.json" } ] } \ No newline at end of file From 323ff02598b24349446a4d03ec3dcb1628cf0f76 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2020 14:11:42 -0800 Subject: [PATCH 064/253] chore: release 1.5.0 (#88) --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 50eb3fdf65c..e683b3b3d07 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [1.5.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.4.0...v1.5.0) (2020-01-02) + + +### Features + +* move to typescript code generation ([#87](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/87)) ([11051db](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/11051db91512f6abb21988d6b7049ce9904a656c)) + ## [1.4.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.3.1...v1.4.0) (2019-12-10) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 843c2d71143..f3b73bbfaa4 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.4.0", + "version": "1.5.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index a68f0a56750..fe12e041b1c 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.4.0" + "@google-cloud/recaptcha-enterprise": "^1.5.0" }, "devDependencies": { "chai": "^4.2.0", From 7da4d239a682b80fb942c798edfdda501e73e114 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 3 Jan 2020 10:00:24 -0800 Subject: [PATCH 065/253] build: add **/*.d.ts to coverage ignore list --- .../google-cloud-recaptchaenterprise/.nycrc | 1 + .../protos/protos.d.ts | 2 +- .../protos/protos.js | 2 +- ...tcha_enterprise_service_v1_beta1_client.ts | 6 +- .../synth.metadata | 2669 +++++++++-------- .../system-test/install.ts | 1 + 6 files changed, 1487 insertions(+), 1194 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.nycrc b/packages/google-cloud-recaptchaenterprise/.nycrc index 367688844eb..b18d5472b62 100644 --- a/packages/google-cloud-recaptchaenterprise/.nycrc +++ b/packages/google-cloud-recaptchaenterprise/.nycrc @@ -12,6 +12,7 @@ "**/scripts", "**/protos", "**/test", + "**/*.d.ts", ".jsdoc.js", "**/.jsdoc.js", "karma.conf.js", diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index e8983bc226b..ac3530b36d7 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 460d897245d..584780d9f0c 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 22bd220a24a..75c267de2e6 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -205,6 +205,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { for (const methodName of recaptchaEnterpriseServiceV1Beta1StubMethods) { const innerCallPromise = this.recaptchaEnterpriseServiceV1Beta1Stub.then( stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } return stub[methodName].apply(stub, args); }, (err: Error | null | undefined) => () => { @@ -225,9 +228,6 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { callOptions?: CallOptions, callback?: APICallback ) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } return apiCall(argument, callOptions, callback); }; } diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index c08d08fc377..18d4ea7fe28 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2019-12-21T12:24:03.013452Z", + "updateTime": "2020-01-03T12:20:09.603060Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "1a380ea21dea9b6ac6ad28c60ad96d9d73574e19", - "internalRef": "286616241" + "sha": "4d45a6399e9444fbddaeb1c86aabfde210723714", + "internalRef": "287908369" } }, { @@ -30,2953 +30,3124 @@ ], "newFiles": [ { - "path": ".repo-metadata.json" + "path": "synth.metadata" }, { - "path": "README.md" + "path": ".repo-metadata.json" }, { - "path": "package.json" + "path": "CONTRIBUTING.md" }, { - "path": "CHANGELOG.md" + "path": "linkinator.config.json" }, { - "path": ".gitignore" + "path": ".prettierignore" }, { - "path": "CODE_OF_CONDUCT.md" + "path": "tsconfig.json" }, { - "path": "webpack.config.js" + "path": ".jsdoc.js" }, { - "path": "CONTRIBUTING.md" + "path": ".gitignore" }, { - "path": ".prettierrc" + "path": "synth.py" }, { - "path": "package-lock.json" + "path": "CODE_OF_CONDUCT.md" }, { - "path": ".eslintignore" + "path": "README.md" }, { - "path": "linkinator.config.json" + "path": "package-lock.json" }, { - "path": ".eslintrc.yml" + "path": ".prettierrc" }, { - "path": "renovate.json" + "path": "codecov.yaml" }, { - "path": "synth.metadata" + "path": ".nycrc" }, { - "path": ".prettierignore" + "path": "package.json" }, { - "path": "synth.py" + "path": "webpack.config.js" }, { - "path": "codecov.yaml" + "path": ".eslintrc.yml" }, { "path": "tslint.json" }, { - "path": ".jsdoc.js" + "path": "renovate.json" }, { "path": "LICENSE" }, { - "path": ".nycrc" + "path": "CHANGELOG.md" }, { - "path": "tsconfig.json" + "path": ".eslintignore" }, { - "path": "src/index.ts" + "path": ".github/PULL_REQUEST_TEMPLATE.md" }, { - "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts" + "path": ".github/release-please.yml" }, { - "path": "src/v1beta1/index.ts" + "path": ".github/ISSUE_TEMPLATE/support_request.md" }, { - "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_proto_list.json" + "path": ".github/ISSUE_TEMPLATE/bug_report.md" }, { - "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json" + "path": ".github/ISSUE_TEMPLATE/feature_request.md" }, { - "path": "build/src/index.d.ts" + "path": ".kokoro/samples-test.sh" }, { - "path": "build/src/index.js.map" + "path": ".kokoro/system-test.sh" }, { - "path": "build/src/index.js" + "path": ".kokoro/docs.sh" }, { - "path": "build/src/v1beta1/index.d.ts" + "path": ".kokoro/lint.sh" }, { - "path": "build/src/v1beta1/index.js.map" + "path": ".kokoro/.gitattributes" }, { - "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.d.ts" + "path": ".kokoro/publish.sh" }, { - "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js" + "path": ".kokoro/trampoline.sh" }, { - "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js.map" + "path": ".kokoro/common.cfg" }, { - "path": "build/src/v1beta1/index.js" + "path": ".kokoro/test.bat" }, { - "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json" + "path": ".kokoro/test.sh" }, { - "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.d.ts" + "path": ".kokoro/release/docs.sh" }, { - "path": "build/protos/protos.json" + "path": ".kokoro/release/docs.cfg" }, { - "path": "build/protos/protos.js" + "path": ".kokoro/release/common.cfg" }, { - "path": "build/protos/protos.d.ts" + "path": ".kokoro/release/publish.cfg" }, { - "path": "build/protos/google/cloud/common_resources.proto" + "path": ".kokoro/presubmit/node12/test.cfg" }, { - "path": "build/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto" + "path": ".kokoro/presubmit/node12/common.cfg" }, { - "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.js.map" + "path": ".kokoro/presubmit/node8/test.cfg" }, { - "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.js" + "path": ".kokoro/presubmit/node8/common.cfg" }, { - "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.d.ts" + "path": ".kokoro/presubmit/node6/test.cfg" }, { - "path": "build/system-test/install.js.map" + "path": ".kokoro/presubmit/node6/common.cfg" }, { - "path": "build/system-test/install.d.ts" + "path": ".kokoro/presubmit/windows/test.cfg" }, { - "path": "build/system-test/install.js" + "path": ".kokoro/presubmit/windows/common.cfg" }, { - "path": "__pycache__/synth.cpython-36.pyc" + "path": ".kokoro/presubmit/node10/lint.cfg" }, { - "path": "samples/README.md" + "path": ".kokoro/presubmit/node10/system-test.cfg" }, { - "path": "samples/package.json" + "path": ".kokoro/presubmit/node10/test.cfg" }, { - "path": "samples/.eslintrc" + "path": ".kokoro/presubmit/node10/docs.cfg" }, { - "path": "samples/quickstart.js" + "path": ".kokoro/presubmit/node10/common.cfg" }, { - "path": "samples/test/.eslintrc" + "path": ".kokoro/presubmit/node10/samples-test.cfg" }, { - "path": "samples/test/samples.test.js" + "path": ".kokoro/continuous/node12/test.cfg" }, { - "path": ".github/PULL_REQUEST_TEMPLATE.md" + "path": ".kokoro/continuous/node12/common.cfg" }, { - "path": ".github/release-please.yml" + "path": ".kokoro/continuous/node8/test.cfg" }, { - "path": ".github/ISSUE_TEMPLATE/support_request.md" + "path": ".kokoro/continuous/node8/common.cfg" }, { - "path": ".github/ISSUE_TEMPLATE/feature_request.md" + "path": ".kokoro/continuous/node6/test.cfg" }, { - "path": ".github/ISSUE_TEMPLATE/bug_report.md" + "path": ".kokoro/continuous/node6/common.cfg" }, { - "path": ".kokoro/test.sh" + "path": ".kokoro/continuous/node10/lint.cfg" }, { - "path": ".kokoro/docs.sh" + "path": ".kokoro/continuous/node10/system-test.cfg" }, { - "path": ".kokoro/samples-test.sh" + "path": ".kokoro/continuous/node10/test.cfg" }, { - "path": ".kokoro/.gitattributes" + "path": ".kokoro/continuous/node10/docs.cfg" }, { - "path": ".kokoro/trampoline.sh" + "path": ".kokoro/continuous/node10/common.cfg" }, { - "path": ".kokoro/lint.sh" + "path": ".kokoro/continuous/node10/samples-test.cfg" }, { - "path": ".kokoro/publish.sh" + "path": "test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts" }, { - "path": ".kokoro/test.bat" + "path": "system-test/install.ts" }, { - "path": ".kokoro/common.cfg" + "path": "system-test/fixtures/sample/src/index.ts" }, { - "path": ".kokoro/system-test.sh" + "path": "system-test/fixtures/sample/src/index.js" }, { - "path": ".kokoro/release/docs.cfg" + "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.js.map" }, { - "path": ".kokoro/release/docs.sh" + "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.js" }, { - "path": ".kokoro/release/publish.cfg" + "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.d.ts" }, { - "path": ".kokoro/release/common.cfg" + "path": "build/system-test/install.d.ts" }, { - "path": ".kokoro/continuous/node10/lint.cfg" + "path": "build/system-test/install.js" }, { - "path": ".kokoro/continuous/node10/docs.cfg" + "path": "build/system-test/install.js.map" }, { - "path": ".kokoro/continuous/node10/test.cfg" + "path": "build/protos/protos.d.ts" }, { - "path": ".kokoro/continuous/node10/system-test.cfg" + "path": "build/protos/protos.js" }, { - "path": ".kokoro/continuous/node10/samples-test.cfg" + "path": "build/protos/protos.json" }, { - "path": ".kokoro/continuous/node10/common.cfg" + "path": "build/protos/google/cloud/common_resources.proto" }, { - "path": ".kokoro/continuous/node8/test.cfg" + "path": "build/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto" }, { - "path": ".kokoro/continuous/node8/common.cfg" + "path": "build/src/index.js" }, { - "path": ".kokoro/continuous/node12/test.cfg" + "path": "build/src/index.js.map" }, { - "path": ".kokoro/continuous/node12/common.cfg" + "path": "build/src/index.d.ts" }, { - "path": ".kokoro/continuous/node6/test.cfg" + "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js" }, { - "path": ".kokoro/continuous/node6/common.cfg" + "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.d.ts" }, { - "path": ".kokoro/presubmit/node10/lint.cfg" + "path": "build/src/v1beta1/index.js" }, { - "path": ".kokoro/presubmit/node10/docs.cfg" + "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.d.ts" }, { - "path": ".kokoro/presubmit/node10/test.cfg" + "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json" }, { - "path": ".kokoro/presubmit/node10/system-test.cfg" + "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js.map" }, { - "path": ".kokoro/presubmit/node10/samples-test.cfg" + "path": "build/src/v1beta1/index.js.map" }, { - "path": ".kokoro/presubmit/node10/common.cfg" + "path": "build/src/v1beta1/index.d.ts" }, { - "path": ".kokoro/presubmit/node8/test.cfg" + "path": "protos/protos.d.ts" }, { - "path": ".kokoro/presubmit/node8/common.cfg" + "path": "protos/protos.js" }, { - "path": ".kokoro/presubmit/node12/test.cfg" + "path": "protos/protos.json" }, { - "path": ".kokoro/presubmit/node12/common.cfg" + "path": "protos/google/cloud/common_resources.proto" }, { - "path": ".kokoro/presubmit/windows/test.cfg" + "path": "protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto" }, { - "path": ".kokoro/presubmit/windows/common.cfg" + "path": ".git/shallow" }, { - "path": ".kokoro/presubmit/node6/test.cfg" + "path": ".git/HEAD" }, { - "path": ".kokoro/presubmit/node6/common.cfg" + "path": ".git/config" }, { - "path": "protos/protos.json" + "path": ".git/packed-refs" }, { - "path": "protos/protos.js" + "path": ".git/index" }, { - "path": "protos/protos.d.ts" + "path": ".git/description" }, { - "path": "protos/google/cloud/common_resources.proto" + "path": ".git/objects/pack/pack-d62d7eb9d7551912cf7a4ed6fb21272d5ce6f977.pack" }, { - "path": "protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto" + "path": ".git/objects/pack/pack-d62d7eb9d7551912cf7a4ed6fb21272d5ce6f977.idx" }, { - "path": ".git/packed-refs" + "path": ".git/logs/HEAD" }, { - "path": ".git/HEAD" + "path": ".git/logs/refs/heads/master" }, { - "path": ".git/config" + "path": ".git/logs/refs/heads/autosynth" }, { - "path": ".git/index" + "path": ".git/logs/refs/remotes/origin/HEAD" }, { - "path": ".git/shallow" + "path": ".git/hooks/update.sample" }, { - "path": ".git/logs/HEAD" + "path": ".git/hooks/pre-push.sample" }, { - "path": ".git/logs/refs/remotes/origin/HEAD" + "path": ".git/hooks/pre-rebase.sample" }, { - "path": ".git/logs/refs/heads/autosynth" + "path": ".git/hooks/pre-commit.sample" }, { - "path": ".git/logs/refs/heads/master" + "path": ".git/hooks/applypatch-msg.sample" }, { - "path": ".git/refs/remotes/origin/HEAD" + "path": ".git/hooks/post-update.sample" }, { - "path": ".git/refs/heads/autosynth" + "path": ".git/hooks/pre-applypatch.sample" }, { - "path": ".git/refs/heads/master" + "path": ".git/hooks/prepare-commit-msg.sample" }, { - "path": ".git/objects/pack/pack-30443dd22e6f5d39b3a7d4616916b3c33fdd170d.pack" + "path": ".git/hooks/commit-msg.sample" }, { - "path": ".git/objects/pack/pack-30443dd22e6f5d39b3a7d4616916b3c33fdd170d.idx" + "path": ".git/hooks/pre-receive.sample" }, { - "path": "test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts" + "path": ".git/hooks/fsmonitor-watchman.sample" }, { - "path": "test/.eslintrc" + "path": ".git/refs/heads/master" }, { - "path": "system-test/.eslintrc.yml" + "path": ".git/refs/heads/autosynth" }, { - "path": "system-test/install.ts" + "path": ".git/refs/remotes/origin/HEAD" }, { - "path": "system-test/fixtures/sample/src/index.ts" + "path": ".git/refs/tags/v1.5.0" }, { - "path": "system-test/fixtures/sample/src/index.js" + "path": ".git/info/exclude" }, { - "path": "node_modules/strip-bom/package.json" + "path": "src/index.ts" }, { - "path": "node_modules/string-width/package.json" + "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_proto_list.json" }, { - "path": "node_modules/is-callable/package.json" + "path": "src/v1beta1/index.ts" }, { - "path": "node_modules/copy-descriptor/package.json" + "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json" }, { - "path": "node_modules/util-deprecate/package.json" + "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts" }, { - "path": "node_modules/gts/package.json" + "path": "node_modules/builtin-status-codes/package.json" }, { - "path": "node_modules/gts/node_modules/has-flag/package.json" + "path": "node_modules/progress/package.json" }, { - "path": "node_modules/gts/node_modules/color-name/package.json" + "path": "node_modules/is-ci/package.json" }, { - "path": "node_modules/gts/node_modules/color-convert/package.json" + "path": "node_modules/isobject/package.json" }, { - "path": "node_modules/gts/node_modules/supports-color/package.json" + "path": "node_modules/mamacro/package.json" }, { - "path": "node_modules/gts/node_modules/ansi-styles/package.json" + "path": "node_modules/define-property/package.json" }, { - "path": "node_modules/gts/node_modules/chalk/package.json" + "path": "node_modules/define-property/node_modules/is-data-descriptor/package.json" }, { - "path": "node_modules/require-directory/package.json" + "path": "node_modules/define-property/node_modules/is-accessor-descriptor/package.json" }, { - "path": "node_modules/update-notifier/package.json" + "path": "node_modules/define-property/node_modules/is-descriptor/package.json" }, { - "path": "node_modules/esprima/package.json" + "path": "node_modules/lru-cache/package.json" }, { - "path": "node_modules/string_decoder/package.json" + "path": "node_modules/destroy/package.json" }, { - "path": "node_modules/mocha/package.json" + "path": "node_modules/snapdragon-util/package.json" }, { - "path": "node_modules/mocha/node_modules/locate-path/package.json" + "path": "node_modules/snapdragon-util/node_modules/is-buffer/package.json" }, { - "path": "node_modules/mocha/node_modules/find-up/package.json" + "path": "node_modules/snapdragon-util/node_modules/kind-of/package.json" }, { - "path": "node_modules/mocha/node_modules/diff/package.json" + "path": "node_modules/power-assert-context-formatter/package.json" }, { - "path": "node_modules/mocha/node_modules/yargs-parser/package.json" + "path": "node_modules/fast-json-stable-stringify/package.json" }, { - "path": "node_modules/mocha/node_modules/supports-color/package.json" + "path": "node_modules/nice-try/package.json" }, { - "path": "node_modules/mocha/node_modules/which/package.json" + "path": "node_modules/which-module/package.json" }, { - "path": "node_modules/mocha/node_modules/path-exists/package.json" + "path": "node_modules/asn1.js/package.json" }, { - "path": "node_modules/mocha/node_modules/p-locate/package.json" + "path": "node_modules/array-find/package.json" }, { - "path": "node_modules/mocha/node_modules/glob/package.json" + "path": "node_modules/catharsis/package.json" }, { - "path": "node_modules/mocha/node_modules/ms/package.json" + "path": "node_modules/is-promise/package.json" }, { - "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" + "path": "node_modules/v8-compile-cache/package.json" }, { - "path": "node_modules/mocha/node_modules/yargs/package.json" + "path": "node_modules/create-hmac/package.json" }, { - "path": "node_modules/arr-diff/package.json" + "path": "node_modules/tapable/package.json" }, { - "path": "node_modules/is-arguments/package.json" + "path": "node_modules/.bin/sha.js" }, { - "path": "node_modules/loader-utils/package.json" + "path": "node_modules/doctrine/package.json" }, { - "path": "node_modules/core-util-is/package.json" + "path": "node_modules/callsites/package.json" }, { - "path": "node_modules/wrap-ansi/package.json" + "path": "node_modules/diff/package.json" }, { - "path": "node_modules/minimist-options/package.json" + "path": "node_modules/hosted-git-info/package.json" }, { - "path": "node_modules/minimist-options/node_modules/arrify/package.json" + "path": "node_modules/color-name/package.json" }, { - "path": "node_modules/underscore/package.json" + "path": "node_modules/path-dirname/package.json" }, { - "path": "node_modules/keyv/package.json" + "path": "node_modules/defer-to-connect/package.json" }, { - "path": "node_modules/glob-parent/package.json" + "path": "node_modules/snapdragon/index.js" }, { - "path": "node_modules/domain-browser/package.json" + "path": "node_modules/snapdragon/README.md" }, { - "path": "node_modules/minimalistic-crypto-utils/package.json" + "path": "node_modules/snapdragon/package.json" }, { - "path": "node_modules/walkdir/package.json" + "path": "node_modules/snapdragon/LICENSE" }, { - "path": "node_modules/@protobufjs/codegen/package.json" + "path": "node_modules/snapdragon/lib/position.js" }, { - "path": "node_modules/@protobufjs/inquire/package.json" + "path": "node_modules/snapdragon/lib/compiler.js" }, { - "path": "node_modules/@protobufjs/float/package.json" + "path": "node_modules/snapdragon/lib/source-maps.js" }, { - "path": "node_modules/@protobufjs/base64/package.json" + "path": "node_modules/snapdragon/lib/utils.js" }, { - "path": "node_modules/@protobufjs/aspromise/package.json" + "path": "node_modules/snapdragon/lib/parser.js" }, { - "path": "node_modules/@protobufjs/eventemitter/package.json" + "path": "node_modules/snapdragon/node_modules/define-property/package.json" }, { - "path": "node_modules/@protobufjs/fetch/package.json" + "path": "node_modules/snapdragon/node_modules/debug/package.json" }, { - "path": "node_modules/@protobufjs/utf8/package.json" + "path": "node_modules/snapdragon/node_modules/ms/package.json" }, { - "path": "node_modules/@protobufjs/path/package.json" + "path": "node_modules/snapdragon/node_modules/extend-shallow/package.json" }, { - "path": "node_modules/@protobufjs/pool/package.json" + "path": "node_modules/snapdragon/node_modules/source-map/package.json" }, { - "path": "node_modules/global-dirs/package.json" + "path": "node_modules/unpipe/package.json" }, { - "path": "node_modules/has-flag/package.json" + "path": "node_modules/parse-asn1/package.json" }, { - "path": "node_modules/locate-path/package.json" + "path": "node_modules/emoji-regex/package.json" }, { - "path": "node_modules/empower-assert/package.json" + "path": "node_modules/http-errors/package.json" }, { - "path": "node_modules/convert-source-map/package.json" + "path": "node_modules/eventemitter3/package.json" }, { - "path": "node_modules/terser/package.json" + "path": "node_modules/esutils/package.json" }, { - "path": "node_modules/terser/node_modules/source-map-support/package.json" + "path": "node_modules/npm-run-path/package.json" }, { - "path": "node_modules/minimalistic-assert/package.json" + "path": "node_modules/npm-run-path/node_modules/path-key/package.json" }, { - "path": "node_modules/require-main-filename/package.json" + "path": "node_modules/he/package.json" }, { - "path": "node_modules/bluebird/package.json" + "path": "node_modules/pack-n-play/package.json" }, { - "path": "node_modules/string.prototype.trimleft/package.json" + "path": "node_modules/pack-n-play/node_modules/tmp/package.json" }, { - "path": "node_modules/range-parser/package.json" + "path": "node_modules/pack-n-play/node_modules/tmp/node_modules/rimraf/package.json" }, { - "path": "node_modules/espower-loader/package.json" + "path": "node_modules/on-finished/package.json" }, { - "path": "node_modules/null-loader/package.json" + "path": "node_modules/crypto-browserify/package.json" }, { - "path": "node_modules/defer-to-connect/package.json" + "path": "node_modules/linkinator/package.json" }, { - "path": "node_modules/duplexer3/package.json" + "path": "node_modules/linkinator/node_modules/update-notifier/package.json" }, { - "path": "node_modules/indent-string/package.json" + "path": "node_modules/linkinator/node_modules/dot-prop/package.json" }, { - "path": "node_modules/detect-file/package.json" + "path": "node_modules/linkinator/node_modules/redent/package.json" }, { - "path": "node_modules/eslint/package.json" + "path": "node_modules/linkinator/node_modules/semver-diff/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/README.md" + "path": "node_modules/linkinator/node_modules/map-obj/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/package.json" + "path": "node_modules/linkinator/node_modules/meow/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md" + "path": "node_modules/linkinator/node_modules/term-size/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/index.js" + "path": "node_modules/linkinator/node_modules/crypto-random-string/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/LICENSE" + "path": "node_modules/linkinator/node_modules/indent-string/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/parse.js" + "path": "node_modules/linkinator/node_modules/camelcase-keys/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/enoent.js" + "path": "node_modules/linkinator/node_modules/is-obj/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js" + "path": "node_modules/linkinator/node_modules/read-pkg-up/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js" + "path": "node_modules/linkinator/node_modules/is-path-inside/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js" + "path": "node_modules/linkinator/node_modules/boxen/package.json" }, { - "path": "node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json" + "path": "node_modules/linkinator/node_modules/chalk/package.json" }, { - "path": "node_modules/eslint/node_modules/path-key/package.json" + "path": "node_modules/linkinator/node_modules/arrify/package.json" }, { - "path": "node_modules/eslint/node_modules/which/package.json" + "path": "node_modules/linkinator/node_modules/widest-line/package.json" }, { - "path": "node_modules/eslint/node_modules/shebang-regex/package.json" + "path": "node_modules/linkinator/node_modules/global-dirs/package.json" }, { - "path": "node_modules/eslint/node_modules/shebang-command/package.json" + "path": "node_modules/linkinator/node_modules/parse-json/package.json" }, { - "path": "node_modules/eslint/node_modules/debug/package.json" + "path": "node_modules/linkinator/node_modules/xdg-basedir/package.json" }, { - "path": "node_modules/got/package.json" + "path": "node_modules/linkinator/node_modules/is-npm/package.json" }, { - "path": "node_modules/got/node_modules/get-stream/package.json" + "path": "node_modules/linkinator/node_modules/read-pkg/package.json" }, { - "path": "node_modules/estraverse/package.json" + "path": "node_modules/linkinator/node_modules/read-pkg/node_modules/type-fest/package.json" }, { - "path": "node_modules/prr/package.json" + "path": "node_modules/linkinator/node_modules/is-installed-globally/package.json" }, { - "path": "node_modules/mdurl/package.json" + "path": "node_modules/linkinator/node_modules/trim-newlines/package.json" }, { - "path": "node_modules/eslint-plugin-node/package.json" + "path": "node_modules/linkinator/node_modules/semver/package.json" }, { - "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" + "path": "node_modules/linkinator/node_modules/unique-string/package.json" }, { - "path": "node_modules/setimmediate/package.json" + "path": "node_modules/linkinator/node_modules/strip-indent/package.json" }, { - "path": "node_modules/diffie-hellman/package.json" + "path": "node_modules/linkinator/node_modules/quick-lru/package.json" }, { - "path": "node_modules/resolve-from/package.json" + "path": "node_modules/linkinator/node_modules/minimist-options/package.json" }, { - "path": "node_modules/pascalcase/package.json" + "path": "node_modules/linkinator/node_modules/configstore/package.json" }, { - "path": "node_modules/emojis-list/package.json" + "path": "node_modules/update-notifier/package.json" }, { - "path": "node_modules/https-browserify/package.json" + "path": "node_modules/p-cancelable/package.json" }, { - "path": "node_modules/assign-symbols/package.json" + "path": "node_modules/markdown-it/package.json" }, { - "path": "node_modules/browserify-aes/package.json" + "path": "node_modules/setimmediate/package.json" }, { - "path": "node_modules/type-name/package.json" + "path": "node_modules/dot-prop/package.json" }, { - "path": "node_modules/os-locale/package.json" + "path": "node_modules/require-main-filename/package.json" }, { - "path": "node_modules/os-locale/node_modules/cross-spawn/README.md" + "path": "node_modules/fast-diff/package.json" }, { - "path": "node_modules/os-locale/node_modules/cross-spawn/package.json" + "path": "node_modules/lodash.camelcase/package.json" }, { - "path": "node_modules/os-locale/node_modules/cross-spawn/CHANGELOG.md" + "path": "node_modules/redent/package.json" }, { - "path": "node_modules/os-locale/node_modules/cross-spawn/index.js" + "path": "node_modules/resolve/package.json" }, { - "path": "node_modules/os-locale/node_modules/cross-spawn/LICENSE" + "path": "node_modules/globals/package.json" }, { - "path": "node_modules/os-locale/node_modules/cross-spawn/lib/parse.js" + "path": "node_modules/p-is-promise/package.json" }, { - "path": "node_modules/os-locale/node_modules/cross-spawn/lib/enoent.js" + "path": "node_modules/range-parser/package.json" }, { - "path": "node_modules/os-locale/node_modules/cross-spawn/lib/util/escape.js" + "path": "node_modules/string.prototype.trimright/package.json" }, { - "path": "node_modules/os-locale/node_modules/cross-spawn/lib/util/resolveCommand.js" + "path": "node_modules/chrome-trace-event/package.json" }, { - "path": "node_modules/os-locale/node_modules/cross-spawn/lib/util/readShebang.js" + "path": "node_modules/constants-browserify/package.json" }, { - "path": "node_modules/os-locale/node_modules/get-stream/package.json" + "path": "node_modules/inflight/package.json" }, { - "path": "node_modules/os-locale/node_modules/semver/package.json" + "path": "node_modules/debug/package.json" }, { - "path": "node_modules/os-locale/node_modules/path-key/package.json" + "path": "node_modules/htmlparser2/package.json" }, { - "path": "node_modules/os-locale/node_modules/which/package.json" + "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" }, { - "path": "node_modules/os-locale/node_modules/shebang-regex/package.json" + "path": "node_modules/semver-diff/package.json" }, { - "path": "node_modules/os-locale/node_modules/is-stream/package.json" + "path": "node_modules/semver-diff/node_modules/semver/package.json" }, { - "path": "node_modules/os-locale/node_modules/shebang-command/package.json" + "path": "node_modules/tsutils/package.json" }, { - "path": "node_modules/os-locale/node_modules/execa/package.json" + "path": "node_modules/multi-stage-sourcemap/package.json" }, { - "path": "node_modules/lodash/package.json" + "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" }, { - "path": "node_modules/strip-ansi/package.json" + "path": "node_modules/ms/package.json" }, { - "path": "node_modules/safe-buffer/package.json" + "path": "node_modules/linkify-it/package.json" }, { - "path": "node_modules/@szmarczak/http-timer/package.json" + "path": "node_modules/through/package.json" }, { - "path": "node_modules/parent-module/package.json" + "path": "node_modules/power-assert-renderer-file/package.json" }, { - "path": "node_modules/object-keys/package.json" + "path": "node_modules/homedir-polyfill/package.json" }, { - "path": "node_modules/split-string/package.json" + "path": "node_modules/string-width/package.json" }, { - "path": "node_modules/base/package.json" + "path": "node_modules/html-escaper/package.json" }, { - "path": "node_modules/base/node_modules/is-data-descriptor/package.json" + "path": "node_modules/type/package.json" }, { - "path": "node_modules/base/node_modules/is-descriptor/package.json" + "path": "node_modules/move-concurrently/package.json" }, { - "path": "node_modules/base/node_modules/is-accessor-descriptor/package.json" + "path": "node_modules/move-concurrently/node_modules/rimraf/package.json" }, { - "path": "node_modules/base/node_modules/define-property/package.json" + "path": "node_modules/type-fest/package.json" }, { - "path": "node_modules/write/package.json" + "path": "node_modules/intelli-espower-loader/package.json" }, { - "path": "node_modules/configstore/package.json" + "path": "node_modules/parseurl/package.json" }, { - "path": "node_modules/configstore/node_modules/write-file-atomic/package.json" + "path": "node_modules/buffer-from/package.json" }, { - "path": "node_modules/configstore/node_modules/pify/package.json" + "path": "node_modules/google-p12-pem/package.json" }, { - "path": "node_modules/configstore/node_modules/make-dir/package.json" + "path": "node_modules/get-caller-file/package.json" }, { - "path": "node_modules/v8-to-istanbul/package.json" + "path": "node_modules/klaw/package.json" }, { - "path": "node_modules/v8-to-istanbul/node_modules/source-map/package.json" + "path": "node_modules/public-encrypt/package.json" }, { - "path": "node_modules/dot-prop/package.json" + "path": "node_modules/map-obj/package.json" }, { - "path": "node_modules/tsutils/package.json" + "path": "node_modules/node-fetch/package.json" }, { - "path": "node_modules/npm-bundled/package.json" + "path": "node_modules/jsonexport/package.json" }, { - "path": "node_modules/import-fresh/package.json" + "path": "node_modules/isexe/package.json" }, { - "path": "node_modules/mute-stream/package.json" + "path": "node_modules/object.pick/package.json" }, { - "path": "node_modules/browserify-des/package.json" + "path": "node_modules/escallmatch/package.json" }, { - "path": "node_modules/wide-align/package.json" + "path": "node_modules/escallmatch/node_modules/esprima/package.json" }, { - "path": "node_modules/wide-align/node_modules/string-width/package.json" + "path": "node_modules/espower/package.json" }, { - "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" + "path": "node_modules/espower/node_modules/source-map/package.json" }, { - "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" + "path": "node_modules/run-async/package.json" }, { - "path": "node_modules/eslint-scope/package.json" + "path": "node_modules/@webassemblyjs/ast/package.json" }, { - "path": "node_modules/readdirp/package.json" + "path": "node_modules/@webassemblyjs/wast-printer/package.json" }, { - "path": "node_modules/readdirp/node_modules/braces/package.json" + "path": "node_modules/@webassemblyjs/helper-code-frame/package.json" }, { - "path": "node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/package.json" + "path": "node_modules/@webassemblyjs/wasm-opt/package.json" }, { - "path": "node_modules/readdirp/node_modules/to-regex-range/package.json" + "path": "node_modules/@webassemblyjs/helper-wasm-bytecode/package.json" }, { - "path": "node_modules/readdirp/node_modules/is-buffer/package.json" + "path": "node_modules/@webassemblyjs/helper-wasm-section/package.json" }, { - "path": "node_modules/readdirp/node_modules/fill-range/package.json" + "path": "node_modules/@webassemblyjs/wasm-parser/package.json" }, { - "path": "node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/package.json" + "path": "node_modules/@webassemblyjs/helper-api-error/package.json" }, { - "path": "node_modules/readdirp/node_modules/micromatch/README.md" + "path": "node_modules/@webassemblyjs/helper-buffer/package.json" }, { - "path": "node_modules/readdirp/node_modules/micromatch/package.json" + "path": "node_modules/@webassemblyjs/utf8/package.json" }, { - "path": "node_modules/readdirp/node_modules/micromatch/CHANGELOG.md" + "path": "node_modules/@webassemblyjs/wast-parser/package.json" }, { - "path": "node_modules/readdirp/node_modules/micromatch/index.js" + "path": "node_modules/@webassemblyjs/wasm-gen/package.json" }, { - "path": "node_modules/readdirp/node_modules/micromatch/LICENSE" + "path": "node_modules/@webassemblyjs/leb128/package.json" }, { - "path": "node_modules/readdirp/node_modules/micromatch/lib/parsers.js" + "path": "node_modules/@webassemblyjs/helper-fsm/package.json" }, { - "path": "node_modules/readdirp/node_modules/micromatch/lib/.DS_Store" + "path": "node_modules/@webassemblyjs/wasm-edit/package.json" }, { - "path": "node_modules/readdirp/node_modules/micromatch/lib/utils.js" + "path": "node_modules/@webassemblyjs/ieee754/package.json" }, { - "path": "node_modules/readdirp/node_modules/micromatch/lib/compilers.js" + "path": "node_modules/@webassemblyjs/helper-module-context/package.json" }, { - "path": "node_modules/readdirp/node_modules/micromatch/lib/cache.js" + "path": "node_modules/@webassemblyjs/floating-point-hex-parser/package.json" }, { - "path": "node_modules/readdirp/node_modules/is-number/package.json" + "path": "node_modules/validate-npm-package-license/package.json" }, { - "path": "node_modules/readdirp/node_modules/is-number/node_modules/kind-of/package.json" + "path": "node_modules/file-entry-cache/package.json" }, { - "path": "node_modules/cache-base/package.json" + "path": "node_modules/meow/package.json" }, { - "path": "node_modules/is-promise/package.json" + "path": "node_modules/meow/node_modules/camelcase/package.json" }, { - "path": "node_modules/parallel-transform/package.json" + "path": "node_modules/meow/node_modules/yargs-parser/package.json" }, { - "path": "node_modules/es6-map/package.json" + "path": "node_modules/cacache/package.json" }, { - "path": "node_modules/p-finally/package.json" + "path": "node_modules/cacache/node_modules/rimraf/package.json" }, { - "path": "node_modules/snapdragon-node/package.json" + "path": "node_modules/concat-map/package.json" }, { - "path": "node_modules/snapdragon-node/node_modules/is-data-descriptor/package.json" + "path": "node_modules/infer-owner/package.json" }, { - "path": "node_modules/snapdragon-node/node_modules/is-descriptor/package.json" + "path": "node_modules/term-size/package.json" }, { - "path": "node_modules/snapdragon-node/node_modules/is-accessor-descriptor/package.json" + "path": "node_modules/xmlcreate/package.json" }, { - "path": "node_modules/snapdragon-node/node_modules/define-property/package.json" + "path": "node_modules/ansi-regex/package.json" }, { - "path": "node_modules/browserify-cipher/package.json" + "path": "node_modules/yallist/package.json" }, { - "path": "node_modules/es6-set/package.json" + "path": "node_modules/class-utils/package.json" }, { - "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" + "path": "node_modules/class-utils/node_modules/define-property/package.json" }, { - "path": "node_modules/array-find/package.json" + "path": "node_modules/json-bigint/package.json" }, { - "path": "node_modules/arr-flatten/package.json" + "path": "node_modules/hmac-drbg/package.json" }, { - "path": "node_modules/evp_bytestokey/package.json" + "path": "node_modules/resolve-from/package.json" }, { - "path": "node_modules/js2xmlparser/package.json" + "path": "node_modules/is-buffer/package.json" }, { - "path": "node_modules/has-value/package.json" + "path": "node_modules/cliui/package.json" }, { - "path": "node_modules/istanbul-reports/package.json" + "path": "node_modules/cipher-base/package.json" }, { - "path": "node_modules/tty-browserify/package.json" + "path": "node_modules/toidentifier/package.json" }, { - "path": "node_modules/get-value/package.json" + "path": "node_modules/balanced-match/package.json" }, { - "path": "node_modules/@webassemblyjs/wasm-gen/package.json" + "path": "node_modules/marked/package.json" }, { - "path": "node_modules/@webassemblyjs/helper-fsm/package.json" + "path": "node_modules/wrappy/package.json" }, { - "path": "node_modules/@webassemblyjs/floating-point-hex-parser/package.json" + "path": "node_modules/jsdoc-region-tag/package.json" }, { - "path": "node_modules/@webassemblyjs/helper-code-frame/package.json" + "path": "node_modules/json-stable-stringify-without-jsonify/package.json" }, { - "path": "node_modules/@webassemblyjs/helper-wasm-section/package.json" + "path": "node_modules/glob-parent/package.json" }, { - "path": "node_modules/@webassemblyjs/ast/package.json" + "path": "node_modules/collection-visit/package.json" }, { - "path": "node_modules/@webassemblyjs/wast-printer/package.json" + "path": "node_modules/xtend/package.json" }, { - "path": "node_modules/@webassemblyjs/helper-module-context/package.json" + "path": "node_modules/loader-utils/package.json" }, { - "path": "node_modules/@webassemblyjs/wasm-edit/package.json" + "path": "node_modules/assign-symbols/package.json" }, { - "path": "node_modules/@webassemblyjs/leb128/package.json" + "path": "node_modules/assert/package.json" }, { - "path": "node_modules/@webassemblyjs/wast-parser/package.json" + "path": "node_modules/assert/node_modules/util/package.json" }, { - "path": "node_modules/@webassemblyjs/ieee754/package.json" + "path": "node_modules/assert/node_modules/inherits/package.json" }, { - "path": "node_modules/@webassemblyjs/wasm-opt/package.json" + "path": "node_modules/is-arguments/package.json" }, { - "path": "node_modules/@webassemblyjs/utf8/package.json" + "path": "node_modules/bn.js/package.json" }, { - "path": "node_modules/@webassemblyjs/helper-buffer/package.json" + "path": "node_modules/set-blocking/package.json" }, { - "path": "node_modules/@webassemblyjs/helper-wasm-bytecode/package.json" + "path": "node_modules/fill-range/package.json" }, { - "path": "node_modules/@webassemblyjs/wasm-parser/package.json" + "path": "node_modules/from2/package.json" }, { - "path": "node_modules/@webassemblyjs/helper-api-error/package.json" + "path": "node_modules/object-visit/package.json" }, { - "path": "node_modules/indexof/package.json" + "path": "node_modules/istanbul-lib-report/package.json" }, { - "path": "node_modules/is-data-descriptor/package.json" + "path": "node_modules/load-json-file/package.json" }, { - "path": "node_modules/is-data-descriptor/node_modules/is-buffer/package.json" + "path": "node_modules/mississippi/package.json" }, { - "path": "node_modules/is-data-descriptor/node_modules/kind-of/package.json" + "path": "node_modules/mississippi/node_modules/through2/package.json" }, { - "path": "node_modules/progress/package.json" + "path": "node_modules/has-value/package.json" }, { - "path": "node_modules/registry-url/package.json" + "path": "node_modules/readdirp/package.json" }, { - "path": "node_modules/google-gax/package.json" + "path": "node_modules/readdirp/node_modules/is-buffer/package.json" }, { - "path": "node_modules/class-utils/package.json" + "path": "node_modules/readdirp/node_modules/fill-range/package.json" }, { - "path": "node_modules/class-utils/node_modules/define-property/package.json" + "path": "node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/package.json" }, { - "path": "node_modules/mimic-response/package.json" + "path": "node_modules/readdirp/node_modules/is-number/package.json" }, { - "path": "node_modules/figures/package.json" + "path": "node_modules/readdirp/node_modules/is-number/node_modules/kind-of/package.json" }, { - "path": "node_modules/eslint-config-prettier/package.json" + "path": "node_modules/readdirp/node_modules/micromatch/index.js" }, { - "path": "node_modules/argparse/package.json" + "path": "node_modules/readdirp/node_modules/micromatch/README.md" }, { - "path": "node_modules/type/package.json" + "path": "node_modules/readdirp/node_modules/micromatch/package.json" }, { - "path": "node_modules/domhandler/package.json" + "path": "node_modules/readdirp/node_modules/micromatch/LICENSE" }, { - "path": "node_modules/error-ex/package.json" + "path": "node_modules/readdirp/node_modules/micromatch/CHANGELOG.md" }, { - "path": "node_modules/to-object-path/package.json" + "path": "node_modules/readdirp/node_modules/micromatch/lib/parsers.js" }, { - "path": "node_modules/to-object-path/node_modules/is-buffer/package.json" + "path": "node_modules/readdirp/node_modules/micromatch/lib/.DS_Store" }, { - "path": "node_modules/to-object-path/node_modules/kind-of/package.json" + "path": "node_modules/readdirp/node_modules/micromatch/lib/compilers.js" }, { - "path": "node_modules/errno/package.json" + "path": "node_modules/readdirp/node_modules/micromatch/lib/utils.js" }, { - "path": "node_modules/ansi-colors/package.json" + "path": "node_modules/readdirp/node_modules/micromatch/lib/cache.js" }, { - "path": "node_modules/safer-buffer/package.json" + "path": "node_modules/readdirp/node_modules/braces/package.json" }, { - "path": "node_modules/object.pick/package.json" + "path": "node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/package.json" }, { - "path": "node_modules/type-fest/package.json" + "path": "node_modules/readdirp/node_modules/to-regex-range/package.json" }, { - "path": "node_modules/posix-character-classes/package.json" + "path": "node_modules/is-number/package.json" }, { - "path": "node_modules/strip-indent/package.json" + "path": "node_modules/ansi-align/package.json" }, { - "path": "node_modules/boxen/package.json" + "path": "node_modules/ansi-align/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/boxen/node_modules/type-fest/package.json" + "path": "node_modules/ansi-align/node_modules/string-width/package.json" }, { - "path": "node_modules/flat-cache/package.json" + "path": "node_modules/ansi-align/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/flat-cache/node_modules/rimraf/package.json" + "path": "node_modules/ansi-align/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/process/package.json" + "path": "node_modules/ansi-align/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/querystring-es3/package.json" + "path": "node_modules/atob/package.json" }, { - "path": "node_modules/ripemd160/package.json" + "path": "node_modules/duplexer3/package.json" }, { - "path": "node_modules/findup-sync/package.json" + "path": "node_modules/esprima/package.json" }, { - "path": "node_modules/findup-sync/node_modules/braces/package.json" + "path": "node_modules/is-stream-ended/package.json" }, { - "path": "node_modules/findup-sync/node_modules/braces/node_modules/extend-shallow/package.json" + "path": "node_modules/minimatch/package.json" }, { - "path": "node_modules/findup-sync/node_modules/to-regex-range/package.json" + "path": "node_modules/crypto-random-string/package.json" }, { - "path": "node_modules/findup-sync/node_modules/is-buffer/package.json" + "path": "node_modules/growl/package.json" }, { - "path": "node_modules/findup-sync/node_modules/fill-range/package.json" + "path": "node_modules/string.prototype.trimleft/package.json" }, { - "path": "node_modules/findup-sync/node_modules/fill-range/node_modules/extend-shallow/package.json" + "path": "node_modules/istanbul-lib-coverage/package.json" }, { - "path": "node_modules/findup-sync/node_modules/micromatch/README.md" + "path": "node_modules/global-prefix/package.json" }, { - "path": "node_modules/findup-sync/node_modules/micromatch/package.json" + "path": "node_modules/global-prefix/node_modules/which/package.json" }, { - "path": "node_modules/findup-sync/node_modules/micromatch/CHANGELOG.md" + "path": "node_modules/normalize-package-data/package.json" }, { - "path": "node_modules/findup-sync/node_modules/micromatch/index.js" + "path": "node_modules/normalize-package-data/node_modules/semver/package.json" }, { - "path": "node_modules/findup-sync/node_modules/micromatch/LICENSE" + "path": "node_modules/fast-text-encoding/package.json" }, { - "path": "node_modules/findup-sync/node_modules/micromatch/lib/parsers.js" + "path": "node_modules/tar/package.json" }, { - "path": "node_modules/findup-sync/node_modules/micromatch/lib/.DS_Store" + "path": "node_modules/tar/node_modules/yallist/package.json" }, { - "path": "node_modules/findup-sync/node_modules/micromatch/lib/utils.js" + "path": "node_modules/cyclist/package.json" }, { - "path": "node_modules/findup-sync/node_modules/micromatch/lib/compilers.js" + "path": "node_modules/server-destroy/package.json" }, { - "path": "node_modules/findup-sync/node_modules/micromatch/lib/cache.js" + "path": "node_modules/remove-trailing-separator/package.json" }, { - "path": "node_modules/findup-sync/node_modules/is-number/package.json" + "path": "node_modules/prelude-ls/package.json" }, { - "path": "node_modules/findup-sync/node_modules/is-number/node_modules/kind-of/package.json" + "path": "node_modules/d/package.json" }, { - "path": "node_modules/has-symbols/package.json" + "path": "node_modules/protobufjs/package.json" }, { - "path": "node_modules/gcp-metadata/package.json" + "path": "node_modules/protobufjs/cli/package-lock.json" }, { - "path": "node_modules/ansi-align/package.json" + "path": "node_modules/protobufjs/cli/package.json" }, { - "path": "node_modules/find-up/package.json" + "path": "node_modules/protobufjs/cli/node_modules/uglify-js/package.json" }, { - "path": "node_modules/log-symbols/package.json" + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" }, { - "path": "node_modules/merge-estraverse-visitors/package.json" + "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" }, { - "path": "node_modules/is-extglob/package.json" + "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" }, { - "path": "node_modules/json-stable-stringify-without-jsonify/package.json" + "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" }, { - "path": "node_modules/prettier/package.json" + "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" }, { - "path": "node_modules/jsonexport/package.json" + "path": "node_modules/protobufjs/cli/node_modules/commander/package.json" }, { - "path": "node_modules/watchpack/package.json" + "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" }, { - "path": "node_modules/.bin/sha.js" + "path": "node_modules/protobufjs/cli/node_modules/source-map/package.json" }, { - "path": "node_modules/safe-regex/package.json" + "path": "node_modules/protobufjs/node_modules/@types/node/package.json" }, { - "path": "node_modules/wrappy/package.json" + "path": "node_modules/domhandler/package.json" }, { - "path": "node_modules/npm-run-path/package.json" + "path": "node_modules/pkg-dir/package.json" }, { - "path": "node_modules/npm-run-path/node_modules/path-key/package.json" + "path": "node_modules/pkg-dir/node_modules/p-locate/package.json" }, { - "path": "node_modules/mississippi/package.json" + "path": "node_modules/pkg-dir/node_modules/locate-path/package.json" }, { - "path": "node_modules/mississippi/node_modules/through2/package.json" + "path": "node_modules/pkg-dir/node_modules/find-up/package.json" }, { - "path": "node_modules/promise-inflight/package.json" + "path": "node_modules/pkg-dir/node_modules/path-exists/package.json" }, { - "path": "node_modules/browserify-sign/package.json" + "path": "node_modules/ansi-escapes/package.json" }, { - "path": "node_modules/map-obj/package.json" + "path": "node_modules/power-assert-renderer-base/package.json" }, { - "path": "node_modules/term-size/package.json" + "path": "node_modules/boolbase/package.json" }, { - "path": "node_modules/pbkdf2/package.json" + "path": "node_modules/aproba/package.json" }, { - "path": "node_modules/stream-http/package.json" + "path": "node_modules/fragment-cache/package.json" }, { - "path": "node_modules/destroy/package.json" + "path": "node_modules/indent-string/package.json" }, { - "path": "node_modules/growl/package.json" + "path": "node_modules/lodash/package.json" }, { - "path": "node_modules/flush-write-stream/package.json" + "path": "node_modules/taffydb/package.json" }, { - "path": "node_modules/json-schema-traverse/package.json" + "path": "node_modules/extend/package.json" }, { - "path": "node_modules/npm-packlist/package.json" + "path": "node_modules/is-yarn-global/package.json" }, { - "path": "node_modules/taffydb/package.json" + "path": "node_modules/dom-serializer/package.json" }, { - "path": "node_modules/cross-spawn/package.json" + "path": "node_modules/end-of-stream/package.json" }, { - "path": "node_modules/loud-rejection/package.json" + "path": "node_modules/log-symbols/package.json" }, { - "path": "node_modules/is-glob/package.json" + "path": "node_modules/is-callable/package.json" }, { - "path": "node_modules/get-stream/package.json" + "path": "node_modules/es5-ext/package.json" }, { - "path": "node_modules/uglify-js/package.json" + "path": "node_modules/https-browserify/package.json" }, { - "path": "node_modules/minipass/package.json" + "path": "node_modules/stringifier/package.json" }, { - "path": "node_modules/minipass/node_modules/yallist/package.json" + "path": "node_modules/source-list-map/package.json" }, { - "path": "node_modules/repeat-element/package.json" + "path": "node_modules/vm-browserify/package.json" }, { - "path": "node_modules/optimist/package.json" + "path": "node_modules/es6-weak-map/package.json" }, { - "path": "node_modules/empower/package.json" + "path": "node_modules/camelcase-keys/package.json" }, { - "path": "node_modules/cacheable-request/package.json" + "path": "node_modules/camelcase-keys/node_modules/camelcase/package.json" }, { - "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" + "path": "node_modules/browserify-zlib/package.json" }, { - "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" + "path": "node_modules/pascalcase/package.json" }, { - "path": "node_modules/is-ci/package.json" + "path": "node_modules/decompress-response/package.json" }, { - "path": "node_modules/server-destroy/package.json" + "path": "node_modules/set-value/package.json" }, { - "path": "node_modules/copy-concurrently/package.json" + "path": "node_modules/set-value/node_modules/extend-shallow/package.json" }, { - "path": "node_modules/copy-concurrently/node_modules/rimraf/package.json" + "path": "node_modules/js-yaml/package.json" }, { - "path": "node_modules/import-local/package.json" + "path": "node_modules/cli-boxes/package.json" }, { - "path": "node_modules/json-parse-better-errors/package.json" + "path": "node_modules/is-obj/package.json" }, { - "path": "node_modules/iferr/package.json" + "path": "node_modules/is-typedarray/package.json" }, { - "path": "node_modules/core-js/package.json" + "path": "node_modules/is-binary-path/package.json" }, { - "path": "node_modules/set-blocking/package.json" + "path": "node_modules/registry-auth-token/package.json" }, { - "path": "node_modules/p-defer/package.json" + "path": "node_modules/safe-regex/package.json" }, { - "path": "node_modules/create-hmac/package.json" + "path": "node_modules/decode-uri-component/package.json" }, { - "path": "node_modules/next-tick/package.json" + "path": "node_modules/read-pkg-up/package.json" }, { - "path": "node_modules/catharsis/package.json" + "path": "node_modules/read-pkg-up/node_modules/p-locate/package.json" }, { - "path": "node_modules/rimraf/package.json" + "path": "node_modules/read-pkg-up/node_modules/locate-path/package.json" }, { - "path": "node_modules/agent-base/package.json" + "path": "node_modules/read-pkg-up/node_modules/p-try/package.json" }, { - "path": "node_modules/json-bigint/package.json" + "path": "node_modules/read-pkg-up/node_modules/p-limit/package.json" }, { - "path": "node_modules/spdx-exceptions/package.json" + "path": "node_modules/read-pkg-up/node_modules/find-up/package.json" }, { - "path": "node_modules/color-name/package.json" + "path": "node_modules/read-pkg-up/node_modules/path-exists/package.json" }, { - "path": "node_modules/through/package.json" + "path": "node_modules/buffer-equal-constant-time/package.json" }, { - "path": "node_modules/braces/package.json" + "path": "node_modules/@bcoe/v8-coverage/package.json" }, { - "path": "node_modules/jws/package.json" + "path": "node_modules/eslint-scope/package.json" }, { - "path": "node_modules/inquirer/package.json" + "path": "node_modules/stream-shift/package.json" }, { - "path": "node_modules/inquirer/node_modules/string-width/package.json" + "path": "node_modules/union-value/package.json" }, { - "path": "node_modules/inquirer/node_modules/string-width/node_modules/strip-ansi/package.json" + "path": "node_modules/invert-kv/package.json" }, { - "path": "node_modules/inquirer/node_modules/ansi-regex/package.json" + "path": "node_modules/snapdragon-node/package.json" }, { - "path": "node_modules/inquirer/node_modules/emoji-regex/package.json" + "path": "node_modules/snapdragon-node/node_modules/define-property/package.json" }, { - "path": "node_modules/inquirer/node_modules/is-fullwidth-code-point/package.json" + "path": "node_modules/snapdragon-node/node_modules/is-data-descriptor/package.json" }, { - "path": "node_modules/urix/package.json" + "path": "node_modules/snapdragon-node/node_modules/is-accessor-descriptor/package.json" }, { - "path": "node_modules/etag/package.json" + "path": "node_modules/snapdragon-node/node_modules/is-descriptor/package.json" }, { - "path": "node_modules/power-assert-formatter/package.json" + "path": "node_modules/is-extglob/package.json" }, { - "path": "node_modules/to-regex-range/package.json" + "path": "node_modules/typedarray-to-buffer/index.js" }, { - "path": "node_modules/text-table/package.json" + "path": "node_modules/typedarray-to-buffer/README.md" }, { - "path": "node_modules/color-convert/package.json" + "path": "node_modules/typedarray-to-buffer/.airtap.yml" }, { - "path": "node_modules/escope/package.json" + "path": "node_modules/typedarray-to-buffer/.travis.yml" }, { - "path": "node_modules/ansi-regex/package.json" + "path": "node_modules/typedarray-to-buffer/package.json" }, { - "path": "node_modules/is-installed-globally/package.json" + "path": "node_modules/typedarray-to-buffer/LICENSE" }, { - "path": "node_modules/builtin-status-codes/package.json" + "path": "node_modules/typedarray-to-buffer/test/basic.js" }, { - "path": "node_modules/memory-fs/package.json" + "path": "node_modules/restore-cursor/package.json" }, { - "path": "node_modules/redent/package.json" + "path": "node_modules/pbkdf2/package.json" }, { - "path": "node_modules/schema-utils/package.json" + "path": "node_modules/events/package.json" }, { - "path": "node_modules/is-buffer/package.json" + "path": "node_modules/map-cache/package.json" }, { - "path": "node_modules/esrecurse/package.json" + "path": "node_modules/mimic-response/package.json" }, { - "path": "node_modules/tslint/package.json" + "path": "node_modules/normalize-url/package.json" }, { - "path": "node_modules/tslint/node_modules/semver/package.json" + "path": "node_modules/kind-of/package.json" }, { - "path": "node_modules/decamelize/package.json" + "path": "node_modules/fresh/package.json" }, { - "path": "node_modules/parse-json/package.json" + "path": "node_modules/interpret/package.json" }, { - "path": "node_modules/mime/package.json" + "path": "node_modules/imurmurhash/package.json" }, { - "path": "node_modules/google-auth-library/package.json" + "path": "node_modules/indexof/package.json" }, { - "path": "node_modules/decode-uri-component/package.json" + "path": "node_modules/arr-flatten/package.json" }, { - "path": "node_modules/randomfill/package.json" + "path": "node_modules/ajv/package.json" }, { - "path": "node_modules/ignore/package.json" + "path": "node_modules/is-path-inside/package.json" }, { - "path": "node_modules/loader-runner/package.json" + "path": "node_modules/timers-browserify/package.json" }, { - "path": "node_modules/homedir-polyfill/package.json" + "path": "node_modules/import-lazy/package.json" }, { - "path": "node_modules/depd/package.json" + "path": "node_modules/json-schema-traverse/package.json" }, { - "path": "node_modules/union-value/package.json" + "path": "node_modules/ncp/package.json" }, { - "path": "node_modules/camelcase-keys/package.json" + "path": "node_modules/rxjs/package.json" }, { - "path": "node_modules/camelcase-keys/node_modules/camelcase/package.json" + "path": "node_modules/p-locate/package.json" }, { - "path": "node_modules/ansi-escapes/package.json" + "path": "node_modules/figures/package.json" }, { - "path": "node_modules/concat-stream/package.json" + "path": "node_modules/os-browserify/package.json" }, { - "path": "node_modules/is-descriptor/package.json" + "path": "node_modules/underscore/package.json" }, { - "path": "node_modules/is-descriptor/node_modules/kind-of/package.json" + "path": "node_modules/finalhandler/package.json" }, { - "path": "node_modules/expand-brackets/package.json" + "path": "node_modules/finalhandler/node_modules/debug/package.json" }, { - "path": "node_modules/expand-brackets/node_modules/extend-shallow/package.json" + "path": "node_modules/finalhandler/node_modules/ms/package.json" }, { - "path": "node_modules/expand-brackets/node_modules/define-property/package.json" + "path": "node_modules/ignore/package.json" }, { - "path": "node_modules/expand-brackets/node_modules/ms/package.json" + "path": "node_modules/path-is-absolute/package.json" }, { - "path": "node_modules/expand-brackets/node_modules/debug/package.json" + "path": "node_modules/arr-diff/package.json" }, { - "path": "node_modules/decompress-response/package.json" + "path": "node_modules/graceful-fs/package.json" }, { - "path": "node_modules/end-of-stream/package.json" + "path": "node_modules/is-extendable/package.json" }, { - "path": "node_modules/diff-match-patch/package.json" + "path": "node_modules/currently-unhandled/package.json" }, { - "path": "node_modules/big.js/package.json" + "path": "node_modules/minizlib/package.json" }, { - "path": "node_modules/amdefine/package.json" + "path": "node_modules/minizlib/node_modules/yallist/package.json" }, { - "path": "node_modules/event-emitter/package.json" + "path": "node_modules/source-map-resolve/package.json" }, { - "path": "node_modules/has-values/package.json" + "path": "node_modules/google-gax/package.json" }, { - "path": "node_modules/has-values/node_modules/is-buffer/package.json" + "path": "node_modules/browserify-aes/package.json" }, { - "path": "node_modules/has-values/node_modules/kind-of/package.json" + "path": "node_modules/commondir/package.json" }, { - "path": "node_modules/has-values/node_modules/is-number/package.json" + "path": "node_modules/onetime/package.json" }, { - "path": "node_modules/has-values/node_modules/is-number/node_modules/kind-of/package.json" + "path": "node_modules/lcid/package.json" }, { - "path": "node_modules/is-windows/package.json" + "path": "node_modules/path-key/package.json" }, { - "path": "node_modules/diff/package.json" + "path": "node_modules/core-util-is/package.json" }, { - "path": "node_modules/tmp/package.json" + "path": "node_modules/array-filter/package.json" }, { - "path": "node_modules/public-encrypt/package.json" + "path": "node_modules/prepend-http/package.json" }, { - "path": "node_modules/source-map/package.json" + "path": "node_modules/console-browserify/package.json" }, { - "path": "node_modules/is-obj/package.json" + "path": "node_modules/write/package.json" }, { - "path": "node_modules/asn1.js/package.json" + "path": "node_modules/duplexify/package.json" }, { - "path": "node_modules/buffer/package.json" + "path": "node_modules/camelcase/package.json" }, { - "path": "node_modules/yargs-parser/package.json" + "path": "node_modules/tty-browserify/package.json" }, { - "path": "node_modules/escape-string-regexp/package.json" + "path": "node_modules/error-ex/package.json" }, { - "path": "node_modules/es-abstract/package.json" + "path": "node_modules/empower-assert/package.json" }, { - "path": "node_modules/linkinator/package.json" + "path": "node_modules/micromatch/package.json" }, { - "path": "node_modules/linkinator/node_modules/has-flag/package.json" + "path": "node_modules/boxen/package.json" }, { - "path": "node_modules/linkinator/node_modules/color-name/package.json" + "path": "node_modules/boxen/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/linkinator/node_modules/color-convert/package.json" + "path": "node_modules/boxen/node_modules/string-width/package.json" }, { - "path": "node_modules/linkinator/node_modules/supports-color/package.json" + "path": "node_modules/boxen/node_modules/type-fest/package.json" }, { - "path": "node_modules/linkinator/node_modules/ansi-styles/package.json" + "path": "node_modules/boxen/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/linkinator/node_modules/chalk/package.json" + "path": "node_modules/boxen/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/import-lazy/package.json" + "path": "node_modules/boxen/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/inflight/package.json" + "path": "node_modules/repeat-element/package.json" }, { - "path": "node_modules/use/package.json" + "path": "node_modules/querystring/package.json" }, { - "path": "node_modules/concat-map/package.json" + "path": "node_modules/node-environment-flags/package.json" }, { - "path": "node_modules/browserify-rsa/package.json" + "path": "node_modules/node-environment-flags/node_modules/semver/package.json" }, { - "path": "node_modules/object.assign/package.json" + "path": "node_modules/c8/package.json" }, { - "path": "node_modules/es6-symbol/package.json" + "path": "node_modules/gcp-metadata/package.json" }, { - "path": "node_modules/hash.js/package.json" + "path": "node_modules/json-buffer/package.json" }, { - "path": "node_modules/expand-tilde/package.json" + "path": "node_modules/stream-each/package.json" }, { - "path": "node_modules/semver/package.json" + "path": "node_modules/mkdirp/package.json" }, { - "path": "node_modules/jsdoc-fresh/package.json" + "path": "node_modules/bluebird/package.json" }, { - "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" + "path": "node_modules/null-loader/package.json" }, { - "path": "node_modules/ts-loader/package.json" + "path": "node_modules/big.js/package.json" }, { - "path": "node_modules/is-typedarray/package.json" + "path": "node_modules/shebang-command/package.json" }, { - "path": "node_modules/resolve-cwd/package.json" + "path": "node_modules/serve-static/package.json" }, { - "path": "node_modules/resolve-cwd/node_modules/resolve-from/package.json" + "path": "node_modules/object-copy/package.json" }, { - "path": "node_modules/htmlparser2/package.json" + "path": "node_modules/object-copy/node_modules/define-property/package.json" }, { - "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" + "path": "node_modules/object-copy/node_modules/is-buffer/package.json" }, { - "path": "node_modules/cli-boxes/package.json" + "path": "node_modules/object-copy/node_modules/kind-of/package.json" }, { - "path": "node_modules/supports-color/package.json" + "path": "node_modules/path-parse/package.json" }, { - "path": "node_modules/path-key/package.json" + "path": "node_modules/mime/package.json" }, { - "path": "node_modules/lru-cache/package.json" + "path": "node_modules/terser/package.json" }, { - "path": "node_modules/rc/package.json" + "path": "node_modules/terser/node_modules/source-map-support/package.json" }, { - "path": "node_modules/rc/node_modules/minimist/package.json" + "path": "node_modules/terser/node_modules/source-map/package.json" }, { - "path": "node_modules/rc/node_modules/strip-json-comments/package.json" + "path": "node_modules/emojis-list/package.json" }, { "path": "node_modules/yargs-unparser/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/locate-path/package.json" + "path": "node_modules/yargs-unparser/node_modules/color-name/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/find-up/package.json" + "path": "node_modules/yargs-unparser/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/yargs-parser/package.json" + "path": "node_modules/yargs-unparser/node_modules/string-width/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/path-exists/package.json" + "path": "node_modules/yargs-unparser/node_modules/ansi-regex/package.json" + }, + { + "path": "node_modules/yargs-unparser/node_modules/cliui/package.json" }, { "path": "node_modules/yargs-unparser/node_modules/p-locate/package.json" }, { - "path": "node_modules/yargs-unparser/node_modules/yargs/package.json" + "path": "node_modules/yargs-unparser/node_modules/locate-path/package.json" }, { - "path": "node_modules/worker-farm/package.json" + "path": "node_modules/yargs-unparser/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/extend-shallow/package.json" + "path": "node_modules/yargs-unparser/node_modules/ansi-styles/package.json" }, { - "path": "node_modules/extend-shallow/node_modules/is-extendable/package.json" + "path": "node_modules/yargs-unparser/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/abort-controller/package.json" + "path": "node_modules/yargs-unparser/node_modules/find-up/package.json" }, { - "path": "node_modules/http-errors/package.json" + "path": "node_modules/yargs-unparser/node_modules/wrap-ansi/package.json" }, { - "path": "node_modules/marked/package.json" + "path": "node_modules/yargs-unparser/node_modules/path-exists/package.json" }, { - "path": "node_modules/is-plain-obj/package.json" + "path": "node_modules/yargs-unparser/node_modules/yargs/package.json" }, { - "path": "node_modules/minimatch/package.json" + "path": "node_modules/yargs-unparser/node_modules/color-convert/package.json" }, { - "path": "node_modules/parse-asn1/package.json" + "path": "node_modules/yargs-unparser/node_modules/yargs-parser/package.json" }, { - "path": "node_modules/send/package.json" + "path": "node_modules/minimalistic-crypto-utils/package.json" }, { - "path": "node_modules/send/node_modules/mime/package.json" + "path": "node_modules/lines-and-columns/package.json" }, { - "path": "node_modules/send/node_modules/ms/package.json" + "path": "node_modules/minimalistic-assert/package.json" }, { - "path": "node_modules/send/node_modules/debug/package.json" + "path": "node_modules/is-url/package.json" }, { - "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" + "path": "node_modules/is-data-descriptor/package.json" }, { - "path": "node_modules/css-select/package.json" + "path": "node_modules/is-data-descriptor/node_modules/is-buffer/package.json" }, { - "path": "node_modules/uri-js/package.json" + "path": "node_modules/is-data-descriptor/node_modules/kind-of/package.json" }, { - "path": "node_modules/google-p12-pem/package.json" + "path": "node_modules/chalk/package.json" }, { - "path": "node_modules/is-accessor-descriptor/package.json" + "path": "node_modules/chalk/node_modules/color-name/package.json" }, { - "path": "node_modules/is-accessor-descriptor/node_modules/is-buffer/package.json" + "path": "node_modules/chalk/node_modules/has-flag/package.json" }, { - "path": "node_modules/is-accessor-descriptor/node_modules/kind-of/package.json" + "path": "node_modules/chalk/node_modules/ansi-styles/package.json" }, { - "path": "node_modules/component-emitter/package.json" + "path": "node_modules/chalk/node_modules/supports-color/package.json" }, { - "path": "node_modules/hmac-drbg/package.json" + "path": "node_modules/chalk/node_modules/color-convert/package.json" }, { - "path": "node_modules/npm-normalize-package-bin/package.json" + "path": "node_modules/locate-path/package.json" }, { - "path": "node_modules/spdx-license-ids/package.json" + "path": "node_modules/spdx-expression-parse/package.json" }, { - "path": "node_modules/yallist/package.json" + "path": "node_modules/power-assert-util-string-width/package.json" }, { - "path": "node_modules/setprototypeof/package.json" + "path": "node_modules/esquery/package.json" }, { - "path": "node_modules/hosted-git-info/package.json" + "path": "node_modules/to-readable-stream/package.json" }, { - "path": "node_modules/package-json/package.json" + "path": "node_modules/jsdoc-fresh/package.json" }, { - "path": "node_modules/from2/package.json" + "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" }, { - "path": "node_modules/elliptic/package.json" + "path": "node_modules/espower-location-detector/package.json" }, { - "path": "node_modules/write-file-atomic/package.json" + "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" }, { - "path": "node_modules/array-unique/package.json" + "path": "node_modules/strip-ansi/package.json" }, { - "path": "node_modules/external-editor/package.json" + "path": "node_modules/is-arrayish/package.json" }, { - "path": "node_modules/@sindresorhus/is/package.json" + "path": "node_modules/prettier-linter-helpers/package.json" }, { - "path": "node_modules/lodash.camelcase/package.json" + "path": "node_modules/chardet/package.json" }, { - "path": "node_modules/path-dirname/package.json" + "path": "node_modules/amdefine/package.json" }, { - "path": "node_modules/arrify/package.json" + "path": "node_modules/http-cache-semantics/package.json" }, { - "path": "node_modules/ansi-styles/package.json" + "path": "node_modules/concat-stream/package.json" }, { - "path": "node_modules/parseurl/package.json" + "path": "node_modules/has-flag/package.json" }, { - "path": "node_modules/boolbase/package.json" + "path": "node_modules/cheerio/package.json" }, { - "path": "node_modules/cliui/package.json" + "path": "node_modules/domelementtype/package.json" }, { - "path": "node_modules/balanced-match/package.json" + "path": "node_modules/npm-normalize-package-bin/package.json" }, { - "path": "node_modules/acorn/package.json" + "path": "node_modules/diffie-hellman/package.json" }, { - "path": "node_modules/stream-browserify/package.json" + "path": "node_modules/@szmarczak/http-timer/package.json" }, { - "path": "node_modules/load-json-file/package.json" + "path": "node_modules/tmp/package.json" }, { - "path": "node_modules/load-json-file/node_modules/pify/package.json" + "path": "node_modules/entities/package.json" }, { - "path": "node_modules/builtin-modules/package.json" + "path": "node_modules/execa/package.json" }, { - "path": "node_modules/chokidar/package.json" + "path": "node_modules/execa/node_modules/lru-cache/package.json" }, { - "path": "node_modules/chokidar/node_modules/glob-parent/package.json" + "path": "node_modules/execa/node_modules/yallist/package.json" }, { - "path": "node_modules/chokidar/node_modules/glob-parent/node_modules/is-glob/package.json" + "path": "node_modules/execa/node_modules/shebang-command/package.json" }, { - "path": "node_modules/chokidar/node_modules/braces/package.json" + "path": "node_modules/execa/node_modules/is-stream/package.json" }, { - "path": "node_modules/chokidar/node_modules/to-regex-range/package.json" + "path": "node_modules/execa/node_modules/which/package.json" }, { - "path": "node_modules/chokidar/node_modules/is-buffer/package.json" + "path": "node_modules/execa/node_modules/shebang-regex/package.json" }, { - "path": "node_modules/chokidar/node_modules/extend-shallow/package.json" + "path": "node_modules/execa/node_modules/cross-spawn/package.json" }, { - "path": "node_modules/chokidar/node_modules/kind-of/package.json" + "path": "node_modules/is-accessor-descriptor/package.json" }, { - "path": "node_modules/chokidar/node_modules/fill-range/package.json" + "path": "node_modules/is-accessor-descriptor/node_modules/is-buffer/package.json" }, { - "path": "node_modules/chokidar/node_modules/is-number/package.json" + "path": "node_modules/is-accessor-descriptor/node_modules/kind-of/package.json" }, { - "path": "node_modules/atob/package.json" + "path": "node_modules/strip-bom/package.json" }, { - "path": "node_modules/mamacro/package.json" + "path": "node_modules/argparse/package.json" }, { - "path": "node_modules/snapdragon/README.md" + "path": "node_modules/has/package.json" }, { - "path": "node_modules/snapdragon/package.json" + "path": "node_modules/ee-first/package.json" }, { - "path": "node_modules/snapdragon/index.js" + "path": "node_modules/serialize-javascript/package.json" }, { - "path": "node_modules/snapdragon/LICENSE" + "path": "node_modules/sha.js/sha512.js" }, { - "path": "node_modules/snapdragon/lib/compiler.js" + "path": "node_modules/sha.js/bin.js" }, { - "path": "node_modules/snapdragon/lib/position.js" + "path": "node_modules/sha.js/index.js" }, { - "path": "node_modules/snapdragon/lib/parser.js" + "path": "node_modules/sha.js/README.md" }, { - "path": "node_modules/snapdragon/lib/source-maps.js" + "path": "node_modules/sha.js/sha.js" }, { - "path": "node_modules/snapdragon/lib/utils.js" + "path": "node_modules/sha.js/sha256.js" }, { - "path": "node_modules/snapdragon/node_modules/source-map/package.json" + "path": "node_modules/sha.js/hash.js" }, { - "path": "node_modules/snapdragon/node_modules/extend-shallow/package.json" + "path": "node_modules/sha.js/.travis.yml" }, { - "path": "node_modules/snapdragon/node_modules/define-property/package.json" + "path": "node_modules/sha.js/package.json" }, { - "path": "node_modules/snapdragon/node_modules/ms/package.json" + "path": "node_modules/sha.js/sha384.js" }, { - "path": "node_modules/snapdragon/node_modules/debug/package.json" + "path": "node_modules/sha.js/sha1.js" }, { - "path": "node_modules/widest-line/package.json" + "path": "node_modules/sha.js/LICENSE" }, { - "path": "node_modules/widest-line/node_modules/string-width/package.json" + "path": "node_modules/sha.js/sha224.js" }, { - "path": "node_modules/widest-line/node_modules/strip-ansi/package.json" + "path": "node_modules/sha.js/test/test.js" }, { - "path": "node_modules/widest-line/node_modules/ansi-regex/package.json" + "path": "node_modules/sha.js/test/hash.js" }, { - "path": "node_modules/which/package.json" + "path": "node_modules/sha.js/test/vectors.js" }, { - "path": "node_modules/@bcoe/v8-coverage/package.json" + "path": "node_modules/object-inspect/package.json" }, { - "path": "node_modules/assert/package.json" + "path": "node_modules/deep-equal/package.json" }, { - "path": "node_modules/assert/node_modules/inherits/package.json" + "path": "node_modules/create-hash/package.json" }, { - "path": "node_modules/assert/node_modules/util/package.json" + "path": "node_modules/table/package.json" }, { - "path": "node_modules/prettier-linter-helpers/package.json" + "path": "node_modules/table/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/object-inspect/package.json" + "path": "node_modules/table/node_modules/string-width/package.json" }, { - "path": "node_modules/retry-request/package.json" + "path": "node_modules/table/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/retry-request/node_modules/debug/package.json" + "path": "node_modules/table/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/is-arrayish/package.json" + "path": "node_modules/table/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/shebang-regex/package.json" + "path": "node_modules/spdx-correct/package.json" }, { - "path": "node_modules/clone-response/package.json" + "path": "node_modules/get-stream/package.json" }, { - "path": "node_modules/ssri/package.json" + "path": "node_modules/expand-tilde/package.json" }, { - "path": "node_modules/deep-is/package.json" + "path": "node_modules/chownr/package.json" }, { - "path": "node_modules/@xtuc/ieee754/package.json" + "path": "node_modules/power-assert/package.json" }, { - "path": "node_modules/@xtuc/long/package.json" + "path": "node_modules/expand-brackets/package.json" }, { - "path": "node_modules/regexpp/package.json" + "path": "node_modules/expand-brackets/node_modules/define-property/package.json" }, { - "path": "node_modules/sha.js/README.md" + "path": "node_modules/expand-brackets/node_modules/debug/package.json" }, { - "path": "node_modules/sha.js/package.json" + "path": "node_modules/expand-brackets/node_modules/ms/package.json" }, { - "path": "node_modules/sha.js/hash.js" + "path": "node_modules/expand-brackets/node_modules/extend-shallow/package.json" }, { - "path": "node_modules/sha.js/.travis.yml" + "path": "node_modules/statuses/package.json" }, { - "path": "node_modules/sha.js/sha224.js" + "path": "node_modules/browserify-rsa/package.json" }, { - "path": "node_modules/sha.js/sha512.js" + "path": "node_modules/@istanbuljs/schema/package.json" }, { - "path": "node_modules/sha.js/bin.js" + "path": "node_modules/es6-set/package.json" }, { - "path": "node_modules/sha.js/sha.js" + "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" }, { - "path": "node_modules/sha.js/index.js" + "path": "node_modules/parse-passwd/package.json" }, { - "path": "node_modules/sha.js/sha384.js" + "path": "node_modules/istanbul-reports/package.json" }, { - "path": "node_modules/sha.js/sha1.js" + "path": "node_modules/browserify-sign/package.json" }, { - "path": "node_modules/sha.js/sha256.js" + "path": "node_modules/enhanced-resolve/package.json" }, { - "path": "node_modules/sha.js/LICENSE" + "path": "node_modules/@grpc/grpc-js/package.json" }, { - "path": "node_modules/sha.js/test/vectors.js" + "path": "node_modules/@grpc/grpc-js/node_modules/semver/package.json" }, { - "path": "node_modules/sha.js/test/test.js" + "path": "node_modules/@grpc/proto-loader/package.json" }, { - "path": "node_modules/sha.js/test/hash.js" + "path": "node_modules/lowercase-keys/package.json" }, { - "path": "node_modules/node-forge/package.json" + "path": "node_modules/etag/package.json" }, { - "path": "node_modules/pako/package.json" + "path": "node_modules/y18n/package.json" }, { - "path": "node_modules/power-assert/package.json" + "path": "node_modules/diff-match-patch/package.json" }, { - "path": "node_modules/path-is-absolute/package.json" + "path": "node_modules/es6-iterator/package.json" }, { - "path": "node_modules/ignore-walk/package.json" + "path": "node_modules/eslint-plugin-node/package.json" }, { - "path": "node_modules/finalhandler/package.json" + "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" }, { - "path": "node_modules/finalhandler/node_modules/ms/package.json" + "path": "node_modules/eslint-plugin-node/node_modules/semver/package.json" }, { - "path": "node_modules/finalhandler/node_modules/debug/package.json" + "path": "node_modules/eslint-plugin-node/node_modules/eslint-utils/package.json" }, { - "path": "node_modules/source-map-support/package.json" + "path": "node_modules/natural-compare/package.json" }, { - "path": "node_modules/source-map-support/node_modules/source-map/package.json" + "path": "node_modules/event-target-shim/package.json" }, { - "path": "node_modules/buffer-equal-constant-time/package.json" + "path": "node_modules/url/package.json" }, { - "path": "node_modules/source-map-resolve/package.json" + "path": "node_modules/url/node_modules/punycode/package.json" }, { - "path": "node_modules/path-parse/package.json" + "path": "node_modules/pako/package.json" }, { - "path": "node_modules/binary-extensions/package.json" + "path": "node_modules/arrify/package.json" }, { - "path": "node_modules/decamelize-keys/package.json" + "path": "node_modules/widest-line/package.json" }, { - "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" + "path": "node_modules/widest-line/node_modules/string-width/package.json" }, { - "path": "node_modules/os-tmpdir/package.json" + "path": "node_modules/widest-line/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/kind-of/package.json" + "path": "node_modules/widest-line/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/power-assert-util-string-width/package.json" + "path": "node_modules/widest-line/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/ajv-keywords/package.json" + "path": "node_modules/ignore-walk/package.json" }, { - "path": "node_modules/url-parse-lax/package.json" + "path": "node_modules/errno/package.json" }, { - "path": "node_modules/linkify-it/package.json" + "path": "node_modules/util-deprecate/package.json" }, { - "path": "node_modules/url/package.json" + "path": "node_modules/function-bind/package.json" }, { - "path": "node_modules/url/node_modules/punycode/package.json" + "path": "node_modules/object-is/package.json" }, { - "path": "node_modules/async-each/package.json" + "path": "node_modules/@types/color-name/package.json" }, { - "path": "node_modules/minimist/package.json" + "path": "node_modules/@types/node/package.json" }, { - "path": "node_modules/buffer-xor/package.json" + "path": "node_modules/@types/istanbul-lib-coverage/package.json" }, { - "path": "node_modules/fresh/package.json" + "path": "node_modules/@types/normalize-package-data/package.json" }, { - "path": "node_modules/power-assert-context-formatter/package.json" + "path": "node_modules/@types/is-windows/package.json" }, { - "path": "node_modules/is-stream/package.json" + "path": "node_modules/@types/mocha/package.json" }, { - "path": "node_modules/call-matcher/package.json" + "path": "node_modules/@types/minimist/package.json" }, { - "path": "node_modules/is-stream-ended/package.json" + "path": "node_modules/@types/fs-extra/package.json" }, { - "path": "node_modules/slice-ansi/package.json" + "path": "node_modules/@types/fs-extra/node_modules/@types/node/package.json" }, { - "path": "node_modules/onetime/package.json" + "path": "node_modules/@types/long/package.json" }, { - "path": "node_modules/spdx-correct/package.json" + "path": "node_modules/is-windows/package.json" }, { - "path": "node_modules/fast-deep-equal/package.json" + "path": "node_modules/levn/package.json" }, { - "path": "node_modules/readable-stream/package.json" + "path": "node_modules/pseudomap/package.json" }, { - "path": "node_modules/xdg-basedir/package.json" + "path": "node_modules/global-dirs/package.json" }, { - "path": "node_modules/v8-compile-cache/package.json" + "path": "node_modules/picomatch/package.json" }, { - "path": "node_modules/callsites/package.json" + "path": "node_modules/power-assert-renderer-diagram/package.json" }, { - "path": "node_modules/power-assert-renderer-assertion/package.json" + "path": "node_modules/webpack-cli/package.json" }, { - "path": "node_modules/pify/package.json" + "path": "node_modules/webpack-cli/node_modules/v8-compile-cache/package.json" }, { - "path": "node_modules/source-map-url/package.json" + "path": "node_modules/webpack-cli/node_modules/color-name/package.json" }, { - "path": "node_modules/snapdragon-util/package.json" + "path": "node_modules/webpack-cli/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/snapdragon-util/node_modules/is-buffer/package.json" + "path": "node_modules/webpack-cli/node_modules/string-width/package.json" }, { - "path": "node_modules/snapdragon-util/node_modules/kind-of/package.json" + "path": "node_modules/webpack-cli/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/stream-shift/package.json" + "path": "node_modules/webpack-cli/node_modules/cliui/package.json" }, { - "path": "node_modules/crypto-random-string/package.json" + "path": "node_modules/webpack-cli/node_modules/p-locate/package.json" }, { - "path": "node_modules/escodegen/package.json" + "path": "node_modules/webpack-cli/node_modules/path-key/package.json" }, { - "path": "node_modules/escodegen/node_modules/esprima/package.json" + "path": "node_modules/webpack-cli/node_modules/shebang-command/package.json" }, { - "path": "node_modules/entities/package.json" + "path": "node_modules/webpack-cli/node_modules/locate-path/package.json" }, { - "path": "node_modules/object.getownpropertydescriptors/package.json" + "path": "node_modules/webpack-cli/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/power-assert-renderer-file/package.json" + "path": "node_modules/webpack-cli/node_modules/has-flag/package.json" }, { - "path": "node_modules/events/package.json" + "path": "node_modules/webpack-cli/node_modules/enhanced-resolve/package.json" }, { - "path": "node_modules/define-property/package.json" + "path": "node_modules/webpack-cli/node_modules/ansi-styles/package.json" }, { - "path": "node_modules/define-property/node_modules/is-data-descriptor/package.json" + "path": "node_modules/webpack-cli/node_modules/which/package.json" }, { - "path": "node_modules/define-property/node_modules/is-descriptor/package.json" + "path": "node_modules/webpack-cli/node_modules/shebang-regex/package.json" }, { - "path": "node_modules/define-property/node_modules/is-accessor-descriptor/package.json" + "path": "node_modules/webpack-cli/node_modules/semver/package.json" }, { - "path": "node_modules/unpipe/package.json" + "path": "node_modules/webpack-cli/node_modules/supports-color/package.json" }, { - "path": "node_modules/array-filter/package.json" + "path": "node_modules/webpack-cli/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/furi/package.json" + "path": "node_modules/webpack-cli/node_modules/find-up/package.json" }, { - "path": "node_modules/pack-n-play/package.json" + "path": "node_modules/webpack-cli/node_modules/cross-spawn/index.js" }, { - "path": "node_modules/pack-n-play/node_modules/tmp/package.json" + "path": "node_modules/webpack-cli/node_modules/cross-spawn/README.md" }, { - "path": "node_modules/pack-n-play/node_modules/tmp/node_modules/rimraf/package.json" + "path": "node_modules/webpack-cli/node_modules/cross-spawn/package.json" }, { - "path": "node_modules/miller-rabin/package.json" + "path": "node_modules/webpack-cli/node_modules/cross-spawn/LICENSE" }, { - "path": "node_modules/strip-eof/package.json" + "path": "node_modules/webpack-cli/node_modules/cross-spawn/CHANGELOG.md" }, { - "path": "node_modules/map-cache/package.json" + "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/parse.js" }, { - "path": "node_modules/is-path-inside/package.json" + "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/enoent.js" }, { - "path": "node_modules/ini/package.json" + "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/util/escape.js" }, { - "path": "node_modules/currently-unhandled/package.json" + "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/util/resolveCommand.js" }, { - "path": "node_modules/global-modules/package.json" + "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/util/readShebang.js" }, { - "path": "node_modules/global-modules/node_modules/which/package.json" + "path": "node_modules/webpack-cli/node_modules/wrap-ansi/package.json" }, { - "path": "node_modules/global-modules/node_modules/global-prefix/package.json" + "path": "node_modules/webpack-cli/node_modules/path-exists/package.json" }, { - "path": "node_modules/invert-kv/package.json" + "path": "node_modules/webpack-cli/node_modules/yargs/package.json" }, { - "path": "node_modules/validate-npm-package-license/package.json" + "path": "node_modules/webpack-cli/node_modules/color-convert/package.json" }, { - "path": "node_modules/fill-range/package.json" + "path": "node_modules/webpack-cli/node_modules/yargs-parser/package.json" }, { - "path": "node_modules/bignumber.js/package.json" + "path": "node_modules/webpack-cli/node_modules/memory-fs/package.json" }, { - "path": "node_modules/is-yarn-global/package.json" + "path": "node_modules/is-stream/package.json" }, { - "path": "node_modules/lodash.has/package.json" + "path": "node_modules/component-emitter/package.json" }, { - "path": "node_modules/camelcase/package.json" + "path": "node_modules/es6-symbol/package.json" }, { - "path": "node_modules/prelude-ls/package.json" + "path": "node_modules/parse-json/package.json" }, { - "path": "node_modules/es6-promise/package.json" + "path": "node_modules/xdg-basedir/package.json" }, { - "path": "node_modules/doctrine/package.json" + "path": "node_modules/spdx-license-ids/package.json" }, { - "path": "node_modules/path-exists/package.json" + "path": "node_modules/extend-shallow/package.json" }, { - "path": "node_modules/deep-extend/package.json" + "path": "node_modules/extend-shallow/node_modules/is-extendable/package.json" }, { - "path": "node_modules/os-browserify/package.json" + "path": "node_modules/browserify-cipher/package.json" }, { - "path": "node_modules/nth-check/package.json" + "path": "node_modules/ssri/package.json" }, { - "path": "node_modules/regex-not/package.json" + "path": "node_modules/google-auth-library/package.json" }, { - "path": "node_modules/isarray/package.json" + "path": "node_modules/webpack/package.json" }, { - "path": "node_modules/es-to-primitive/package.json" + "path": "node_modules/webpack/node_modules/is-buffer/package.json" }, { - "path": "node_modules/https-proxy-agent/package.json" + "path": "node_modules/webpack/node_modules/fill-range/package.json" }, { - "path": "node_modules/to-regex/package.json" + "path": "node_modules/webpack/node_modules/fill-range/node_modules/extend-shallow/package.json" }, { - "path": "node_modules/eslint-plugin-es/package.json" + "path": "node_modules/webpack/node_modules/is-number/package.json" }, { - "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" + "path": "node_modules/webpack/node_modules/is-number/node_modules/kind-of/package.json" }, { - "path": "node_modules/path-type/package.json" + "path": "node_modules/webpack/node_modules/eslint-scope/package.json" }, { - "path": "node_modules/path-type/node_modules/pify/package.json" + "path": "node_modules/webpack/node_modules/micromatch/index.js" }, { - "path": "node_modules/fs-minipass/package.json" + "path": "node_modules/webpack/node_modules/micromatch/README.md" }, { - "path": "node_modules/pumpify/package.json" + "path": "node_modules/webpack/node_modules/micromatch/package.json" }, { - "path": "node_modules/pumpify/node_modules/pump/package.json" + "path": "node_modules/webpack/node_modules/micromatch/LICENSE" }, { - "path": "node_modules/fast-json-stable-stringify/package.json" + "path": "node_modules/webpack/node_modules/micromatch/CHANGELOG.md" }, { - "path": "node_modules/p-locate/package.json" + "path": "node_modules/webpack/node_modules/micromatch/lib/parsers.js" }, { - "path": "node_modules/stream-each/package.json" + "path": "node_modules/webpack/node_modules/micromatch/lib/.DS_Store" }, { - "path": "node_modules/enhanced-resolve/package.json" + "path": "node_modules/webpack/node_modules/micromatch/lib/compilers.js" }, { - "path": "node_modules/intelli-espower-loader/package.json" + "path": "node_modules/webpack/node_modules/micromatch/lib/utils.js" }, { - "path": "node_modules/node-fetch/package.json" + "path": "node_modules/webpack/node_modules/micromatch/lib/cache.js" }, { - "path": "node_modules/registry-auth-token/package.json" + "path": "node_modules/webpack/node_modules/acorn/package.json" }, { - "path": "node_modules/repeat-string/package.json" + "path": "node_modules/webpack/node_modules/braces/package.json" }, { - "path": "node_modules/terser-webpack-plugin/package.json" + "path": "node_modules/webpack/node_modules/braces/node_modules/extend-shallow/package.json" }, { - "path": "node_modules/fragment-cache/package.json" + "path": "node_modules/webpack/node_modules/to-regex-range/package.json" }, { - "path": "node_modules/esutils/package.json" + "path": "node_modules/webpack/node_modules/memory-fs/package.json" }, { - "path": "node_modules/run-queue/package.json" + "path": "node_modules/split-string/package.json" }, { - "path": "node_modules/which-module/package.json" + "path": "node_modules/brace-expansion/package.json" }, { - "path": "node_modules/function-bind/package.json" + "path": "node_modules/posix-character-classes/package.json" }, { - "path": "node_modules/lcid/package.json" + "path": "node_modules/builtin-modules/package.json" }, { - "path": "node_modules/map-visit/package.json" + "path": "node_modules/static-extend/package.json" }, { - "path": "node_modules/trim-newlines/package.json" + "path": "node_modules/static-extend/node_modules/define-property/package.json" }, { - "path": "node_modules/event-target-shim/package.json" + "path": "node_modules/process/package.json" }, { - "path": "node_modules/commondir/package.json" + "path": "node_modules/tslint/package.json" }, { - "path": "node_modules/unset-value/package.json" + "path": "node_modules/tslint/node_modules/semver/package.json" }, { - "path": "node_modules/unset-value/node_modules/has-value/package.json" + "path": "node_modules/type-name/package.json" }, { - "path": "node_modules/unset-value/node_modules/has-value/node_modules/isobject/package.json" + "path": "node_modules/define-properties/package.json" }, { - "path": "node_modules/unset-value/node_modules/has-values/package.json" + "path": "node_modules/universal-deep-strict-equal/package.json" }, { - "path": "node_modules/parse-passwd/package.json" + "path": "node_modules/jws/package.json" }, { - "path": "node_modules/on-finished/package.json" + "path": "node_modules/minipass/package.json" }, { - "path": "node_modules/y18n/package.json" + "path": "node_modules/minipass/node_modules/yallist/package.json" }, { - "path": "node_modules/cacache/package.json" + "path": "node_modules/nth-check/package.json" }, { - "path": "node_modules/cacache/node_modules/rimraf/package.json" + "path": "node_modules/@xtuc/ieee754/package.json" }, { - "path": "node_modules/quick-lru/package.json" + "path": "node_modules/@xtuc/long/package.json" }, { - "path": "node_modules/js-yaml/package.json" + "path": "node_modules/p-defer/package.json" }, { - "path": "node_modules/flat/package.json" + "path": "node_modules/empower/package.json" }, { - "path": "node_modules/normalize-package-data/package.json" + "path": "node_modules/nanomatch/package.json" }, { - "path": "node_modules/normalize-package-data/node_modules/semver/package.json" + "path": "node_modules/send/package.json" }, { - "path": "node_modules/es6-iterator/package.json" + "path": "node_modules/send/node_modules/debug/package.json" }, { - "path": "node_modules/remove-trailing-separator/package.json" + "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" }, { - "path": "node_modules/typescript/package.json" + "path": "node_modules/send/node_modules/ms/package.json" }, { - "path": "node_modules/mkdirp/package.json" + "path": "node_modules/send/node_modules/mime/package.json" }, { - "path": "node_modules/mkdirp/node_modules/minimist/package.json" + "path": "node_modules/require-directory/package.json" }, { - "path": "node_modules/chrome-trace-event/package.json" + "path": "node_modules/object.assign/package.json" }, { - "path": "node_modules/console-browserify/package.json" + "path": "node_modules/is-npm/package.json" }, { - "path": "node_modules/fast-text-encoding/package.json" + "path": "node_modules/fs-minipass/package.json" }, { - "path": "node_modules/acorn-es7-plugin/package.json" + "path": "node_modules/browserify-des/package.json" }, { - "path": "node_modules/through2/package.json" + "path": "node_modules/min-indent/package.json" }, { - "path": "node_modules/eslint-visitor-keys/package.json" + "path": "node_modules/functional-red-black-tree/package.json" }, { - "path": "node_modules/glob/package.json" + "path": "node_modules/read-pkg/package.json" }, { - "path": "node_modules/inherits/package.json" + "path": "node_modules/fs-write-stream-atomic/package.json" }, { - "path": "node_modules/object-copy/package.json" + "path": "node_modules/registry-url/package.json" }, { - "path": "node_modules/object-copy/node_modules/is-buffer/package.json" + "path": "node_modules/is-regex/package.json" }, { - "path": "node_modules/object-copy/node_modules/kind-of/package.json" + "path": "node_modules/es-abstract/package.json" }, { - "path": "node_modules/object-copy/node_modules/define-property/package.json" + "path": "node_modules/querystring-es3/package.json" }, { - "path": "node_modules/string.prototype.trimright/package.json" + "path": "node_modules/parent-module/package.json" }, { - "path": "node_modules/punycode/package.json" + "path": "node_modules/create-ecdh/package.json" }, { - "path": "node_modules/es5-ext/package.json" + "path": "node_modules/map-age-cleaner/package.json" }, { - "path": "node_modules/is-date-object/package.json" + "path": "node_modules/hash.js/package.json" }, { - "path": "node_modules/sprintf-js/package.json" + "path": "node_modules/signal-exit/package.json" }, { - "path": "node_modules/is-npm/package.json" + "path": "node_modules/import-fresh/package.json" }, { - "path": "node_modules/has-yarn/package.json" + "path": "node_modules/hash-base/package.json" }, { - "path": "node_modules/get-stdin/package.json" + "path": "node_modules/keyv/package.json" }, { - "path": "node_modules/global-prefix/package.json" + "path": "node_modules/ret/package.json" }, { - "path": "node_modules/global-prefix/node_modules/which/package.json" + "path": "node_modules/md5.js/package.json" }, { - "path": "node_modules/extglob/package.json" + "path": "node_modules/estraverse/package.json" }, { - "path": "node_modules/extglob/node_modules/is-data-descriptor/package.json" + "path": "node_modules/fast-deep-equal/package.json" }, { - "path": "node_modules/extglob/node_modules/is-descriptor/package.json" + "path": "node_modules/mute-stream/package.json" }, { - "path": "node_modules/extglob/node_modules/extend-shallow/package.json" + "path": "node_modules/power-assert-context-traversal/package.json" }, { - "path": "node_modules/extglob/node_modules/is-accessor-descriptor/package.json" + "path": "node_modules/rimraf/package.json" }, { - "path": "node_modules/extglob/node_modules/define-property/package.json" + "path": "node_modules/is-installed-globally/package.json" }, { - "path": "node_modules/ajv-errors/package.json" + "path": "node_modules/get-stdin/package.json" }, { - "path": "node_modules/node-libs-browser/package.json" + "path": "node_modules/make-dir/package.json" }, { - "path": "node_modules/node-libs-browser/node_modules/punycode/package.json" + "path": "node_modules/make-dir/node_modules/semver/package.json" }, { - "path": "node_modules/constants-browserify/package.json" + "path": "node_modules/es6-promise/package.json" }, { - "path": "node_modules/shebang-command/package.json" + "path": "node_modules/os-tmpdir/package.json" }, { - "path": "node_modules/empower-core/package.json" + "path": "node_modules/run-queue/package.json" }, { - "path": "node_modules/imurmurhash/package.json" + "path": "node_modules/anymatch/package.json" }, { - "path": "node_modules/globals/package.json" + "path": "node_modules/anymatch/node_modules/is-buffer/package.json" }, { - "path": "node_modules/create-ecdh/package.json" + "path": "node_modules/anymatch/node_modules/fill-range/package.json" }, { - "path": "node_modules/latest-version/package.json" + "path": "node_modules/anymatch/node_modules/fill-range/node_modules/extend-shallow/package.json" }, { - "path": "node_modules/natural-compare/package.json" + "path": "node_modules/anymatch/node_modules/is-number/package.json" }, { - "path": "node_modules/commander/package.json" + "path": "node_modules/anymatch/node_modules/is-number/node_modules/kind-of/package.json" }, { - "path": "node_modules/timers-browserify/package.json" + "path": "node_modules/anymatch/node_modules/micromatch/index.js" }, { - "path": "node_modules/path-is-inside/package.json" + "path": "node_modules/anymatch/node_modules/micromatch/README.md" }, { - "path": "node_modules/rxjs/package.json" + "path": "node_modules/anymatch/node_modules/micromatch/package.json" }, { - "path": "node_modules/node-environment-flags/package.json" + "path": "node_modules/anymatch/node_modules/micromatch/LICENSE" }, { - "path": "node_modules/node-environment-flags/node_modules/semver/package.json" + "path": "node_modules/anymatch/node_modules/micromatch/CHANGELOG.md" }, { - "path": "node_modules/p-limit/package.json" + "path": "node_modules/anymatch/node_modules/micromatch/lib/parsers.js" }, { - "path": "node_modules/call-signature/package.json" + "path": "node_modules/anymatch/node_modules/micromatch/lib/.DS_Store" }, { - "path": "node_modules/istanbul-lib-coverage/package.json" + "path": "node_modules/anymatch/node_modules/micromatch/lib/compilers.js" }, { - "path": "node_modules/neo-async/package.json" + "path": "node_modules/anymatch/node_modules/micromatch/lib/utils.js" }, { - "path": "node_modules/foreground-child/package.json" + "path": "node_modules/anymatch/node_modules/micromatch/lib/cache.js" }, { - "path": "node_modules/des.js/package.json" + "path": "node_modules/anymatch/node_modules/braces/package.json" }, { - "path": "node_modules/he/package.json" + "path": "node_modules/anymatch/node_modules/braces/node_modules/extend-shallow/package.json" }, { - "path": "node_modules/tar/package.json" + "path": "node_modules/anymatch/node_modules/to-regex-range/package.json" }, { - "path": "node_modules/tar/node_modules/yallist/package.json" + "path": "node_modules/anymatch/node_modules/normalize-path/package.json" }, { - "path": "node_modules/meow/package.json" + "path": "node_modules/retry-request/package.json" }, { - "path": "node_modules/meow/node_modules/locate-path/package.json" + "path": "node_modules/retry-request/node_modules/debug/package.json" }, { - "path": "node_modules/meow/node_modules/find-up/package.json" + "path": "node_modules/cli-cursor/package.json" }, { - "path": "node_modules/meow/node_modules/yargs-parser/package.json" + "path": "node_modules/ext/package.json" }, { - "path": "node_modules/meow/node_modules/camelcase/package.json" + "path": "node_modules/ext/node_modules/type/package.json" }, { - "path": "node_modules/meow/node_modules/path-exists/package.json" + "path": "node_modules/is-symbol/package.json" }, { - "path": "node_modules/meow/node_modules/p-locate/package.json" + "path": "node_modules/css-what/package.json" }, { - "path": "node_modules/meow/node_modules/p-limit/package.json" + "path": "node_modules/punycode/package.json" }, { - "path": "node_modules/meow/node_modules/p-try/package.json" + "path": "node_modules/os-locale/package.json" }, { - "path": "node_modules/meow/node_modules/read-pkg-up/package.json" + "path": "node_modules/os-locale/node_modules/path-key/package.json" }, { - "path": "node_modules/chownr/package.json" + "path": "node_modules/os-locale/node_modules/shebang-command/package.json" }, { - "path": "node_modules/toidentifier/package.json" + "path": "node_modules/os-locale/node_modules/execa/package.json" }, { - "path": "node_modules/execa/package.json" + "path": "node_modules/os-locale/node_modules/get-stream/package.json" }, { - "path": "node_modules/execa/node_modules/cross-spawn/package.json" + "path": "node_modules/os-locale/node_modules/is-stream/package.json" }, { - "path": "node_modules/execa/node_modules/lru-cache/package.json" + "path": "node_modules/os-locale/node_modules/which/package.json" }, { - "path": "node_modules/execa/node_modules/yallist/package.json" + "path": "node_modules/os-locale/node_modules/shebang-regex/package.json" }, { - "path": "node_modules/execa/node_modules/which/package.json" + "path": "node_modules/os-locale/node_modules/semver/package.json" }, { - "path": "node_modules/execa/node_modules/shebang-regex/package.json" + "path": "node_modules/os-locale/node_modules/cross-spawn/index.js" }, { - "path": "node_modules/execa/node_modules/is-stream/package.json" + "path": "node_modules/os-locale/node_modules/cross-spawn/README.md" }, { - "path": "node_modules/execa/node_modules/shebang-command/package.json" + "path": "node_modules/os-locale/node_modules/cross-spawn/package.json" }, { - "path": "node_modules/levn/package.json" + "path": "node_modules/os-locale/node_modules/cross-spawn/LICENSE" }, { - "path": "node_modules/unique-string/package.json" + "path": "node_modules/os-locale/node_modules/cross-spawn/CHANGELOG.md" }, { - "path": "node_modules/gaxios/package.json" + "path": "node_modules/os-locale/node_modules/cross-spawn/lib/parse.js" }, { - "path": "node_modules/create-hash/package.json" + "path": "node_modules/os-locale/node_modules/cross-spawn/lib/enoent.js" }, { - "path": "node_modules/figgy-pudding/package.json" + "path": "node_modules/os-locale/node_modules/cross-spawn/lib/util/escape.js" }, { - "path": "node_modules/power-assert-renderer-base/package.json" + "path": "node_modules/os-locale/node_modules/cross-spawn/lib/util/resolveCommand.js" }, { - "path": "node_modules/browser-stdout/package.json" + "path": "node_modules/os-locale/node_modules/cross-spawn/lib/util/readShebang.js" }, { - "path": "node_modules/regexp.prototype.flags/package.json" + "path": "node_modules/setprototypeof/package.json" }, { - "path": "node_modules/ieee754/package.json" + "path": "node_modules/mixin-deep/package.json" }, { - "path": "node_modules/run-async/package.json" + "path": "node_modules/mixin-deep/node_modules/is-extendable/package.json" }, { - "path": "node_modules/cheerio/package.json" + "path": "node_modules/word-wrap/package.json" }, { - "path": "node_modules/eslint-utils/package.json" + "path": "node_modules/foreground-child/package.json" }, { - "path": "node_modules/prepend-http/package.json" + "path": "node_modules/has-values/package.json" }, { - "path": "node_modules/define-properties/package.json" + "path": "node_modules/has-values/node_modules/is-buffer/package.json" }, { - "path": "node_modules/p-timeout/package.json" + "path": "node_modules/has-values/node_modules/is-number/package.json" }, { - "path": "node_modules/cli-cursor/package.json" + "path": "node_modules/has-values/node_modules/is-number/node_modules/kind-of/package.json" }, { - "path": "node_modules/unique-filename/package.json" + "path": "node_modules/has-values/node_modules/kind-of/package.json" }, { - "path": "node_modules/pump/package.json" + "path": "node_modules/pumpify/package.json" }, { - "path": "node_modules/stringifier/package.json" + "path": "node_modules/pumpify/node_modules/pump/package.json" }, { - "path": "node_modules/espower-location-detector/package.json" + "path": "node_modules/es6-map/package.json" }, { - "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" + "path": "node_modules/detect-file/package.json" }, { - "path": "node_modules/escape-html/package.json" + "path": "node_modules/source-map-url/package.json" }, { - "path": "node_modules/http-cache-semantics/package.json" + "path": "node_modules/call-signature/package.json" }, { - "path": "node_modules/to-readable-stream/package.json" + "path": "node_modules/package-json/package.json" }, { - "path": "node_modules/eastasianwidth/package.json" + "path": "node_modules/package-json/node_modules/semver/package.json" }, { - "path": "node_modules/chardet/package.json" + "path": "node_modules/css-select/package.json" }, { - "path": "node_modules/js-tokens/package.json" + "path": "node_modules/path-is-inside/package.json" }, { - "path": "node_modules/chalk/package.json" + "path": "node_modules/eslint-plugin-prettier/package.json" }, { - "path": "node_modules/chalk/node_modules/supports-color/package.json" + "path": "node_modules/p-finally/package.json" }, { - "path": "node_modules/is-regex/package.json" + "path": "node_modules/inquirer/package.json" }, { - "path": "node_modules/ajv/package.json" + "path": "node_modules/inquirer/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/spdx-expression-parse/package.json" + "path": "node_modules/inquirer/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/cli-width/package.json" + "path": "node_modules/acorn-jsx/package.json" }, { - "path": "node_modules/ms/package.json" + "path": "node_modules/binary-extensions/package.json" }, { - "path": "node_modules/fs-write-stream-atomic/package.json" + "path": "node_modules/glob/package.json" }, { - "path": "node_modules/istanbul-lib-report/package.json" + "path": "node_modules/mocha/package.json" }, { - "path": "node_modules/base64-js/package.json" + "path": "node_modules/mocha/node_modules/diff/package.json" }, { - "path": "node_modules/encodeurl/package.json" + "path": "node_modules/mocha/node_modules/color-name/package.json" }, { - "path": "node_modules/to-arraybuffer/package.json" + "path": "node_modules/mocha/node_modules/emoji-regex/package.json" }, { - "path": "node_modules/micromatch/package.json" + "path": "node_modules/mocha/node_modules/ms/package.json" }, { - "path": "node_modules/json-buffer/package.json" + "path": "node_modules/mocha/node_modules/string-width/package.json" }, { - "path": "node_modules/file-entry-cache/package.json" + "path": "node_modules/mocha/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/mixin-deep/package.json" + "path": "node_modules/mocha/node_modules/cliui/package.json" }, { - "path": "node_modules/mixin-deep/node_modules/is-extendable/package.json" + "path": "node_modules/mocha/node_modules/p-locate/package.json" }, { - "path": "node_modules/is-binary-path/package.json" + "path": "node_modules/mocha/node_modules/locate-path/package.json" }, { - "path": "node_modules/gtoken/package.json" + "path": "node_modules/mocha/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/klaw/package.json" + "path": "node_modules/mocha/node_modules/has-flag/package.json" }, { - "path": "node_modules/functional-red-black-tree/package.json" + "path": "node_modules/mocha/node_modules/glob/package.json" }, { - "path": "node_modules/dom-serializer/package.json" + "path": "node_modules/mocha/node_modules/ansi-styles/package.json" }, { - "path": "node_modules/is-symbol/package.json" + "path": "node_modules/mocha/node_modules/which/package.json" }, { - "path": "node_modules/vm-browserify/package.json" + "path": "node_modules/mocha/node_modules/supports-color/package.json" }, { - "path": "node_modules/picomatch/package.json" + "path": "node_modules/mocha/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/source-list-map/package.json" + "path": "node_modules/mocha/node_modules/find-up/package.json" }, { - "path": "node_modules/@babel/parser/package.json" + "path": "node_modules/mocha/node_modules/wrap-ansi/package.json" }, { - "path": "node_modules/@babel/highlight/package.json" + "path": "node_modules/mocha/node_modules/path-exists/package.json" }, { - "path": "node_modules/@babel/code-frame/package.json" + "path": "node_modules/mocha/node_modules/yargs/package.json" }, { - "path": "node_modules/move-concurrently/package.json" + "path": "node_modules/mocha/node_modules/color-convert/package.json" }, { - "path": "node_modules/move-concurrently/node_modules/rimraf/package.json" + "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" }, { - "path": "node_modules/type-check/package.json" + "path": "node_modules/mocha/node_modules/yargs-parser/package.json" }, { - "path": "node_modules/nanomatch/package.json" + "path": "node_modules/loud-rejection/package.json" }, { - "path": "node_modules/iconv-lite/package.json" + "path": "node_modules/event-emitter/package.json" }, { - "path": "node_modules/querystring/package.json" + "path": "node_modules/@protobufjs/codegen/package.json" }, { - "path": "node_modules/webpack/package.json" + "path": "node_modules/@protobufjs/base64/package.json" }, { - "path": "node_modules/webpack/node_modules/eslint-scope/package.json" + "path": "node_modules/@protobufjs/utf8/package.json" }, { - "path": "node_modules/webpack/node_modules/braces/package.json" + "path": "node_modules/@protobufjs/pool/package.json" }, { - "path": "node_modules/webpack/node_modules/braces/node_modules/extend-shallow/package.json" + "path": "node_modules/@protobufjs/float/package.json" }, { - "path": "node_modules/webpack/node_modules/to-regex-range/package.json" + "path": "node_modules/@protobufjs/fetch/package.json" }, { - "path": "node_modules/webpack/node_modules/memory-fs/package.json" + "path": "node_modules/@protobufjs/path/package.json" }, { - "path": "node_modules/webpack/node_modules/is-buffer/package.json" + "path": "node_modules/@protobufjs/aspromise/package.json" }, { - "path": "node_modules/webpack/node_modules/acorn/package.json" + "path": "node_modules/@protobufjs/inquire/package.json" }, { - "path": "node_modules/webpack/node_modules/fill-range/package.json" + "path": "node_modules/@protobufjs/eventemitter/package.json" }, { - "path": "node_modules/webpack/node_modules/fill-range/node_modules/extend-shallow/package.json" + "path": "node_modules/prr/package.json" }, { - "path": "node_modules/webpack/node_modules/micromatch/README.md" + "path": "node_modules/node-forge/package.json" }, { - "path": "node_modules/webpack/node_modules/micromatch/package.json" + "path": "node_modules/lodash.has/package.json" }, { - "path": "node_modules/webpack/node_modules/micromatch/CHANGELOG.md" + "path": "node_modules/global-modules/package.json" }, { - "path": "node_modules/webpack/node_modules/micromatch/index.js" + "path": "node_modules/global-modules/node_modules/global-prefix/package.json" }, { - "path": "node_modules/webpack/node_modules/micromatch/LICENSE" + "path": "node_modules/global-modules/node_modules/which/package.json" }, { - "path": "node_modules/webpack/node_modules/micromatch/lib/parsers.js" + "path": "node_modules/des.js/package.json" }, { - "path": "node_modules/webpack/node_modules/micromatch/lib/.DS_Store" + "path": "node_modules/source-map-support/package.json" }, { - "path": "node_modules/webpack/node_modules/micromatch/lib/utils.js" + "path": "node_modules/source-map-support/node_modules/source-map/package.json" }, { - "path": "node_modules/webpack/node_modules/micromatch/lib/compilers.js" + "path": "node_modules/schema-utils/package.json" }, { - "path": "node_modules/webpack/node_modules/micromatch/lib/cache.js" + "path": "node_modules/object-assign/package.json" }, { - "path": "node_modules/webpack/node_modules/is-number/package.json" + "path": "node_modules/has-symbols/package.json" }, { - "path": "node_modules/webpack/node_modules/is-number/node_modules/kind-of/package.json" + "path": "node_modules/find-cache-dir/package.json" }, { - "path": "node_modules/is-url/package.json" + "path": "node_modules/find-cache-dir/node_modules/make-dir/package.json" }, { - "path": "node_modules/randombytes/package.json" + "path": "node_modules/find-cache-dir/node_modules/pify/package.json" }, { - "path": "node_modules/domutils/package.json" + "path": "node_modules/find-cache-dir/node_modules/semver/package.json" }, { - "path": "node_modules/browserify-zlib/package.json" + "path": "node_modules/unique-slug/package.json" }, { - "path": "node_modules/p-queue/package.json" + "path": "node_modules/espurify/package.json" }, { - "path": "node_modules/eventemitter3/package.json" + "path": "node_modules/lodash.at/package.json" }, { - "path": "node_modules/object-visit/package.json" + "path": "node_modules/ansi-styles/package.json" }, { - "path": "node_modules/ext/package.json" + "path": "node_modules/merge-estraverse-visitors/package.json" }, { - "path": "node_modules/ext/node_modules/type/package.json" + "path": "node_modules/for-in/package.json" }, { - "path": "node_modules/pkg-dir/package.json" + "path": "node_modules/to-object-path/package.json" }, { - "path": "node_modules/pkg-dir/node_modules/locate-path/package.json" + "path": "node_modules/to-object-path/node_modules/is-buffer/package.json" }, { - "path": "node_modules/pkg-dir/node_modules/find-up/package.json" + "path": "node_modules/to-object-path/node_modules/kind-of/package.json" }, { - "path": "node_modules/pkg-dir/node_modules/path-exists/package.json" + "path": "node_modules/ansi-colors/package.json" }, { - "path": "node_modules/pkg-dir/node_modules/p-locate/package.json" + "path": "node_modules/brorand/package.json" }, { - "path": "node_modules/deep-equal/package.json" + "path": "node_modules/findup-sync/package.json" }, { - "path": "node_modules/parse5/package.json" + "path": "node_modules/findup-sync/node_modules/is-buffer/package.json" }, { - "path": "node_modules/collection-visit/package.json" + "path": "node_modules/findup-sync/node_modules/fill-range/package.json" }, { - "path": "node_modules/flatted/package.json" + "path": "node_modules/findup-sync/node_modules/fill-range/node_modules/extend-shallow/package.json" }, { - "path": "node_modules/for-in/package.json" + "path": "node_modules/findup-sync/node_modules/is-number/package.json" + }, + { + "path": "node_modules/findup-sync/node_modules/is-number/node_modules/kind-of/package.json" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/index.js" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/README.md" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/package.json" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/LICENSE" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/CHANGELOG.md" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/lib/parsers.js" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/lib/.DS_Store" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/lib/compilers.js" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/lib/utils.js" + }, + { + "path": "node_modules/findup-sync/node_modules/micromatch/lib/cache.js" + }, + { + "path": "node_modules/findup-sync/node_modules/braces/package.json" + }, + { + "path": "node_modules/findup-sync/node_modules/braces/node_modules/extend-shallow/package.json" + }, + { + "path": "node_modules/findup-sync/node_modules/to-regex-range/package.json" + }, + { + "path": "node_modules/p-try/package.json" + }, + { + "path": "node_modules/escope/package.json" + }, + { + "path": "node_modules/evp_bytestokey/package.json" + }, + { + "path": "node_modules/json-parse-better-errors/package.json" + }, + { + "path": "node_modules/worker-farm/package.json" + }, + { + "path": "node_modules/ieee754/package.json" + }, + { + "path": "node_modules/chokidar/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/is-buffer/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/glob-parent/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/glob-parent/node_modules/is-glob/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/fill-range/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/is-number/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/kind-of/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/extend-shallow/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/braces/package.json" + }, + { + "path": "node_modules/chokidar/node_modules/to-regex-range/package.json" + }, + { + "path": "node_modules/readable-stream/package.json" + }, + { + "path": "node_modules/abort-controller/package.json" + }, + { + "path": "node_modules/which/package.json" + }, + { + "path": "node_modules/astral-regex/package.json" + }, + { + "path": "node_modules/escodegen/package.json" + }, + { + "path": "node_modules/escodegen/node_modules/esprima/package.json" + }, + { + "path": "node_modules/escodegen/node_modules/source-map/package.json" + }, + { + "path": "node_modules/minimist/package.json" + }, + { + "path": "node_modules/elliptic/package.json" + }, + { + "path": "node_modules/clone-response/package.json" + }, + { + "path": "node_modules/ecdsa-sig-formatter/package.json" + }, + { + "path": "node_modules/requizzle/package.json" + }, + { + "path": "node_modules/base64-js/package.json" + }, + { + "path": "node_modules/async-each/package.json" + }, + { + "path": "node_modules/pify/package.json" + }, + { + "path": "node_modules/object-keys/package.json" + }, + { + "path": "node_modules/trim-newlines/package.json" + }, + { + "path": "node_modules/deep-is/package.json" + }, + { + "path": "node_modules/fast-levenshtein/package.json" + }, + { + "path": "node_modules/urix/package.json" + }, + { + "path": "node_modules/typescript/package.json" + }, + { + "path": "node_modules/shebang-regex/package.json" + }, + { + "path": "node_modules/regex-not/package.json" + }, + { + "path": "node_modules/eslint-plugin-es/package.json" + }, + { + "path": "node_modules/eslint-plugin-es/node_modules/eslint-utils/package.json" + }, + { + "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" }, { "path": "node_modules/util/package.json" @@ -2988,628 +3159,748 @@ "path": "node_modules/mem/package.json" }, { - "path": "node_modules/once/package.json" + "path": "node_modules/semver/package.json" }, { - "path": "node_modules/universal-deep-strict-equal/package.json" + "path": "node_modules/unique-string/package.json" }, { - "path": "node_modules/anymatch/package.json" + "path": "node_modules/unique-filename/package.json" }, { - "path": "node_modules/anymatch/node_modules/braces/package.json" + "path": "node_modules/decamelize/package.json" }, { - "path": "node_modules/anymatch/node_modules/braces/node_modules/extend-shallow/package.json" + "path": "node_modules/node-libs-browser/package.json" }, { - "path": "node_modules/anymatch/node_modules/to-regex-range/package.json" + "path": "node_modules/node-libs-browser/node_modules/punycode/package.json" }, { - "path": "node_modules/anymatch/node_modules/is-buffer/package.json" + "path": "node_modules/ajv-keywords/package.json" }, { - "path": "node_modules/anymatch/node_modules/fill-range/package.json" + "path": "node_modules/is-descriptor/package.json" }, { - "path": "node_modules/anymatch/node_modules/fill-range/node_modules/extend-shallow/package.json" + "path": "node_modules/is-descriptor/node_modules/kind-of/package.json" }, { - "path": "node_modules/anymatch/node_modules/micromatch/README.md" + "path": "node_modules/arr-union/package.json" }, { - "path": "node_modules/anymatch/node_modules/micromatch/package.json" + "path": "node_modules/acorn/package.json" }, { - "path": "node_modules/anymatch/node_modules/micromatch/CHANGELOG.md" + "path": "node_modules/wide-align/package.json" }, { - "path": "node_modules/anymatch/node_modules/micromatch/index.js" + "path": "node_modules/wide-align/node_modules/string-width/package.json" }, { - "path": "node_modules/anymatch/node_modules/micromatch/LICENSE" + "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/anymatch/node_modules/micromatch/lib/parsers.js" + "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/anymatch/node_modules/micromatch/lib/.DS_Store" + "path": "node_modules/wide-align/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/anymatch/node_modules/micromatch/lib/utils.js" + "path": "node_modules/got/package.json" }, { - "path": "node_modules/anymatch/node_modules/micromatch/lib/compilers.js" + "path": "node_modules/got/node_modules/get-stream/package.json" }, { - "path": "node_modules/anymatch/node_modules/micromatch/lib/cache.js" + "path": "node_modules/sprintf-js/package.json" }, { - "path": "node_modules/anymatch/node_modules/is-number/package.json" + "path": "node_modules/ts-loader/package.json" }, { - "path": "node_modules/anymatch/node_modules/is-number/node_modules/kind-of/package.json" + "path": "node_modules/ts-loader/node_modules/semver/package.json" }, { - "path": "node_modules/anymatch/node_modules/normalize-path/package.json" + "path": "node_modules/isarray/package.json" }, { - "path": "node_modules/brace-expansion/package.json" + "path": "node_modules/string_decoder/package.json" }, { - "path": "node_modules/tapable/package.json" + "path": "node_modules/strip-eof/package.json" }, { - "path": "node_modules/is-number/package.json" + "path": "node_modules/p-limit/package.json" }, { - "path": "node_modules/jsdoc-region-tag/package.json" + "path": "node_modules/url-parse-lax/package.json" }, { - "path": "node_modules/serialize-javascript/package.json" + "path": "node_modules/gts/package.json" }, { - "path": "node_modules/webpack-cli/package.json" + "path": "node_modules/gts/node_modules/chalk/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/locate-path/package.json" + "path": "node_modules/commander/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/find-up/package.json" + "path": "node_modules/mimic-fn/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/README.md" + "path": "node_modules/https-proxy-agent/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/package.json" + "path": "node_modules/ini/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/CHANGELOG.md" + "path": "node_modules/js2xmlparser/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/index.js" + "path": "node_modules/spdx-exceptions/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/LICENSE" + "path": "node_modules/external-editor/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/parse.js" + "path": "node_modules/power-assert-formatter/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/enoent.js" + "path": "node_modules/domain-browser/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/util/escape.js" + "path": "node_modules/eslint-utils/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/util/resolveCommand.js" + "path": "node_modules/buffer-xor/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/util/readShebang.js" + "path": "node_modules/text-table/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/memory-fs/package.json" + "path": "node_modules/domutils/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/yargs-parser/package.json" + "path": "node_modules/supports-color/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/semver/package.json" + "path": "node_modules/strip-indent/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/path-key/package.json" + "path": "node_modules/buffer/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/which/package.json" + "path": "node_modules/fs.realpath/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/shebang-regex/package.json" + "path": "node_modules/parse5/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/v8-compile-cache/package.json" + "path": "node_modules/decamelize-keys/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/path-exists/package.json" + "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/p-locate/package.json" + "path": "node_modules/empower-core/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/enhanced-resolve/package.json" + "path": "node_modules/is-plain-object/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/shebang-command/package.json" + "path": "node_modules/terser-webpack-plugin/package.json" }, { - "path": "node_modules/webpack-cli/node_modules/yargs/package.json" + "path": "node_modules/terser-webpack-plugin/node_modules/source-map/package.json" }, { - "path": "node_modules/markdown-it-anchor/package.json" + "path": "node_modules/acorn-es7-plugin/package.json" }, { - "path": "node_modules/traverse/package.json" + "path": "node_modules/iferr/package.json" }, { - "path": "node_modules/restore-cursor/package.json" + "path": "node_modules/figgy-pudding/package.json" }, { - "path": "node_modules/lodash.at/package.json" + "path": "node_modules/webpack-sources/package.json" }, { - "path": "node_modules/graceful-fs/package.json" + "path": "node_modules/webpack-sources/node_modules/source-map/package.json" }, { - "path": "node_modules/isobject/package.json" + "path": "node_modules/p-timeout/package.json" + }, + { + "path": "node_modules/upath/package.json" + }, + { + "path": "node_modules/neo-async/package.json" + }, + { + "path": "node_modules/espree/package.json" + }, + { + "path": "node_modules/is-fullwidth-code-point/package.json" }, { "path": "node_modules/responselike/package.json" }, { - "path": "node_modules/pseudomap/package.json" + "path": "node_modules/next-tick/package.json" }, { - "path": "node_modules/hash-base/package.json" + "path": "node_modules/esrecurse/package.json" }, { - "path": "node_modules/espurify/package.json" + "path": "node_modules/stream-http/package.json" }, { - "path": "node_modules/espree/package.json" + "path": "node_modules/promise-inflight/package.json" }, { - "path": "node_modules/crypto-browserify/package.json" + "path": "node_modules/bignumber.js/package.json" }, { - "path": "node_modules/power-assert-renderer-diagram/package.json" + "path": "node_modules/source-map/package.json" }, { - "path": "node_modules/word-wrap/package.json" + "path": "node_modules/find-up/package.json" }, { - "path": "node_modules/espower-source/package.json" + "path": "node_modules/traverse/package.json" }, { - "path": "node_modules/espower-source/node_modules/acorn/package.json" + "path": "node_modules/es-to-primitive/package.json" }, { - "path": "node_modules/normalize-url/package.json" + "path": "node_modules/rc/package.json" }, { - "path": "node_modules/infer-owner/package.json" + "path": "node_modules/rc/node_modules/minimist/package.json" }, { - "path": "node_modules/wordwrap/package.json" + "path": "node_modules/rc/node_modules/strip-json-comments/package.json" }, { - "path": "node_modules/ee-first/package.json" + "path": "node_modules/safe-buffer/package.json" }, { - "path": "node_modules/table/package.json" + "path": "node_modules/uc.micro/package.json" + }, + { + "path": "node_modules/flat-cache/package.json" + }, + { + "path": "node_modules/flat-cache/node_modules/rimraf/package.json" + }, + { + "path": "node_modules/once/package.json" + }, + { + "path": "node_modules/gtoken/package.json" + }, + { + "path": "node_modules/convert-source-map/package.json" + }, + { + "path": "node_modules/is-date-object/package.json" + }, + { + "path": "node_modules/tslint-config-prettier/package.json" + }, + { + "path": "node_modules/import-local/package.json" + }, + { + "path": "node_modules/escape-string-regexp/package.json" + }, + { + "path": "node_modules/flush-write-stream/package.json" + }, + { + "path": "node_modules/braces/package.json" + }, + { + "path": "node_modules/iconv-lite/package.json" + }, + { + "path": "node_modules/json5/package.json" + }, + { + "path": "node_modules/json5/node_modules/minimist/package.json" + }, + { + "path": "node_modules/get-value/package.json" + }, + { + "path": "node_modules/is-glob/package.json" + }, + { + "path": "node_modules/furi/package.json" + }, + { + "path": "node_modules/tslib/package.json" }, { - "path": "node_modules/handlebars/package.json" + "path": "node_modules/map-visit/package.json" + }, + { + "path": "node_modules/ripemd160/package.json" + }, + { + "path": "node_modules/watchpack/package.json" + }, + { + "path": "node_modules/stream-browserify/package.json" + }, + { + "path": "node_modules/markdown-it-anchor/package.json" + }, + { + "path": "node_modules/browser-stdout/package.json" + }, + { + "path": "node_modules/array-unique/package.json" + }, + { + "path": "node_modules/ajv-errors/package.json" + }, + { + "path": "node_modules/path-type/package.json" + }, + { + "path": "node_modules/to-regex-range/package.json" + }, + { + "path": "node_modules/randomfill/package.json" + }, + { + "path": "node_modules/npm-packlist/package.json" + }, + { + "path": "node_modules/copy-concurrently/package.json" + }, + { + "path": "node_modules/copy-concurrently/node_modules/rimraf/package.json" + }, + { + "path": "node_modules/loader-runner/package.json" + }, + { + "path": "node_modules/pump/package.json" + }, + { + "path": "node_modules/process-nextick-args/package.json" + }, + { + "path": "node_modules/deep-extend/package.json" + }, + { + "path": "node_modules/resolve-url/package.json" }, { - "path": "node_modules/object-assign/package.json" + "path": "node_modules/power-assert-context-reducer-ast/package.json" }, { - "path": "node_modules/es6-weak-map/package.json" + "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" }, { - "path": "node_modules/protobufjs/package.json" + "path": "node_modules/type-check/package.json" }, { - "path": "node_modules/protobufjs/cli/package.json" + "path": "node_modules/jwa/package.json" }, { - "path": "node_modules/protobufjs/cli/package-lock.json" + "path": "node_modules/walkdir/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" + "path": "node_modules/hard-rejection/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" + "path": "node_modules/base/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" + "path": "node_modules/base/node_modules/define-property/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" + "path": "node_modules/base/node_modules/is-data-descriptor/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" + "path": "node_modules/base/node_modules/is-accessor-descriptor/package.json" }, { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" + "path": "node_modules/base/node_modules/is-descriptor/package.json" }, { - "path": "node_modules/protobufjs/node_modules/@types/node/package.json" + "path": "node_modules/randombytes/package.json" }, { - "path": "node_modules/normalize-path/package.json" + "path": "node_modules/espower-source/package.json" }, { - "path": "node_modules/cyclist/package.json" + "path": "node_modules/espower-source/node_modules/acorn/package.json" }, { - "path": "node_modules/espower/package.json" + "path": "node_modules/cross-spawn/package.json" }, { - "path": "node_modules/espower/node_modules/source-map/package.json" + "path": "node_modules/@sindresorhus/is/package.json" }, { - "path": "node_modules/strip-json-comments/package.json" + "path": "node_modules/resolve-dir/package.json" }, { - "path": "node_modules/process-nextick-args/package.json" + "path": "node_modules/resolve-dir/node_modules/global-modules/package.json" }, { - "path": "node_modules/brorand/package.json" + "path": "node_modules/wrap-ansi/package.json" }, { - "path": "node_modules/p-is-promise/package.json" + "path": "node_modules/quick-lru/package.json" }, { - "path": "node_modules/array-find-index/package.json" + "path": "node_modules/path-exists/package.json" }, { - "path": "node_modules/astral-regex/package.json" + "path": "node_modules/jsdoc/package.json" }, { - "path": "node_modules/@grpc/proto-loader/package.json" + "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" }, { - "path": "node_modules/@grpc/grpc-js/package.json" + "path": "node_modules/cacheable-request/package.json" }, { - "path": "node_modules/test-exclude/package.json" + "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" }, { - "path": "node_modules/es6-promisify/package.json" + "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" }, { - "path": "node_modules/p-try/package.json" + "path": "node_modules/escape-html/package.json" }, { - "path": "node_modules/optionator/package.json" + "path": "node_modules/power-assert-renderer-assertion/package.json" }, { - "path": "node_modules/is-plain-object/package.json" + "path": "node_modules/minimist-options/package.json" }, { - "path": "node_modules/requizzle/package.json" + "path": "node_modules/minimist-options/node_modules/arrify/package.json" }, { - "path": "node_modules/c8/package.json" + "path": "node_modules/latest-version/package.json" }, { - "path": "node_modules/fast-levenshtein/package.json" + "path": "node_modules/optionator/package.json" }, { - "path": "node_modules/statuses/package.json" + "path": "node_modules/parallel-transform/package.json" }, { - "path": "node_modules/semver-diff/package.json" + "path": "node_modules/slice-ansi/package.json" }, { - "path": "node_modules/semver-diff/node_modules/semver/package.json" + "path": "node_modules/slice-ansi/node_modules/color-name/package.json" }, { - "path": "node_modules/signal-exit/package.json" + "path": "node_modules/slice-ansi/node_modules/ansi-styles/package.json" }, { - "path": "node_modules/jsdoc/package.json" + "path": "node_modules/slice-ansi/node_modules/is-fullwidth-code-point/package.json" }, { - "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" + "path": "node_modules/slice-ansi/node_modules/color-convert/package.json" }, { - "path": "node_modules/map-age-cleaner/package.json" + "path": "node_modules/power-assert-renderer-comparison/package.json" }, { - "path": "node_modules/resolve-url/package.json" + "path": "node_modules/flatted/package.json" }, { - "path": "node_modules/duplexify/package.json" + "path": "node_modules/unset-value/package.json" }, { - "path": "node_modules/ret/package.json" + "path": "node_modules/unset-value/node_modules/has-value/package.json" }, { - "path": "node_modules/object-is/package.json" + "path": "node_modules/unset-value/node_modules/has-value/node_modules/isobject/package.json" }, { - "path": "node_modules/tslib/package.json" + "path": "node_modules/unset-value/node_modules/has-values/package.json" }, { - "path": "node_modules/extend/package.json" + "path": "node_modules/inherits/package.json" }, { - "path": "node_modules/is-wsl/package.json" + "path": "node_modules/depd/package.json" }, { - "path": "node_modules/power-assert-context-reducer-ast/package.json" + "path": "node_modules/es6-promisify/package.json" }, { - "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" + "path": "node_modules/long/package.json" }, { - "path": "node_modules/css-what/package.json" + "path": "node_modules/regexpp/package.json" }, { - "path": "node_modules/power-assert-renderer-comparison/package.json" + "path": "node_modules/cli-width/package.json" }, { - "path": "node_modules/ecdsa-sig-formatter/package.json" + "path": "node_modules/call-matcher/package.json" }, { - "path": "node_modules/unique-slug/package.json" + "path": "node_modules/resolve-cwd/package.json" }, { - "path": "node_modules/typedarray-to-buffer/README.md" + "path": "node_modules/resolve-cwd/node_modules/resolve-from/package.json" }, { - "path": "node_modules/typedarray-to-buffer/package.json" + "path": "node_modules/eslint/package.json" }, { - "path": "node_modules/typedarray-to-buffer/.travis.yml" + "path": "node_modules/eslint/node_modules/debug/package.json" }, { - "path": "node_modules/typedarray-to-buffer/index.js" + "path": "node_modules/eslint/node_modules/ansi-regex/package.json" }, { - "path": "node_modules/typedarray-to-buffer/.airtap.yml" + "path": "node_modules/eslint/node_modules/path-key/package.json" }, { - "path": "node_modules/typedarray-to-buffer/LICENSE" + "path": "node_modules/eslint/node_modules/shebang-command/package.json" }, { - "path": "node_modules/typedarray-to-buffer/test/basic.js" + "path": "node_modules/eslint/node_modules/strip-ansi/package.json" }, { - "path": "node_modules/upath/package.json" + "path": "node_modules/eslint/node_modules/which/package.json" }, { - "path": "node_modules/markdown-it/package.json" + "path": "node_modules/eslint/node_modules/shebang-regex/package.json" }, { - "path": "node_modules/tslint-config-prettier/package.json" + "path": "node_modules/eslint/node_modules/semver/package.json" }, { - "path": "node_modules/buffer-from/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/index.js" }, { - "path": "node_modules/minizlib/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/README.md" }, { - "path": "node_modules/minizlib/node_modules/yallist/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/package.json" }, { - "path": "node_modules/domelementtype/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/LICENSE" }, { - "path": "node_modules/ci-info/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md" }, { - "path": "node_modules/@types/mocha/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/parse.js" }, { - "path": "node_modules/@types/color-name/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/enoent.js" }, { - "path": "node_modules/@types/is-windows/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js" }, { - "path": "node_modules/@types/istanbul-lib-coverage/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js" }, { - "path": "node_modules/@types/node/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js" }, { - "path": "node_modules/@types/long/package.json" + "path": "node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json" }, { - "path": "node_modules/serve-static/package.json" + "path": "node_modules/npm-bundled/package.json" }, { - "path": "node_modules/make-dir/package.json" + "path": "node_modules/is-wsl/package.json" }, { - "path": "node_modules/make-dir/node_modules/semver/package.json" + "path": "node_modules/mdurl/package.json" }, { - "path": "node_modules/md5.js/package.json" + "path": "node_modules/typedarray/package.json" }, { - "path": "node_modules/esquery/package.json" + "path": "node_modules/v8-to-istanbul/package.json" }, { - "path": "node_modules/ncp/package.json" + "path": "node_modules/espower-loader/package.json" }, { - "path": "node_modules/emoji-regex/package.json" + "path": "node_modules/object.getownpropertydescriptors/package.json" }, { - "path": "node_modules/set-value/package.json" + "path": "node_modules/cache-base/package.json" }, { - "path": "node_modules/set-value/node_modules/extend-shallow/package.json" + "path": "node_modules/array-find-index/package.json" }, { - "path": "node_modules/read-pkg/package.json" + "path": "node_modules/yargs/package.json" }, { - "path": "node_modules/fast-diff/package.json" + "path": "node_modules/ci-info/package.json" }, { - "path": "node_modules/path-browserify/package.json" + "path": "node_modules/miller-rabin/package.json" }, { - "path": "node_modules/xtend/package.json" + "path": "node_modules/color-convert/package.json" }, { - "path": "node_modules/resolve/package.json" + "path": "node_modules/use/package.json" }, { - "path": "node_modules/lowercase-keys/package.json" + "path": "node_modules/write-file-atomic/package.json" }, { - "path": "node_modules/is-fullwidth-code-point/package.json" + "path": "node_modules/to-arraybuffer/package.json" }, { - "path": "node_modules/webpack-sources/package.json" + "path": "node_modules/extglob/package.json" }, { - "path": "node_modules/is-extendable/package.json" + "path": "node_modules/extglob/node_modules/define-property/package.json" }, { - "path": "node_modules/read-pkg-up/package.json" + "path": "node_modules/extglob/node_modules/is-data-descriptor/package.json" }, { - "path": "node_modules/read-pkg-up/node_modules/locate-path/package.json" + "path": "node_modules/extglob/node_modules/is-accessor-descriptor/package.json" }, { - "path": "node_modules/read-pkg-up/node_modules/find-up/package.json" + "path": "node_modules/extglob/node_modules/extend-shallow/package.json" }, { - "path": "node_modules/read-pkg-up/node_modules/path-exists/package.json" + "path": "node_modules/extglob/node_modules/is-descriptor/package.json" }, { - "path": "node_modules/read-pkg-up/node_modules/p-locate/package.json" + "path": "node_modules/eslint-visitor-keys/package.json" }, { - "path": "node_modules/p-cancelable/package.json" + "path": "node_modules/to-regex/package.json" }, { - "path": "node_modules/aproba/package.json" + "path": "node_modules/path-browserify/package.json" }, { - "path": "node_modules/resolve-dir/package.json" + "path": "node_modules/agent-base/package.json" }, { - "path": "node_modules/resolve-dir/node_modules/global-modules/package.json" + "path": "node_modules/repeat-string/package.json" }, { - "path": "node_modules/acorn-jsx/package.json" + "path": "node_modules/flat/package.json" }, { - "path": "node_modules/interpret/package.json" + "path": "node_modules/through2/package.json" }, { - "path": "node_modules/power-assert-context-traversal/package.json" + "path": "node_modules/gaxios/package.json" }, { - "path": "node_modules/long/package.json" + "path": "node_modules/p-queue/package.json" }, { - "path": "node_modules/d/package.json" + "path": "node_modules/encodeurl/package.json" }, { - "path": "node_modules/debug/package.json" + "path": "node_modules/normalize-path/package.json" }, { - "path": "node_modules/mimic-fn/package.json" + "path": "node_modules/js-tokens/package.json" }, { - "path": "node_modules/bn.js/package.json" + "path": "node_modules/strip-json-comments/package.json" }, { - "path": "node_modules/arr-union/package.json" + "path": "node_modules/eslint-config-prettier/package.json" }, { - "path": "node_modules/cipher-base/package.json" + "path": "node_modules/uri-js/package.json" }, { - "path": "node_modules/typedarray/package.json" + "path": "node_modules/test-exclude/package.json" }, { - "path": "node_modules/isexe/package.json" + "path": "node_modules/safer-buffer/package.json" }, { - "path": "node_modules/multi-stage-sourcemap/package.json" + "path": "node_modules/prettier/package.json" }, { - "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" + "path": "node_modules/regexp.prototype.flags/package.json" }, { - "path": "node_modules/find-cache-dir/package.json" + "path": "node_modules/yargs-parser/package.json" }, { - "path": "node_modules/uc.micro/package.json" + "path": "node_modules/copy-descriptor/package.json" }, { - "path": "node_modules/fs.realpath/package.json" + "path": "node_modules/@babel/code-frame/package.json" }, { - "path": "node_modules/eslint-plugin-prettier/package.json" + "path": "node_modules/@babel/highlight/package.json" }, { - "path": "node_modules/yargs/package.json" + "path": "node_modules/@babel/parser/package.json" }, { - "path": "node_modules/yargs/node_modules/locate-path/package.json" + "path": "node_modules/configstore/package.json" }, { - "path": "node_modules/yargs/node_modules/find-up/package.json" + "path": "node_modules/configstore/node_modules/make-dir/package.json" }, { - "path": "node_modules/yargs/node_modules/path-exists/package.json" + "path": "node_modules/configstore/node_modules/write-file-atomic/package.json" }, { - "path": "node_modules/yargs/node_modules/p-locate/package.json" + "path": "node_modules/is-plain-obj/package.json" }, { - "path": "node_modules/nice-try/package.json" + "path": "node_modules/eastasianwidth/package.json" }, { - "path": "node_modules/static-extend/package.json" + "path": "node_modules/memory-fs/package.json" }, { - "path": "node_modules/static-extend/node_modules/define-property/package.json" + "path": "node_modules/has-yarn/package.json" }, { - "path": "node_modules/has/package.json" + "path": "node_modules/core-js/package.json" }, { - "path": "node_modules/xmlcreate/package.json" + "path": "samples/README.md" }, { - "path": "node_modules/escallmatch/package.json" + "path": "samples/.eslintrc" }, { - "path": "node_modules/escallmatch/node_modules/esprima/package.json" + "path": "samples/package.json" }, { - "path": "node_modules/get-caller-file/package.json" + "path": "samples/quickstart.js" }, { - "path": "node_modules/jwa/package.json" + "path": "samples/test/.eslintrc" }, { - "path": "node_modules/json5/package.json" + "path": "samples/test/samples.test.js" }, { - "path": "node_modules/json5/node_modules/minimist/package.json" + "path": "__pycache__/synth.cpython-36.pyc" } ] } \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/system-test/install.ts b/packages/google-cloud-recaptchaenterprise/system-test/install.ts index 2736aee84f7..c9aa74ec221 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/install.ts +++ b/packages/google-cloud-recaptchaenterprise/system-test/install.ts @@ -18,6 +18,7 @@ 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() { From 26a407a13e813dec2a02434d75b09e1598218159 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 7 Jan 2020 01:07:10 +0200 Subject: [PATCH 066/253] chore(deps): update dependency mocha to v7 (#94) --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- packages/google-cloud-recaptchaenterprise/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index f3b73bbfaa4..6a5cc14c7d2 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -41,7 +41,7 @@ "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", - "mocha": "^6.1.4", + "mocha": "^7.0.0", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", "power-assert": "^1.4.4", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index fe12e041b1c..047d7cb135d 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -17,7 +17,7 @@ }, "devDependencies": { "chai": "^4.2.0", - "mocha": "^6.1.4", + "mocha": "^7.0.0", "uuid": "^3.3.2" } } From b371a954f8982bdeb5ebd3c09f39268d09a95173 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 9 Jan 2020 09:16:08 -0800 Subject: [PATCH 067/253] fix: proper routing headers --- ...tcha_enterprise_service_v1_beta1_client.ts | 2 +- .../synth.metadata | 3881 +---------------- 2 files changed, 4 insertions(+), 3879 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 75c267de2e6..1a281534ba3 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -693,7 +693,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - key_name: request.key!.name || '', + 'key.name': request.key!.name || '', }); return this._innerApiCalls.updateKey(request, options, callback); } diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 18d4ea7fe28..d98c859d7dd 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2020-01-03T12:20:09.603060Z", + "updateTime": "2020-01-09T12:22:42.967870Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4d45a6399e9444fbddaeb1c86aabfde210723714", - "internalRef": "287908369" + "sha": "6ace586805c08896fef43e28a261337fcf3f022b", + "internalRef": "288783603" } }, { @@ -27,3880 +27,5 @@ "generator": "gapic-generator-typescript" } } - ], - "newFiles": [ - { - "path": "synth.metadata" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CONTRIBUTING.md" - }, - { - "path": "linkinator.config.json" - }, - { - "path": ".prettierignore" - }, - { - "path": "tsconfig.json" - }, - { - "path": ".jsdoc.js" - }, - { - "path": ".gitignore" - }, - { - "path": "synth.py" - }, - { - "path": "CODE_OF_CONDUCT.md" - }, - { - "path": "README.md" - }, - { - "path": "package-lock.json" - }, - { - "path": ".prettierrc" - }, - { - "path": "codecov.yaml" - }, - { - "path": ".nycrc" - }, - { - "path": "package.json" - }, - { - "path": "webpack.config.js" - }, - { - "path": ".eslintrc.yml" - }, - { - "path": "tslint.json" - }, - { - "path": "renovate.json" - }, - { - "path": "LICENSE" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": ".eslintignore" - }, - { - "path": ".github/PULL_REQUEST_TEMPLATE.md" - }, - { - "path": ".github/release-please.yml" - }, - { - "path": ".github/ISSUE_TEMPLATE/support_request.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/bug_report.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/feature_request.md" - }, - { - "path": ".kokoro/samples-test.sh" - }, - { - "path": ".kokoro/system-test.sh" - }, - { - "path": ".kokoro/docs.sh" - }, - { - "path": ".kokoro/lint.sh" - }, - { - "path": ".kokoro/.gitattributes" - }, - { - "path": ".kokoro/publish.sh" - }, - { - "path": ".kokoro/trampoline.sh" - }, - { - "path": ".kokoro/common.cfg" - }, - { - "path": ".kokoro/test.bat" - }, - { - "path": ".kokoro/test.sh" - }, - { - "path": ".kokoro/release/docs.sh" - }, - { - "path": ".kokoro/release/docs.cfg" - }, - { - "path": ".kokoro/release/common.cfg" - }, - { - "path": ".kokoro/release/publish.cfg" - }, - { - "path": ".kokoro/presubmit/node12/test.cfg" - }, - { - "path": ".kokoro/presubmit/node12/common.cfg" - }, - { - "path": ".kokoro/presubmit/node8/test.cfg" - }, - { - "path": ".kokoro/presubmit/node8/common.cfg" - }, - { - "path": ".kokoro/presubmit/node6/test.cfg" - }, - { - "path": ".kokoro/presubmit/node6/common.cfg" - }, - { - "path": ".kokoro/presubmit/windows/test.cfg" - }, - { - "path": ".kokoro/presubmit/windows/common.cfg" - }, - { - "path": ".kokoro/presubmit/node10/lint.cfg" - }, - { - "path": ".kokoro/presubmit/node10/system-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/docs.cfg" - }, - { - "path": ".kokoro/presubmit/node10/common.cfg" - }, - { - "path": ".kokoro/presubmit/node10/samples-test.cfg" - }, - { - "path": ".kokoro/continuous/node12/test.cfg" - }, - { - "path": ".kokoro/continuous/node12/common.cfg" - }, - { - "path": ".kokoro/continuous/node8/test.cfg" - }, - { - "path": ".kokoro/continuous/node8/common.cfg" - }, - { - "path": ".kokoro/continuous/node6/test.cfg" - }, - { - "path": ".kokoro/continuous/node6/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/lint.cfg" - }, - { - "path": ".kokoro/continuous/node10/system-test.cfg" - }, - { - "path": ".kokoro/continuous/node10/test.cfg" - }, - { - "path": ".kokoro/continuous/node10/docs.cfg" - }, - { - "path": ".kokoro/continuous/node10/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/samples-test.cfg" - }, - { - "path": "test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts" - }, - { - "path": "system-test/install.ts" - }, - { - "path": "system-test/fixtures/sample/src/index.ts" - }, - { - "path": "system-test/fixtures/sample/src/index.js" - }, - { - "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.js.map" - }, - { - "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.js" - }, - { - "path": "build/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.d.ts" - }, - { - "path": "build/system-test/install.d.ts" - }, - { - "path": "build/system-test/install.js" - }, - { - "path": "build/system-test/install.js.map" - }, - { - "path": "build/protos/protos.d.ts" - }, - { - "path": "build/protos/protos.js" - }, - { - "path": "build/protos/protos.json" - }, - { - "path": "build/protos/google/cloud/common_resources.proto" - }, - { - "path": "build/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto" - }, - { - "path": "build/src/index.js" - }, - { - "path": "build/src/index.js.map" - }, - { - "path": "build/src/index.d.ts" - }, - { - "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js" - }, - { - "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.d.ts" - }, - { - "path": "build/src/v1beta1/index.js" - }, - { - "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.d.ts" - }, - { - "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json" - }, - { - "path": "build/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.js.map" - }, - { - "path": "build/src/v1beta1/index.js.map" - }, - { - "path": "build/src/v1beta1/index.d.ts" - }, - { - "path": "protos/protos.d.ts" - }, - { - "path": "protos/protos.js" - }, - { - "path": "protos/protos.json" - }, - { - "path": "protos/google/cloud/common_resources.proto" - }, - { - "path": "protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto" - }, - { - "path": ".git/shallow" - }, - { - "path": ".git/HEAD" - }, - { - "path": ".git/config" - }, - { - "path": ".git/packed-refs" - }, - { - "path": ".git/index" - }, - { - "path": ".git/description" - }, - { - "path": ".git/objects/pack/pack-d62d7eb9d7551912cf7a4ed6fb21272d5ce6f977.pack" - }, - { - "path": ".git/objects/pack/pack-d62d7eb9d7551912cf7a4ed6fb21272d5ce6f977.idx" - }, - { - "path": ".git/logs/HEAD" - }, - { - "path": ".git/logs/refs/heads/master" - }, - { - "path": ".git/logs/refs/heads/autosynth" - }, - { - "path": ".git/logs/refs/remotes/origin/HEAD" - }, - { - "path": ".git/hooks/update.sample" - }, - { - "path": ".git/hooks/pre-push.sample" - }, - { - "path": ".git/hooks/pre-rebase.sample" - }, - { - "path": ".git/hooks/pre-commit.sample" - }, - { - "path": ".git/hooks/applypatch-msg.sample" - }, - { - "path": ".git/hooks/post-update.sample" - }, - { - "path": ".git/hooks/pre-applypatch.sample" - }, - { - "path": ".git/hooks/prepare-commit-msg.sample" - }, - { - "path": ".git/hooks/commit-msg.sample" - }, - { - "path": ".git/hooks/pre-receive.sample" - }, - { - "path": ".git/hooks/fsmonitor-watchman.sample" - }, - { - "path": ".git/refs/heads/master" - }, - { - "path": ".git/refs/heads/autosynth" - }, - { - "path": ".git/refs/remotes/origin/HEAD" - }, - { - "path": ".git/refs/tags/v1.5.0" - }, - { - "path": ".git/info/exclude" - }, - { - "path": "src/index.ts" - }, - { - "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_proto_list.json" - }, - { - "path": "src/v1beta1/index.ts" - }, - { - "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json" - }, - { - "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts" - }, - { - "path": "node_modules/builtin-status-codes/package.json" - }, - { - "path": "node_modules/progress/package.json" - }, - { - "path": "node_modules/is-ci/package.json" - }, - { - "path": "node_modules/isobject/package.json" - }, - { - "path": "node_modules/mamacro/package.json" - }, - { - "path": "node_modules/define-property/package.json" - }, - { - "path": "node_modules/define-property/node_modules/is-data-descriptor/package.json" - }, - { - "path": "node_modules/define-property/node_modules/is-accessor-descriptor/package.json" - }, - { - "path": "node_modules/define-property/node_modules/is-descriptor/package.json" - }, - { - "path": "node_modules/lru-cache/package.json" - }, - { - "path": "node_modules/destroy/package.json" - }, - { - "path": "node_modules/snapdragon-util/package.json" - }, - { - "path": "node_modules/snapdragon-util/node_modules/is-buffer/package.json" - }, - { - "path": "node_modules/snapdragon-util/node_modules/kind-of/package.json" - }, - { - "path": "node_modules/power-assert-context-formatter/package.json" - }, - { - "path": "node_modules/fast-json-stable-stringify/package.json" - }, - { - "path": "node_modules/nice-try/package.json" - }, - { - "path": "node_modules/which-module/package.json" - }, - { - "path": "node_modules/asn1.js/package.json" - }, - { - "path": "node_modules/array-find/package.json" - }, - { - "path": "node_modules/catharsis/package.json" - }, - { - "path": "node_modules/is-promise/package.json" - }, - { - "path": "node_modules/v8-compile-cache/package.json" - }, - { - "path": "node_modules/create-hmac/package.json" - }, - { - "path": "node_modules/tapable/package.json" - }, - { - "path": "node_modules/.bin/sha.js" - }, - { - "path": "node_modules/doctrine/package.json" - }, - { - "path": "node_modules/callsites/package.json" - }, - { - "path": "node_modules/diff/package.json" - }, - { - "path": "node_modules/hosted-git-info/package.json" - }, - { - "path": "node_modules/color-name/package.json" - }, - { - "path": "node_modules/path-dirname/package.json" - }, - { - "path": "node_modules/defer-to-connect/package.json" - }, - { - "path": "node_modules/snapdragon/index.js" - }, - { - "path": "node_modules/snapdragon/README.md" - }, - { - "path": "node_modules/snapdragon/package.json" - }, - { - "path": "node_modules/snapdragon/LICENSE" - }, - { - "path": "node_modules/snapdragon/lib/position.js" - }, - { - "path": "node_modules/snapdragon/lib/compiler.js" - }, - { - "path": "node_modules/snapdragon/lib/source-maps.js" - }, - { - "path": "node_modules/snapdragon/lib/utils.js" - }, - { - "path": "node_modules/snapdragon/lib/parser.js" - }, - { - "path": "node_modules/snapdragon/node_modules/define-property/package.json" - }, - { - "path": "node_modules/snapdragon/node_modules/debug/package.json" - }, - { - "path": "node_modules/snapdragon/node_modules/ms/package.json" - }, - { - "path": "node_modules/snapdragon/node_modules/extend-shallow/package.json" - }, - { - "path": "node_modules/snapdragon/node_modules/source-map/package.json" - }, - { - "path": "node_modules/unpipe/package.json" - }, - { - "path": "node_modules/parse-asn1/package.json" - }, - { - "path": "node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/http-errors/package.json" - }, - { - "path": "node_modules/eventemitter3/package.json" - }, - { - "path": "node_modules/esutils/package.json" - }, - { - "path": "node_modules/npm-run-path/package.json" - }, - { - "path": "node_modules/npm-run-path/node_modules/path-key/package.json" - }, - { - "path": "node_modules/he/package.json" - }, - { - "path": "node_modules/pack-n-play/package.json" - }, - { - "path": "node_modules/pack-n-play/node_modules/tmp/package.json" - }, - { - "path": "node_modules/pack-n-play/node_modules/tmp/node_modules/rimraf/package.json" - }, - { - "path": "node_modules/on-finished/package.json" - }, - { - "path": "node_modules/crypto-browserify/package.json" - }, - { - "path": "node_modules/linkinator/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/update-notifier/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/dot-prop/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/redent/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/semver-diff/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/map-obj/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/meow/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/term-size/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/crypto-random-string/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/indent-string/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/camelcase-keys/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/is-obj/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/read-pkg-up/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/is-path-inside/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/boxen/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/chalk/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/arrify/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/widest-line/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/global-dirs/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/parse-json/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/xdg-basedir/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/is-npm/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/read-pkg/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/read-pkg/node_modules/type-fest/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/is-installed-globally/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/trim-newlines/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/semver/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/unique-string/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/strip-indent/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/quick-lru/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/minimist-options/package.json" - }, - { - "path": "node_modules/linkinator/node_modules/configstore/package.json" - }, - { - "path": "node_modules/update-notifier/package.json" - }, - { - "path": "node_modules/p-cancelable/package.json" - }, - { - "path": "node_modules/markdown-it/package.json" - }, - { - "path": "node_modules/setimmediate/package.json" - }, - { - "path": "node_modules/dot-prop/package.json" - }, - { - "path": "node_modules/require-main-filename/package.json" - }, - { - "path": "node_modules/fast-diff/package.json" - }, - { - "path": "node_modules/lodash.camelcase/package.json" - }, - { - "path": "node_modules/redent/package.json" - }, - { - "path": "node_modules/resolve/package.json" - }, - { - "path": "node_modules/globals/package.json" - }, - { - "path": "node_modules/p-is-promise/package.json" - }, - { - "path": "node_modules/range-parser/package.json" - }, - { - "path": "node_modules/string.prototype.trimright/package.json" - }, - { - "path": "node_modules/chrome-trace-event/package.json" - }, - { - "path": "node_modules/constants-browserify/package.json" - }, - { - "path": "node_modules/inflight/package.json" - }, - { - "path": "node_modules/debug/package.json" - }, - { - "path": "node_modules/htmlparser2/package.json" - }, - { - "path": "node_modules/htmlparser2/node_modules/readable-stream/package.json" - }, - { - "path": "node_modules/semver-diff/package.json" - }, - { - "path": "node_modules/semver-diff/node_modules/semver/package.json" - }, - { - "path": "node_modules/tsutils/package.json" - }, - { - "path": "node_modules/multi-stage-sourcemap/package.json" - }, - { - "path": "node_modules/multi-stage-sourcemap/node_modules/source-map/package.json" - }, - { - "path": "node_modules/ms/package.json" - }, - { - "path": "node_modules/linkify-it/package.json" - }, - { - "path": "node_modules/through/package.json" - }, - { - "path": "node_modules/power-assert-renderer-file/package.json" - }, - { - "path": "node_modules/homedir-polyfill/package.json" - }, - { - "path": "node_modules/string-width/package.json" - }, - { - "path": "node_modules/html-escaper/package.json" - }, - { - "path": "node_modules/type/package.json" - }, - { - "path": "node_modules/move-concurrently/package.json" - }, - { - "path": "node_modules/move-concurrently/node_modules/rimraf/package.json" - }, - { - "path": "node_modules/type-fest/package.json" - }, - { - "path": "node_modules/intelli-espower-loader/package.json" - }, - { - "path": "node_modules/parseurl/package.json" - }, - { - "path": "node_modules/buffer-from/package.json" - }, - { - "path": "node_modules/google-p12-pem/package.json" - }, - { - "path": "node_modules/get-caller-file/package.json" - }, - { - "path": "node_modules/klaw/package.json" - }, - { - "path": "node_modules/public-encrypt/package.json" - }, - { - "path": "node_modules/map-obj/package.json" - }, - { - "path": "node_modules/node-fetch/package.json" - }, - { - "path": "node_modules/jsonexport/package.json" - }, - { - "path": "node_modules/isexe/package.json" - }, - { - "path": "node_modules/object.pick/package.json" - }, - { - "path": "node_modules/escallmatch/package.json" - }, - { - "path": "node_modules/escallmatch/node_modules/esprima/package.json" - }, - { - "path": "node_modules/espower/package.json" - }, - { - "path": "node_modules/espower/node_modules/source-map/package.json" - }, - { - "path": "node_modules/run-async/package.json" - }, - { - "path": "node_modules/@webassemblyjs/ast/package.json" - }, - { - "path": "node_modules/@webassemblyjs/wast-printer/package.json" - }, - { - "path": "node_modules/@webassemblyjs/helper-code-frame/package.json" - }, - { - "path": "node_modules/@webassemblyjs/wasm-opt/package.json" - }, - { - "path": "node_modules/@webassemblyjs/helper-wasm-bytecode/package.json" - }, - { - "path": "node_modules/@webassemblyjs/helper-wasm-section/package.json" - }, - { - "path": "node_modules/@webassemblyjs/wasm-parser/package.json" - }, - { - "path": "node_modules/@webassemblyjs/helper-api-error/package.json" - }, - { - "path": "node_modules/@webassemblyjs/helper-buffer/package.json" - }, - { - "path": "node_modules/@webassemblyjs/utf8/package.json" - }, - { - "path": "node_modules/@webassemblyjs/wast-parser/package.json" - }, - { - "path": "node_modules/@webassemblyjs/wasm-gen/package.json" - }, - { - "path": "node_modules/@webassemblyjs/leb128/package.json" - }, - { - "path": "node_modules/@webassemblyjs/helper-fsm/package.json" - }, - { - "path": "node_modules/@webassemblyjs/wasm-edit/package.json" - }, - { - "path": "node_modules/@webassemblyjs/ieee754/package.json" - }, - { - "path": "node_modules/@webassemblyjs/helper-module-context/package.json" - }, - { - "path": "node_modules/@webassemblyjs/floating-point-hex-parser/package.json" - }, - { - "path": "node_modules/validate-npm-package-license/package.json" - }, - { - "path": "node_modules/file-entry-cache/package.json" - }, - { - "path": "node_modules/meow/package.json" - }, - { - "path": "node_modules/meow/node_modules/camelcase/package.json" - }, - { - "path": "node_modules/meow/node_modules/yargs-parser/package.json" - }, - { - "path": "node_modules/cacache/package.json" - }, - { - "path": "node_modules/cacache/node_modules/rimraf/package.json" - }, - { - "path": "node_modules/concat-map/package.json" - }, - { - "path": "node_modules/infer-owner/package.json" - }, - { - "path": "node_modules/term-size/package.json" - }, - { - "path": "node_modules/xmlcreate/package.json" - }, - { - "path": "node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/yallist/package.json" - }, - { - "path": "node_modules/class-utils/package.json" - }, - { - "path": "node_modules/class-utils/node_modules/define-property/package.json" - }, - { - "path": "node_modules/json-bigint/package.json" - }, - { - "path": "node_modules/hmac-drbg/package.json" - }, - { - "path": "node_modules/resolve-from/package.json" - }, - { - "path": "node_modules/is-buffer/package.json" - }, - { - "path": "node_modules/cliui/package.json" - }, - { - "path": "node_modules/cipher-base/package.json" - }, - { - "path": "node_modules/toidentifier/package.json" - }, - { - "path": "node_modules/balanced-match/package.json" - }, - { - "path": "node_modules/marked/package.json" - }, - { - "path": "node_modules/wrappy/package.json" - }, - { - "path": "node_modules/jsdoc-region-tag/package.json" - }, - { - "path": "node_modules/json-stable-stringify-without-jsonify/package.json" - }, - { - "path": "node_modules/glob-parent/package.json" - }, - { - "path": "node_modules/collection-visit/package.json" - }, - { - "path": "node_modules/xtend/package.json" - }, - { - "path": "node_modules/loader-utils/package.json" - }, - { - "path": "node_modules/assign-symbols/package.json" - }, - { - "path": "node_modules/assert/package.json" - }, - { - "path": "node_modules/assert/node_modules/util/package.json" - }, - { - "path": "node_modules/assert/node_modules/inherits/package.json" - }, - { - "path": "node_modules/is-arguments/package.json" - }, - { - "path": "node_modules/bn.js/package.json" - }, - { - "path": "node_modules/set-blocking/package.json" - }, - { - "path": "node_modules/fill-range/package.json" - }, - { - "path": "node_modules/from2/package.json" - }, - { - "path": "node_modules/object-visit/package.json" - }, - { - "path": "node_modules/istanbul-lib-report/package.json" - }, - { - "path": "node_modules/load-json-file/package.json" - }, - { - "path": "node_modules/mississippi/package.json" - }, - { - "path": "node_modules/mississippi/node_modules/through2/package.json" - }, - { - "path": "node_modules/has-value/package.json" - }, - { - "path": "node_modules/readdirp/package.json" - }, - { - "path": "node_modules/readdirp/node_modules/is-buffer/package.json" - }, - { - "path": "node_modules/readdirp/node_modules/fill-range/package.json" - }, - { - "path": "node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/package.json" - }, - { - "path": "node_modules/readdirp/node_modules/is-number/package.json" - }, - { - "path": "node_modules/readdirp/node_modules/is-number/node_modules/kind-of/package.json" - }, - { - "path": "node_modules/readdirp/node_modules/micromatch/index.js" - }, - { - "path": "node_modules/readdirp/node_modules/micromatch/README.md" - }, - { - "path": "node_modules/readdirp/node_modules/micromatch/package.json" - }, - { - "path": "node_modules/readdirp/node_modules/micromatch/LICENSE" - }, - { - "path": "node_modules/readdirp/node_modules/micromatch/CHANGELOG.md" - }, - { - "path": "node_modules/readdirp/node_modules/micromatch/lib/parsers.js" - }, - { - "path": "node_modules/readdirp/node_modules/micromatch/lib/.DS_Store" - }, - { - "path": "node_modules/readdirp/node_modules/micromatch/lib/compilers.js" - }, - { - "path": "node_modules/readdirp/node_modules/micromatch/lib/utils.js" - }, - { - "path": "node_modules/readdirp/node_modules/micromatch/lib/cache.js" - }, - { - "path": "node_modules/readdirp/node_modules/braces/package.json" - }, - { - "path": "node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/package.json" - }, - { - "path": "node_modules/readdirp/node_modules/to-regex-range/package.json" - }, - { - "path": "node_modules/is-number/package.json" - }, - { - "path": "node_modules/ansi-align/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/string-width/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/ansi-align/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/atob/package.json" - }, - { - "path": "node_modules/duplexer3/package.json" - }, - { - "path": "node_modules/esprima/package.json" - }, - { - "path": "node_modules/is-stream-ended/package.json" - }, - { - "path": "node_modules/minimatch/package.json" - }, - { - "path": "node_modules/crypto-random-string/package.json" - }, - { - "path": "node_modules/growl/package.json" - }, - { - "path": "node_modules/string.prototype.trimleft/package.json" - }, - { - "path": "node_modules/istanbul-lib-coverage/package.json" - }, - { - "path": "node_modules/global-prefix/package.json" - }, - { - "path": "node_modules/global-prefix/node_modules/which/package.json" - }, - { - "path": "node_modules/normalize-package-data/package.json" - }, - { - "path": "node_modules/normalize-package-data/node_modules/semver/package.json" - }, - { - "path": "node_modules/fast-text-encoding/package.json" - }, - { - "path": "node_modules/tar/package.json" - }, - { - "path": "node_modules/tar/node_modules/yallist/package.json" - }, - { - "path": "node_modules/cyclist/package.json" - }, - { - "path": "node_modules/server-destroy/package.json" - }, - { - "path": "node_modules/remove-trailing-separator/package.json" - }, - { - "path": "node_modules/prelude-ls/package.json" - }, - { - "path": "node_modules/d/package.json" - }, - { - "path": "node_modules/protobufjs/package.json" - }, - { - "path": "node_modules/protobufjs/cli/package-lock.json" - }, - { - "path": "node_modules/protobufjs/cli/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/uglify-js/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/acorn-jsx/node_modules/acorn/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/minimist/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/semver/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/acorn/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/commander/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/espree/package.json" - }, - { - "path": "node_modules/protobufjs/cli/node_modules/source-map/package.json" - }, - { - "path": "node_modules/protobufjs/node_modules/@types/node/package.json" - }, - { - "path": "node_modules/domhandler/package.json" - }, - { - "path": "node_modules/pkg-dir/package.json" - }, - { - "path": "node_modules/pkg-dir/node_modules/p-locate/package.json" - }, - { - "path": "node_modules/pkg-dir/node_modules/locate-path/package.json" - }, - { - "path": "node_modules/pkg-dir/node_modules/find-up/package.json" - }, - { - "path": "node_modules/pkg-dir/node_modules/path-exists/package.json" - }, - { - "path": "node_modules/ansi-escapes/package.json" - }, - { - "path": "node_modules/power-assert-renderer-base/package.json" - }, - { - "path": "node_modules/boolbase/package.json" - }, - { - "path": "node_modules/aproba/package.json" - }, - { - "path": "node_modules/fragment-cache/package.json" - }, - { - "path": "node_modules/indent-string/package.json" - }, - { - "path": "node_modules/lodash/package.json" - }, - { - "path": "node_modules/taffydb/package.json" - }, - { - "path": "node_modules/extend/package.json" - }, - { - "path": "node_modules/is-yarn-global/package.json" - }, - { - "path": "node_modules/dom-serializer/package.json" - }, - { - "path": "node_modules/end-of-stream/package.json" - }, - { - "path": "node_modules/log-symbols/package.json" - }, - { - "path": "node_modules/is-callable/package.json" - }, - { - "path": "node_modules/es5-ext/package.json" - }, - { - "path": "node_modules/https-browserify/package.json" - }, - { - "path": "node_modules/stringifier/package.json" - }, - { - "path": "node_modules/source-list-map/package.json" - }, - { - "path": "node_modules/vm-browserify/package.json" - }, - { - "path": "node_modules/es6-weak-map/package.json" - }, - { - "path": "node_modules/camelcase-keys/package.json" - }, - { - "path": "node_modules/camelcase-keys/node_modules/camelcase/package.json" - }, - { - "path": "node_modules/browserify-zlib/package.json" - }, - { - "path": "node_modules/pascalcase/package.json" - }, - { - "path": "node_modules/decompress-response/package.json" - }, - { - "path": "node_modules/set-value/package.json" - }, - { - "path": "node_modules/set-value/node_modules/extend-shallow/package.json" - }, - { - "path": "node_modules/js-yaml/package.json" - }, - { - "path": "node_modules/cli-boxes/package.json" - }, - { - "path": "node_modules/is-obj/package.json" - }, - { - "path": "node_modules/is-typedarray/package.json" - }, - { - "path": "node_modules/is-binary-path/package.json" - }, - { - "path": "node_modules/registry-auth-token/package.json" - }, - { - "path": "node_modules/safe-regex/package.json" - }, - { - "path": "node_modules/decode-uri-component/package.json" - }, - { - "path": "node_modules/read-pkg-up/package.json" - }, - { - "path": "node_modules/read-pkg-up/node_modules/p-locate/package.json" - }, - { - "path": "node_modules/read-pkg-up/node_modules/locate-path/package.json" - }, - { - "path": "node_modules/read-pkg-up/node_modules/p-try/package.json" - }, - { - "path": "node_modules/read-pkg-up/node_modules/p-limit/package.json" - }, - { - "path": "node_modules/read-pkg-up/node_modules/find-up/package.json" - }, - { - "path": "node_modules/read-pkg-up/node_modules/path-exists/package.json" - }, - { - "path": "node_modules/buffer-equal-constant-time/package.json" - }, - { - "path": "node_modules/@bcoe/v8-coverage/package.json" - }, - { - "path": "node_modules/eslint-scope/package.json" - }, - { - "path": "node_modules/stream-shift/package.json" - }, - { - "path": "node_modules/union-value/package.json" - }, - { - "path": "node_modules/invert-kv/package.json" - }, - { - "path": "node_modules/snapdragon-node/package.json" - }, - { - "path": "node_modules/snapdragon-node/node_modules/define-property/package.json" - }, - { - "path": "node_modules/snapdragon-node/node_modules/is-data-descriptor/package.json" - }, - { - "path": "node_modules/snapdragon-node/node_modules/is-accessor-descriptor/package.json" - }, - { - "path": "node_modules/snapdragon-node/node_modules/is-descriptor/package.json" - }, - { - "path": "node_modules/is-extglob/package.json" - }, - { - "path": "node_modules/typedarray-to-buffer/index.js" - }, - { - "path": "node_modules/typedarray-to-buffer/README.md" - }, - { - "path": "node_modules/typedarray-to-buffer/.airtap.yml" - }, - { - "path": "node_modules/typedarray-to-buffer/.travis.yml" - }, - { - "path": "node_modules/typedarray-to-buffer/package.json" - }, - { - "path": "node_modules/typedarray-to-buffer/LICENSE" - }, - { - "path": "node_modules/typedarray-to-buffer/test/basic.js" - }, - { - "path": "node_modules/restore-cursor/package.json" - }, - { - "path": "node_modules/pbkdf2/package.json" - }, - { - "path": "node_modules/events/package.json" - }, - { - "path": "node_modules/map-cache/package.json" - }, - { - "path": "node_modules/mimic-response/package.json" - }, - { - "path": "node_modules/normalize-url/package.json" - }, - { - "path": "node_modules/kind-of/package.json" - }, - { - "path": "node_modules/fresh/package.json" - }, - { - "path": "node_modules/interpret/package.json" - }, - { - "path": "node_modules/imurmurhash/package.json" - }, - { - "path": "node_modules/indexof/package.json" - }, - { - "path": "node_modules/arr-flatten/package.json" - }, - { - "path": "node_modules/ajv/package.json" - }, - { - "path": "node_modules/is-path-inside/package.json" - }, - { - "path": "node_modules/timers-browserify/package.json" - }, - { - "path": "node_modules/import-lazy/package.json" - }, - { - "path": "node_modules/json-schema-traverse/package.json" - }, - { - "path": "node_modules/ncp/package.json" - }, - { - "path": "node_modules/rxjs/package.json" - }, - { - "path": "node_modules/p-locate/package.json" - }, - { - "path": "node_modules/figures/package.json" - }, - { - "path": "node_modules/os-browserify/package.json" - }, - { - "path": "node_modules/underscore/package.json" - }, - { - "path": "node_modules/finalhandler/package.json" - }, - { - "path": "node_modules/finalhandler/node_modules/debug/package.json" - }, - { - "path": "node_modules/finalhandler/node_modules/ms/package.json" - }, - { - "path": "node_modules/ignore/package.json" - }, - { - "path": "node_modules/path-is-absolute/package.json" - }, - { - "path": "node_modules/arr-diff/package.json" - }, - { - "path": "node_modules/graceful-fs/package.json" - }, - { - "path": "node_modules/is-extendable/package.json" - }, - { - "path": "node_modules/currently-unhandled/package.json" - }, - { - "path": "node_modules/minizlib/package.json" - }, - { - "path": "node_modules/minizlib/node_modules/yallist/package.json" - }, - { - "path": "node_modules/source-map-resolve/package.json" - }, - { - "path": "node_modules/google-gax/package.json" - }, - { - "path": "node_modules/browserify-aes/package.json" - }, - { - "path": "node_modules/commondir/package.json" - }, - { - "path": "node_modules/onetime/package.json" - }, - { - "path": "node_modules/lcid/package.json" - }, - { - "path": "node_modules/path-key/package.json" - }, - { - "path": "node_modules/core-util-is/package.json" - }, - { - "path": "node_modules/array-filter/package.json" - }, - { - "path": "node_modules/prepend-http/package.json" - }, - { - "path": "node_modules/console-browserify/package.json" - }, - { - "path": "node_modules/write/package.json" - }, - { - "path": "node_modules/duplexify/package.json" - }, - { - "path": "node_modules/camelcase/package.json" - }, - { - "path": "node_modules/tty-browserify/package.json" - }, - { - "path": "node_modules/error-ex/package.json" - }, - { - "path": "node_modules/empower-assert/package.json" - }, - { - "path": "node_modules/micromatch/package.json" - }, - { - "path": "node_modules/boxen/package.json" - }, - { - "path": "node_modules/boxen/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/boxen/node_modules/string-width/package.json" - }, - { - "path": "node_modules/boxen/node_modules/type-fest/package.json" - }, - { - "path": "node_modules/boxen/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/boxen/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/boxen/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/repeat-element/package.json" - }, - { - "path": "node_modules/querystring/package.json" - }, - { - "path": "node_modules/node-environment-flags/package.json" - }, - { - "path": "node_modules/node-environment-flags/node_modules/semver/package.json" - }, - { - "path": "node_modules/c8/package.json" - }, - { - "path": "node_modules/gcp-metadata/package.json" - }, - { - "path": "node_modules/json-buffer/package.json" - }, - { - "path": "node_modules/stream-each/package.json" - }, - { - "path": "node_modules/mkdirp/package.json" - }, - { - "path": "node_modules/bluebird/package.json" - }, - { - "path": "node_modules/null-loader/package.json" - }, - { - "path": "node_modules/big.js/package.json" - }, - { - "path": "node_modules/shebang-command/package.json" - }, - { - "path": "node_modules/serve-static/package.json" - }, - { - "path": "node_modules/object-copy/package.json" - }, - { - "path": "node_modules/object-copy/node_modules/define-property/package.json" - }, - { - "path": "node_modules/object-copy/node_modules/is-buffer/package.json" - }, - { - "path": "node_modules/object-copy/node_modules/kind-of/package.json" - }, - { - "path": "node_modules/path-parse/package.json" - }, - { - "path": "node_modules/mime/package.json" - }, - { - "path": "node_modules/terser/package.json" - }, - { - "path": "node_modules/terser/node_modules/source-map-support/package.json" - }, - { - "path": "node_modules/terser/node_modules/source-map/package.json" - }, - { - "path": "node_modules/emojis-list/package.json" - }, - { - "path": "node_modules/yargs-unparser/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/color-name/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/string-width/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/cliui/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/p-locate/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/locate-path/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/find-up/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/wrap-ansi/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/path-exists/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/yargs/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/yargs-unparser/node_modules/yargs-parser/package.json" - }, - { - "path": "node_modules/minimalistic-crypto-utils/package.json" - }, - { - "path": "node_modules/lines-and-columns/package.json" - }, - { - "path": "node_modules/minimalistic-assert/package.json" - }, - { - "path": "node_modules/is-url/package.json" - }, - { - "path": "node_modules/is-data-descriptor/package.json" - }, - { - "path": "node_modules/is-data-descriptor/node_modules/is-buffer/package.json" - }, - { - "path": "node_modules/is-data-descriptor/node_modules/kind-of/package.json" - }, - { - "path": "node_modules/chalk/package.json" - }, - { - "path": "node_modules/chalk/node_modules/color-name/package.json" - }, - { - "path": "node_modules/chalk/node_modules/has-flag/package.json" - }, - { - "path": "node_modules/chalk/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/chalk/node_modules/supports-color/package.json" - }, - { - "path": "node_modules/chalk/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/locate-path/package.json" - }, - { - "path": "node_modules/spdx-expression-parse/package.json" - }, - { - "path": "node_modules/power-assert-util-string-width/package.json" - }, - { - "path": "node_modules/esquery/package.json" - }, - { - "path": "node_modules/to-readable-stream/package.json" - }, - { - "path": "node_modules/jsdoc-fresh/package.json" - }, - { - "path": "node_modules/jsdoc-fresh/node_modules/taffydb/package.json" - }, - { - "path": "node_modules/espower-location-detector/package.json" - }, - { - "path": "node_modules/espower-location-detector/node_modules/source-map/package.json" - }, - { - "path": "node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/is-arrayish/package.json" - }, - { - "path": "node_modules/prettier-linter-helpers/package.json" - }, - { - "path": "node_modules/chardet/package.json" - }, - { - "path": "node_modules/amdefine/package.json" - }, - { - "path": "node_modules/http-cache-semantics/package.json" - }, - { - "path": "node_modules/concat-stream/package.json" - }, - { - "path": "node_modules/has-flag/package.json" - }, - { - "path": "node_modules/cheerio/package.json" - }, - { - "path": "node_modules/domelementtype/package.json" - }, - { - "path": "node_modules/npm-normalize-package-bin/package.json" - }, - { - "path": "node_modules/diffie-hellman/package.json" - }, - { - "path": "node_modules/@szmarczak/http-timer/package.json" - }, - { - "path": "node_modules/tmp/package.json" - }, - { - "path": "node_modules/entities/package.json" - }, - { - "path": "node_modules/execa/package.json" - }, - { - "path": "node_modules/execa/node_modules/lru-cache/package.json" - }, - { - "path": "node_modules/execa/node_modules/yallist/package.json" - }, - { - "path": "node_modules/execa/node_modules/shebang-command/package.json" - }, - { - "path": "node_modules/execa/node_modules/is-stream/package.json" - }, - { - "path": "node_modules/execa/node_modules/which/package.json" - }, - { - "path": "node_modules/execa/node_modules/shebang-regex/package.json" - }, - { - "path": "node_modules/execa/node_modules/cross-spawn/package.json" - }, - { - "path": "node_modules/is-accessor-descriptor/package.json" - }, - { - "path": "node_modules/is-accessor-descriptor/node_modules/is-buffer/package.json" - }, - { - "path": "node_modules/is-accessor-descriptor/node_modules/kind-of/package.json" - }, - { - "path": "node_modules/strip-bom/package.json" - }, - { - "path": "node_modules/argparse/package.json" - }, - { - "path": "node_modules/has/package.json" - }, - { - "path": "node_modules/ee-first/package.json" - }, - { - "path": "node_modules/serialize-javascript/package.json" - }, - { - "path": "node_modules/sha.js/sha512.js" - }, - { - "path": "node_modules/sha.js/bin.js" - }, - { - "path": "node_modules/sha.js/index.js" - }, - { - "path": "node_modules/sha.js/README.md" - }, - { - "path": "node_modules/sha.js/sha.js" - }, - { - "path": "node_modules/sha.js/sha256.js" - }, - { - "path": "node_modules/sha.js/hash.js" - }, - { - "path": "node_modules/sha.js/.travis.yml" - }, - { - "path": "node_modules/sha.js/package.json" - }, - { - "path": "node_modules/sha.js/sha384.js" - }, - { - "path": "node_modules/sha.js/sha1.js" - }, - { - "path": "node_modules/sha.js/LICENSE" - }, - { - "path": "node_modules/sha.js/sha224.js" - }, - { - "path": "node_modules/sha.js/test/test.js" - }, - { - "path": "node_modules/sha.js/test/hash.js" - }, - { - "path": "node_modules/sha.js/test/vectors.js" - }, - { - "path": "node_modules/object-inspect/package.json" - }, - { - "path": "node_modules/deep-equal/package.json" - }, - { - "path": "node_modules/create-hash/package.json" - }, - { - "path": "node_modules/table/package.json" - }, - { - "path": "node_modules/table/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/table/node_modules/string-width/package.json" - }, - { - "path": "node_modules/table/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/table/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/table/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/spdx-correct/package.json" - }, - { - "path": "node_modules/get-stream/package.json" - }, - { - "path": "node_modules/expand-tilde/package.json" - }, - { - "path": "node_modules/chownr/package.json" - }, - { - "path": "node_modules/power-assert/package.json" - }, - { - "path": "node_modules/expand-brackets/package.json" - }, - { - "path": "node_modules/expand-brackets/node_modules/define-property/package.json" - }, - { - "path": "node_modules/expand-brackets/node_modules/debug/package.json" - }, - { - "path": "node_modules/expand-brackets/node_modules/ms/package.json" - }, - { - "path": "node_modules/expand-brackets/node_modules/extend-shallow/package.json" - }, - { - "path": "node_modules/statuses/package.json" - }, - { - "path": "node_modules/browserify-rsa/package.json" - }, - { - "path": "node_modules/@istanbuljs/schema/package.json" - }, - { - "path": "node_modules/es6-set/package.json" - }, - { - "path": "node_modules/es6-set/node_modules/es6-symbol/package.json" - }, - { - "path": "node_modules/parse-passwd/package.json" - }, - { - "path": "node_modules/istanbul-reports/package.json" - }, - { - "path": "node_modules/browserify-sign/package.json" - }, - { - "path": "node_modules/enhanced-resolve/package.json" - }, - { - "path": "node_modules/@grpc/grpc-js/package.json" - }, - { - "path": "node_modules/@grpc/grpc-js/node_modules/semver/package.json" - }, - { - "path": "node_modules/@grpc/proto-loader/package.json" - }, - { - "path": "node_modules/lowercase-keys/package.json" - }, - { - "path": "node_modules/etag/package.json" - }, - { - "path": "node_modules/y18n/package.json" - }, - { - "path": "node_modules/diff-match-patch/package.json" - }, - { - "path": "node_modules/es6-iterator/package.json" - }, - { - "path": "node_modules/eslint-plugin-node/package.json" - }, - { - "path": "node_modules/eslint-plugin-node/node_modules/ignore/package.json" - }, - { - "path": "node_modules/eslint-plugin-node/node_modules/semver/package.json" - }, - { - "path": "node_modules/eslint-plugin-node/node_modules/eslint-utils/package.json" - }, - { - "path": "node_modules/natural-compare/package.json" - }, - { - "path": "node_modules/event-target-shim/package.json" - }, - { - "path": "node_modules/url/package.json" - }, - { - "path": "node_modules/url/node_modules/punycode/package.json" - }, - { - "path": "node_modules/pako/package.json" - }, - { - "path": "node_modules/arrify/package.json" - }, - { - "path": "node_modules/widest-line/package.json" - }, - { - "path": "node_modules/widest-line/node_modules/string-width/package.json" - }, - { - "path": "node_modules/widest-line/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/widest-line/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/widest-line/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/ignore-walk/package.json" - }, - { - "path": "node_modules/errno/package.json" - }, - { - "path": "node_modules/util-deprecate/package.json" - }, - { - "path": "node_modules/function-bind/package.json" - }, - { - "path": "node_modules/object-is/package.json" - }, - { - "path": "node_modules/@types/color-name/package.json" - }, - { - "path": "node_modules/@types/node/package.json" - }, - { - "path": "node_modules/@types/istanbul-lib-coverage/package.json" - }, - { - "path": "node_modules/@types/normalize-package-data/package.json" - }, - { - "path": "node_modules/@types/is-windows/package.json" - }, - { - "path": "node_modules/@types/mocha/package.json" - }, - { - "path": "node_modules/@types/minimist/package.json" - }, - { - "path": "node_modules/@types/fs-extra/package.json" - }, - { - "path": "node_modules/@types/fs-extra/node_modules/@types/node/package.json" - }, - { - "path": "node_modules/@types/long/package.json" - }, - { - "path": "node_modules/is-windows/package.json" - }, - { - "path": "node_modules/levn/package.json" - }, - { - "path": "node_modules/pseudomap/package.json" - }, - { - "path": "node_modules/global-dirs/package.json" - }, - { - "path": "node_modules/picomatch/package.json" - }, - { - "path": "node_modules/power-assert-renderer-diagram/package.json" - }, - { - "path": "node_modules/webpack-cli/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/v8-compile-cache/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/color-name/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/string-width/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/cliui/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/p-locate/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/path-key/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/shebang-command/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/locate-path/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/has-flag/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/enhanced-resolve/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/which/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/shebang-regex/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/semver/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/supports-color/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/find-up/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/index.js" - }, - { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/README.md" - }, - { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/LICENSE" - }, - { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/CHANGELOG.md" - }, - { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/parse.js" - }, - { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/enoent.js" - }, - { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/util/escape.js" - }, - { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/util/resolveCommand.js" - }, - { - "path": "node_modules/webpack-cli/node_modules/cross-spawn/lib/util/readShebang.js" - }, - { - "path": "node_modules/webpack-cli/node_modules/wrap-ansi/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/path-exists/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/yargs/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/yargs-parser/package.json" - }, - { - "path": "node_modules/webpack-cli/node_modules/memory-fs/package.json" - }, - { - "path": "node_modules/is-stream/package.json" - }, - { - "path": "node_modules/component-emitter/package.json" - }, - { - "path": "node_modules/es6-symbol/package.json" - }, - { - "path": "node_modules/parse-json/package.json" - }, - { - "path": "node_modules/xdg-basedir/package.json" - }, - { - "path": "node_modules/spdx-license-ids/package.json" - }, - { - "path": "node_modules/extend-shallow/package.json" - }, - { - "path": "node_modules/extend-shallow/node_modules/is-extendable/package.json" - }, - { - "path": "node_modules/browserify-cipher/package.json" - }, - { - "path": "node_modules/ssri/package.json" - }, - { - "path": "node_modules/google-auth-library/package.json" - }, - { - "path": "node_modules/webpack/package.json" - }, - { - "path": "node_modules/webpack/node_modules/is-buffer/package.json" - }, - { - "path": "node_modules/webpack/node_modules/fill-range/package.json" - }, - { - "path": "node_modules/webpack/node_modules/fill-range/node_modules/extend-shallow/package.json" - }, - { - "path": "node_modules/webpack/node_modules/is-number/package.json" - }, - { - "path": "node_modules/webpack/node_modules/is-number/node_modules/kind-of/package.json" - }, - { - "path": "node_modules/webpack/node_modules/eslint-scope/package.json" - }, - { - "path": "node_modules/webpack/node_modules/micromatch/index.js" - }, - { - "path": "node_modules/webpack/node_modules/micromatch/README.md" - }, - { - "path": "node_modules/webpack/node_modules/micromatch/package.json" - }, - { - "path": "node_modules/webpack/node_modules/micromatch/LICENSE" - }, - { - "path": "node_modules/webpack/node_modules/micromatch/CHANGELOG.md" - }, - { - "path": "node_modules/webpack/node_modules/micromatch/lib/parsers.js" - }, - { - "path": "node_modules/webpack/node_modules/micromatch/lib/.DS_Store" - }, - { - "path": "node_modules/webpack/node_modules/micromatch/lib/compilers.js" - }, - { - "path": "node_modules/webpack/node_modules/micromatch/lib/utils.js" - }, - { - "path": "node_modules/webpack/node_modules/micromatch/lib/cache.js" - }, - { - "path": "node_modules/webpack/node_modules/acorn/package.json" - }, - { - "path": "node_modules/webpack/node_modules/braces/package.json" - }, - { - "path": "node_modules/webpack/node_modules/braces/node_modules/extend-shallow/package.json" - }, - { - "path": "node_modules/webpack/node_modules/to-regex-range/package.json" - }, - { - "path": "node_modules/webpack/node_modules/memory-fs/package.json" - }, - { - "path": "node_modules/split-string/package.json" - }, - { - "path": "node_modules/brace-expansion/package.json" - }, - { - "path": "node_modules/posix-character-classes/package.json" - }, - { - "path": "node_modules/builtin-modules/package.json" - }, - { - "path": "node_modules/static-extend/package.json" - }, - { - "path": "node_modules/static-extend/node_modules/define-property/package.json" - }, - { - "path": "node_modules/process/package.json" - }, - { - "path": "node_modules/tslint/package.json" - }, - { - "path": "node_modules/tslint/node_modules/semver/package.json" - }, - { - "path": "node_modules/type-name/package.json" - }, - { - "path": "node_modules/define-properties/package.json" - }, - { - "path": "node_modules/universal-deep-strict-equal/package.json" - }, - { - "path": "node_modules/jws/package.json" - }, - { - "path": "node_modules/minipass/package.json" - }, - { - "path": "node_modules/minipass/node_modules/yallist/package.json" - }, - { - "path": "node_modules/nth-check/package.json" - }, - { - "path": "node_modules/@xtuc/ieee754/package.json" - }, - { - "path": "node_modules/@xtuc/long/package.json" - }, - { - "path": "node_modules/p-defer/package.json" - }, - { - "path": "node_modules/empower/package.json" - }, - { - "path": "node_modules/nanomatch/package.json" - }, - { - "path": "node_modules/send/package.json" - }, - { - "path": "node_modules/send/node_modules/debug/package.json" - }, - { - "path": "node_modules/send/node_modules/debug/node_modules/ms/package.json" - }, - { - "path": "node_modules/send/node_modules/ms/package.json" - }, - { - "path": "node_modules/send/node_modules/mime/package.json" - }, - { - "path": "node_modules/require-directory/package.json" - }, - { - "path": "node_modules/object.assign/package.json" - }, - { - "path": "node_modules/is-npm/package.json" - }, - { - "path": "node_modules/fs-minipass/package.json" - }, - { - "path": "node_modules/browserify-des/package.json" - }, - { - "path": "node_modules/min-indent/package.json" - }, - { - "path": "node_modules/functional-red-black-tree/package.json" - }, - { - "path": "node_modules/read-pkg/package.json" - }, - { - "path": "node_modules/fs-write-stream-atomic/package.json" - }, - { - "path": "node_modules/registry-url/package.json" - }, - { - "path": "node_modules/is-regex/package.json" - }, - { - "path": "node_modules/es-abstract/package.json" - }, - { - "path": "node_modules/querystring-es3/package.json" - }, - { - "path": "node_modules/parent-module/package.json" - }, - { - "path": "node_modules/create-ecdh/package.json" - }, - { - "path": "node_modules/map-age-cleaner/package.json" - }, - { - "path": "node_modules/hash.js/package.json" - }, - { - "path": "node_modules/signal-exit/package.json" - }, - { - "path": "node_modules/import-fresh/package.json" - }, - { - "path": "node_modules/hash-base/package.json" - }, - { - "path": "node_modules/keyv/package.json" - }, - { - "path": "node_modules/ret/package.json" - }, - { - "path": "node_modules/md5.js/package.json" - }, - { - "path": "node_modules/estraverse/package.json" - }, - { - "path": "node_modules/fast-deep-equal/package.json" - }, - { - "path": "node_modules/mute-stream/package.json" - }, - { - "path": "node_modules/power-assert-context-traversal/package.json" - }, - { - "path": "node_modules/rimraf/package.json" - }, - { - "path": "node_modules/is-installed-globally/package.json" - }, - { - "path": "node_modules/get-stdin/package.json" - }, - { - "path": "node_modules/make-dir/package.json" - }, - { - "path": "node_modules/make-dir/node_modules/semver/package.json" - }, - { - "path": "node_modules/es6-promise/package.json" - }, - { - "path": "node_modules/os-tmpdir/package.json" - }, - { - "path": "node_modules/run-queue/package.json" - }, - { - "path": "node_modules/anymatch/package.json" - }, - { - "path": "node_modules/anymatch/node_modules/is-buffer/package.json" - }, - { - "path": "node_modules/anymatch/node_modules/fill-range/package.json" - }, - { - "path": "node_modules/anymatch/node_modules/fill-range/node_modules/extend-shallow/package.json" - }, - { - "path": "node_modules/anymatch/node_modules/is-number/package.json" - }, - { - "path": "node_modules/anymatch/node_modules/is-number/node_modules/kind-of/package.json" - }, - { - "path": "node_modules/anymatch/node_modules/micromatch/index.js" - }, - { - "path": "node_modules/anymatch/node_modules/micromatch/README.md" - }, - { - "path": "node_modules/anymatch/node_modules/micromatch/package.json" - }, - { - "path": "node_modules/anymatch/node_modules/micromatch/LICENSE" - }, - { - "path": "node_modules/anymatch/node_modules/micromatch/CHANGELOG.md" - }, - { - "path": "node_modules/anymatch/node_modules/micromatch/lib/parsers.js" - }, - { - "path": "node_modules/anymatch/node_modules/micromatch/lib/.DS_Store" - }, - { - "path": "node_modules/anymatch/node_modules/micromatch/lib/compilers.js" - }, - { - "path": "node_modules/anymatch/node_modules/micromatch/lib/utils.js" - }, - { - "path": "node_modules/anymatch/node_modules/micromatch/lib/cache.js" - }, - { - "path": "node_modules/anymatch/node_modules/braces/package.json" - }, - { - "path": "node_modules/anymatch/node_modules/braces/node_modules/extend-shallow/package.json" - }, - { - "path": "node_modules/anymatch/node_modules/to-regex-range/package.json" - }, - { - "path": "node_modules/anymatch/node_modules/normalize-path/package.json" - }, - { - "path": "node_modules/retry-request/package.json" - }, - { - "path": "node_modules/retry-request/node_modules/debug/package.json" - }, - { - "path": "node_modules/cli-cursor/package.json" - }, - { - "path": "node_modules/ext/package.json" - }, - { - "path": "node_modules/ext/node_modules/type/package.json" - }, - { - "path": "node_modules/is-symbol/package.json" - }, - { - "path": "node_modules/css-what/package.json" - }, - { - "path": "node_modules/punycode/package.json" - }, - { - "path": "node_modules/os-locale/package.json" - }, - { - "path": "node_modules/os-locale/node_modules/path-key/package.json" - }, - { - "path": "node_modules/os-locale/node_modules/shebang-command/package.json" - }, - { - "path": "node_modules/os-locale/node_modules/execa/package.json" - }, - { - "path": "node_modules/os-locale/node_modules/get-stream/package.json" - }, - { - "path": "node_modules/os-locale/node_modules/is-stream/package.json" - }, - { - "path": "node_modules/os-locale/node_modules/which/package.json" - }, - { - "path": "node_modules/os-locale/node_modules/shebang-regex/package.json" - }, - { - "path": "node_modules/os-locale/node_modules/semver/package.json" - }, - { - "path": "node_modules/os-locale/node_modules/cross-spawn/index.js" - }, - { - "path": "node_modules/os-locale/node_modules/cross-spawn/README.md" - }, - { - "path": "node_modules/os-locale/node_modules/cross-spawn/package.json" - }, - { - "path": "node_modules/os-locale/node_modules/cross-spawn/LICENSE" - }, - { - "path": "node_modules/os-locale/node_modules/cross-spawn/CHANGELOG.md" - }, - { - "path": "node_modules/os-locale/node_modules/cross-spawn/lib/parse.js" - }, - { - "path": "node_modules/os-locale/node_modules/cross-spawn/lib/enoent.js" - }, - { - "path": "node_modules/os-locale/node_modules/cross-spawn/lib/util/escape.js" - }, - { - "path": "node_modules/os-locale/node_modules/cross-spawn/lib/util/resolveCommand.js" - }, - { - "path": "node_modules/os-locale/node_modules/cross-spawn/lib/util/readShebang.js" - }, - { - "path": "node_modules/setprototypeof/package.json" - }, - { - "path": "node_modules/mixin-deep/package.json" - }, - { - "path": "node_modules/mixin-deep/node_modules/is-extendable/package.json" - }, - { - "path": "node_modules/word-wrap/package.json" - }, - { - "path": "node_modules/foreground-child/package.json" - }, - { - "path": "node_modules/has-values/package.json" - }, - { - "path": "node_modules/has-values/node_modules/is-buffer/package.json" - }, - { - "path": "node_modules/has-values/node_modules/is-number/package.json" - }, - { - "path": "node_modules/has-values/node_modules/is-number/node_modules/kind-of/package.json" - }, - { - "path": "node_modules/has-values/node_modules/kind-of/package.json" - }, - { - "path": "node_modules/pumpify/package.json" - }, - { - "path": "node_modules/pumpify/node_modules/pump/package.json" - }, - { - "path": "node_modules/es6-map/package.json" - }, - { - "path": "node_modules/detect-file/package.json" - }, - { - "path": "node_modules/source-map-url/package.json" - }, - { - "path": "node_modules/call-signature/package.json" - }, - { - "path": "node_modules/package-json/package.json" - }, - { - "path": "node_modules/package-json/node_modules/semver/package.json" - }, - { - "path": "node_modules/css-select/package.json" - }, - { - "path": "node_modules/path-is-inside/package.json" - }, - { - "path": "node_modules/eslint-plugin-prettier/package.json" - }, - { - "path": "node_modules/p-finally/package.json" - }, - { - "path": "node_modules/inquirer/package.json" - }, - { - "path": "node_modules/inquirer/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/inquirer/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/acorn-jsx/package.json" - }, - { - "path": "node_modules/binary-extensions/package.json" - }, - { - "path": "node_modules/glob/package.json" - }, - { - "path": "node_modules/mocha/package.json" - }, - { - "path": "node_modules/mocha/node_modules/diff/package.json" - }, - { - "path": "node_modules/mocha/node_modules/color-name/package.json" - }, - { - "path": "node_modules/mocha/node_modules/emoji-regex/package.json" - }, - { - "path": "node_modules/mocha/node_modules/ms/package.json" - }, - { - "path": "node_modules/mocha/node_modules/string-width/package.json" - }, - { - "path": "node_modules/mocha/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/mocha/node_modules/cliui/package.json" - }, - { - "path": "node_modules/mocha/node_modules/p-locate/package.json" - }, - { - "path": "node_modules/mocha/node_modules/locate-path/package.json" - }, - { - "path": "node_modules/mocha/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/mocha/node_modules/has-flag/package.json" - }, - { - "path": "node_modules/mocha/node_modules/glob/package.json" - }, - { - "path": "node_modules/mocha/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/mocha/node_modules/which/package.json" - }, - { - "path": "node_modules/mocha/node_modules/supports-color/package.json" - }, - { - "path": "node_modules/mocha/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/mocha/node_modules/find-up/package.json" - }, - { - "path": "node_modules/mocha/node_modules/wrap-ansi/package.json" - }, - { - "path": "node_modules/mocha/node_modules/path-exists/package.json" - }, - { - "path": "node_modules/mocha/node_modules/yargs/package.json" - }, - { - "path": "node_modules/mocha/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/mocha/node_modules/strip-json-comments/package.json" - }, - { - "path": "node_modules/mocha/node_modules/yargs-parser/package.json" - }, - { - "path": "node_modules/loud-rejection/package.json" - }, - { - "path": "node_modules/event-emitter/package.json" - }, - { - "path": "node_modules/@protobufjs/codegen/package.json" - }, - { - "path": "node_modules/@protobufjs/base64/package.json" - }, - { - "path": "node_modules/@protobufjs/utf8/package.json" - }, - { - "path": "node_modules/@protobufjs/pool/package.json" - }, - { - "path": "node_modules/@protobufjs/float/package.json" - }, - { - "path": "node_modules/@protobufjs/fetch/package.json" - }, - { - "path": "node_modules/@protobufjs/path/package.json" - }, - { - "path": "node_modules/@protobufjs/aspromise/package.json" - }, - { - "path": "node_modules/@protobufjs/inquire/package.json" - }, - { - "path": "node_modules/@protobufjs/eventemitter/package.json" - }, - { - "path": "node_modules/prr/package.json" - }, - { - "path": "node_modules/node-forge/package.json" - }, - { - "path": "node_modules/lodash.has/package.json" - }, - { - "path": "node_modules/global-modules/package.json" - }, - { - "path": "node_modules/global-modules/node_modules/global-prefix/package.json" - }, - { - "path": "node_modules/global-modules/node_modules/which/package.json" - }, - { - "path": "node_modules/des.js/package.json" - }, - { - "path": "node_modules/source-map-support/package.json" - }, - { - "path": "node_modules/source-map-support/node_modules/source-map/package.json" - }, - { - "path": "node_modules/schema-utils/package.json" - }, - { - "path": "node_modules/object-assign/package.json" - }, - { - "path": "node_modules/has-symbols/package.json" - }, - { - "path": "node_modules/find-cache-dir/package.json" - }, - { - "path": "node_modules/find-cache-dir/node_modules/make-dir/package.json" - }, - { - "path": "node_modules/find-cache-dir/node_modules/pify/package.json" - }, - { - "path": "node_modules/find-cache-dir/node_modules/semver/package.json" - }, - { - "path": "node_modules/unique-slug/package.json" - }, - { - "path": "node_modules/espurify/package.json" - }, - { - "path": "node_modules/lodash.at/package.json" - }, - { - "path": "node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/merge-estraverse-visitors/package.json" - }, - { - "path": "node_modules/for-in/package.json" - }, - { - "path": "node_modules/to-object-path/package.json" - }, - { - "path": "node_modules/to-object-path/node_modules/is-buffer/package.json" - }, - { - "path": "node_modules/to-object-path/node_modules/kind-of/package.json" - }, - { - "path": "node_modules/ansi-colors/package.json" - }, - { - "path": "node_modules/brorand/package.json" - }, - { - "path": "node_modules/findup-sync/package.json" - }, - { - "path": "node_modules/findup-sync/node_modules/is-buffer/package.json" - }, - { - "path": "node_modules/findup-sync/node_modules/fill-range/package.json" - }, - { - "path": "node_modules/findup-sync/node_modules/fill-range/node_modules/extend-shallow/package.json" - }, - { - "path": "node_modules/findup-sync/node_modules/is-number/package.json" - }, - { - "path": "node_modules/findup-sync/node_modules/is-number/node_modules/kind-of/package.json" - }, - { - "path": "node_modules/findup-sync/node_modules/micromatch/index.js" - }, - { - "path": "node_modules/findup-sync/node_modules/micromatch/README.md" - }, - { - "path": "node_modules/findup-sync/node_modules/micromatch/package.json" - }, - { - "path": "node_modules/findup-sync/node_modules/micromatch/LICENSE" - }, - { - "path": "node_modules/findup-sync/node_modules/micromatch/CHANGELOG.md" - }, - { - "path": "node_modules/findup-sync/node_modules/micromatch/lib/parsers.js" - }, - { - "path": "node_modules/findup-sync/node_modules/micromatch/lib/.DS_Store" - }, - { - "path": "node_modules/findup-sync/node_modules/micromatch/lib/compilers.js" - }, - { - "path": "node_modules/findup-sync/node_modules/micromatch/lib/utils.js" - }, - { - "path": "node_modules/findup-sync/node_modules/micromatch/lib/cache.js" - }, - { - "path": "node_modules/findup-sync/node_modules/braces/package.json" - }, - { - "path": "node_modules/findup-sync/node_modules/braces/node_modules/extend-shallow/package.json" - }, - { - "path": "node_modules/findup-sync/node_modules/to-regex-range/package.json" - }, - { - "path": "node_modules/p-try/package.json" - }, - { - "path": "node_modules/escope/package.json" - }, - { - "path": "node_modules/evp_bytestokey/package.json" - }, - { - "path": "node_modules/json-parse-better-errors/package.json" - }, - { - "path": "node_modules/worker-farm/package.json" - }, - { - "path": "node_modules/ieee754/package.json" - }, - { - "path": "node_modules/chokidar/package.json" - }, - { - "path": "node_modules/chokidar/node_modules/is-buffer/package.json" - }, - { - "path": "node_modules/chokidar/node_modules/glob-parent/package.json" - }, - { - "path": "node_modules/chokidar/node_modules/glob-parent/node_modules/is-glob/package.json" - }, - { - "path": "node_modules/chokidar/node_modules/fill-range/package.json" - }, - { - "path": "node_modules/chokidar/node_modules/is-number/package.json" - }, - { - "path": "node_modules/chokidar/node_modules/kind-of/package.json" - }, - { - "path": "node_modules/chokidar/node_modules/extend-shallow/package.json" - }, - { - "path": "node_modules/chokidar/node_modules/braces/package.json" - }, - { - "path": "node_modules/chokidar/node_modules/to-regex-range/package.json" - }, - { - "path": "node_modules/readable-stream/package.json" - }, - { - "path": "node_modules/abort-controller/package.json" - }, - { - "path": "node_modules/which/package.json" - }, - { - "path": "node_modules/astral-regex/package.json" - }, - { - "path": "node_modules/escodegen/package.json" - }, - { - "path": "node_modules/escodegen/node_modules/esprima/package.json" - }, - { - "path": "node_modules/escodegen/node_modules/source-map/package.json" - }, - { - "path": "node_modules/minimist/package.json" - }, - { - "path": "node_modules/elliptic/package.json" - }, - { - "path": "node_modules/clone-response/package.json" - }, - { - "path": "node_modules/ecdsa-sig-formatter/package.json" - }, - { - "path": "node_modules/requizzle/package.json" - }, - { - "path": "node_modules/base64-js/package.json" - }, - { - "path": "node_modules/async-each/package.json" - }, - { - "path": "node_modules/pify/package.json" - }, - { - "path": "node_modules/object-keys/package.json" - }, - { - "path": "node_modules/trim-newlines/package.json" - }, - { - "path": "node_modules/deep-is/package.json" - }, - { - "path": "node_modules/fast-levenshtein/package.json" - }, - { - "path": "node_modules/urix/package.json" - }, - { - "path": "node_modules/typescript/package.json" - }, - { - "path": "node_modules/shebang-regex/package.json" - }, - { - "path": "node_modules/regex-not/package.json" - }, - { - "path": "node_modules/eslint-plugin-es/package.json" - }, - { - "path": "node_modules/eslint-plugin-es/node_modules/eslint-utils/package.json" - }, - { - "path": "node_modules/eslint-plugin-es/node_modules/regexpp/package.json" - }, - { - "path": "node_modules/util/package.json" - }, - { - "path": "node_modules/util/node_modules/inherits/package.json" - }, - { - "path": "node_modules/mem/package.json" - }, - { - "path": "node_modules/semver/package.json" - }, - { - "path": "node_modules/unique-string/package.json" - }, - { - "path": "node_modules/unique-filename/package.json" - }, - { - "path": "node_modules/decamelize/package.json" - }, - { - "path": "node_modules/node-libs-browser/package.json" - }, - { - "path": "node_modules/node-libs-browser/node_modules/punycode/package.json" - }, - { - "path": "node_modules/ajv-keywords/package.json" - }, - { - "path": "node_modules/is-descriptor/package.json" - }, - { - "path": "node_modules/is-descriptor/node_modules/kind-of/package.json" - }, - { - "path": "node_modules/arr-union/package.json" - }, - { - "path": "node_modules/acorn/package.json" - }, - { - "path": "node_modules/wide-align/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/string-width/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/wide-align/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/got/package.json" - }, - { - "path": "node_modules/got/node_modules/get-stream/package.json" - }, - { - "path": "node_modules/sprintf-js/package.json" - }, - { - "path": "node_modules/ts-loader/package.json" - }, - { - "path": "node_modules/ts-loader/node_modules/semver/package.json" - }, - { - "path": "node_modules/isarray/package.json" - }, - { - "path": "node_modules/string_decoder/package.json" - }, - { - "path": "node_modules/strip-eof/package.json" - }, - { - "path": "node_modules/p-limit/package.json" - }, - { - "path": "node_modules/url-parse-lax/package.json" - }, - { - "path": "node_modules/gts/package.json" - }, - { - "path": "node_modules/gts/node_modules/chalk/package.json" - }, - { - "path": "node_modules/commander/package.json" - }, - { - "path": "node_modules/mimic-fn/package.json" - }, - { - "path": "node_modules/https-proxy-agent/package.json" - }, - { - "path": "node_modules/ini/package.json" - }, - { - "path": "node_modules/js2xmlparser/package.json" - }, - { - "path": "node_modules/spdx-exceptions/package.json" - }, - { - "path": "node_modules/external-editor/package.json" - }, - { - "path": "node_modules/power-assert-formatter/package.json" - }, - { - "path": "node_modules/domain-browser/package.json" - }, - { - "path": "node_modules/eslint-utils/package.json" - }, - { - "path": "node_modules/buffer-xor/package.json" - }, - { - "path": "node_modules/text-table/package.json" - }, - { - "path": "node_modules/domutils/package.json" - }, - { - "path": "node_modules/supports-color/package.json" - }, - { - "path": "node_modules/strip-indent/package.json" - }, - { - "path": "node_modules/buffer/package.json" - }, - { - "path": "node_modules/fs.realpath/package.json" - }, - { - "path": "node_modules/parse5/package.json" - }, - { - "path": "node_modules/decamelize-keys/package.json" - }, - { - "path": "node_modules/decamelize-keys/node_modules/map-obj/package.json" - }, - { - "path": "node_modules/empower-core/package.json" - }, - { - "path": "node_modules/is-plain-object/package.json" - }, - { - "path": "node_modules/terser-webpack-plugin/package.json" - }, - { - "path": "node_modules/terser-webpack-plugin/node_modules/source-map/package.json" - }, - { - "path": "node_modules/acorn-es7-plugin/package.json" - }, - { - "path": "node_modules/iferr/package.json" - }, - { - "path": "node_modules/figgy-pudding/package.json" - }, - { - "path": "node_modules/webpack-sources/package.json" - }, - { - "path": "node_modules/webpack-sources/node_modules/source-map/package.json" - }, - { - "path": "node_modules/p-timeout/package.json" - }, - { - "path": "node_modules/upath/package.json" - }, - { - "path": "node_modules/neo-async/package.json" - }, - { - "path": "node_modules/espree/package.json" - }, - { - "path": "node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/responselike/package.json" - }, - { - "path": "node_modules/next-tick/package.json" - }, - { - "path": "node_modules/esrecurse/package.json" - }, - { - "path": "node_modules/stream-http/package.json" - }, - { - "path": "node_modules/promise-inflight/package.json" - }, - { - "path": "node_modules/bignumber.js/package.json" - }, - { - "path": "node_modules/source-map/package.json" - }, - { - "path": "node_modules/find-up/package.json" - }, - { - "path": "node_modules/traverse/package.json" - }, - { - "path": "node_modules/es-to-primitive/package.json" - }, - { - "path": "node_modules/rc/package.json" - }, - { - "path": "node_modules/rc/node_modules/minimist/package.json" - }, - { - "path": "node_modules/rc/node_modules/strip-json-comments/package.json" - }, - { - "path": "node_modules/safe-buffer/package.json" - }, - { - "path": "node_modules/uc.micro/package.json" - }, - { - "path": "node_modules/flat-cache/package.json" - }, - { - "path": "node_modules/flat-cache/node_modules/rimraf/package.json" - }, - { - "path": "node_modules/once/package.json" - }, - { - "path": "node_modules/gtoken/package.json" - }, - { - "path": "node_modules/convert-source-map/package.json" - }, - { - "path": "node_modules/is-date-object/package.json" - }, - { - "path": "node_modules/tslint-config-prettier/package.json" - }, - { - "path": "node_modules/import-local/package.json" - }, - { - "path": "node_modules/escape-string-regexp/package.json" - }, - { - "path": "node_modules/flush-write-stream/package.json" - }, - { - "path": "node_modules/braces/package.json" - }, - { - "path": "node_modules/iconv-lite/package.json" - }, - { - "path": "node_modules/json5/package.json" - }, - { - "path": "node_modules/json5/node_modules/minimist/package.json" - }, - { - "path": "node_modules/get-value/package.json" - }, - { - "path": "node_modules/is-glob/package.json" - }, - { - "path": "node_modules/furi/package.json" - }, - { - "path": "node_modules/tslib/package.json" - }, - { - "path": "node_modules/map-visit/package.json" - }, - { - "path": "node_modules/ripemd160/package.json" - }, - { - "path": "node_modules/watchpack/package.json" - }, - { - "path": "node_modules/stream-browserify/package.json" - }, - { - "path": "node_modules/markdown-it-anchor/package.json" - }, - { - "path": "node_modules/browser-stdout/package.json" - }, - { - "path": "node_modules/array-unique/package.json" - }, - { - "path": "node_modules/ajv-errors/package.json" - }, - { - "path": "node_modules/path-type/package.json" - }, - { - "path": "node_modules/to-regex-range/package.json" - }, - { - "path": "node_modules/randomfill/package.json" - }, - { - "path": "node_modules/npm-packlist/package.json" - }, - { - "path": "node_modules/copy-concurrently/package.json" - }, - { - "path": "node_modules/copy-concurrently/node_modules/rimraf/package.json" - }, - { - "path": "node_modules/loader-runner/package.json" - }, - { - "path": "node_modules/pump/package.json" - }, - { - "path": "node_modules/process-nextick-args/package.json" - }, - { - "path": "node_modules/deep-extend/package.json" - }, - { - "path": "node_modules/resolve-url/package.json" - }, - { - "path": "node_modules/power-assert-context-reducer-ast/package.json" - }, - { - "path": "node_modules/power-assert-context-reducer-ast/node_modules/acorn/package.json" - }, - { - "path": "node_modules/type-check/package.json" - }, - { - "path": "node_modules/jwa/package.json" - }, - { - "path": "node_modules/walkdir/package.json" - }, - { - "path": "node_modules/hard-rejection/package.json" - }, - { - "path": "node_modules/base/package.json" - }, - { - "path": "node_modules/base/node_modules/define-property/package.json" - }, - { - "path": "node_modules/base/node_modules/is-data-descriptor/package.json" - }, - { - "path": "node_modules/base/node_modules/is-accessor-descriptor/package.json" - }, - { - "path": "node_modules/base/node_modules/is-descriptor/package.json" - }, - { - "path": "node_modules/randombytes/package.json" - }, - { - "path": "node_modules/espower-source/package.json" - }, - { - "path": "node_modules/espower-source/node_modules/acorn/package.json" - }, - { - "path": "node_modules/cross-spawn/package.json" - }, - { - "path": "node_modules/@sindresorhus/is/package.json" - }, - { - "path": "node_modules/resolve-dir/package.json" - }, - { - "path": "node_modules/resolve-dir/node_modules/global-modules/package.json" - }, - { - "path": "node_modules/wrap-ansi/package.json" - }, - { - "path": "node_modules/quick-lru/package.json" - }, - { - "path": "node_modules/path-exists/package.json" - }, - { - "path": "node_modules/jsdoc/package.json" - }, - { - "path": "node_modules/jsdoc/node_modules/escape-string-regexp/package.json" - }, - { - "path": "node_modules/cacheable-request/package.json" - }, - { - "path": "node_modules/cacheable-request/node_modules/get-stream/package.json" - }, - { - "path": "node_modules/cacheable-request/node_modules/lowercase-keys/package.json" - }, - { - "path": "node_modules/escape-html/package.json" - }, - { - "path": "node_modules/power-assert-renderer-assertion/package.json" - }, - { - "path": "node_modules/minimist-options/package.json" - }, - { - "path": "node_modules/minimist-options/node_modules/arrify/package.json" - }, - { - "path": "node_modules/latest-version/package.json" - }, - { - "path": "node_modules/optionator/package.json" - }, - { - "path": "node_modules/parallel-transform/package.json" - }, - { - "path": "node_modules/slice-ansi/package.json" - }, - { - "path": "node_modules/slice-ansi/node_modules/color-name/package.json" - }, - { - "path": "node_modules/slice-ansi/node_modules/ansi-styles/package.json" - }, - { - "path": "node_modules/slice-ansi/node_modules/is-fullwidth-code-point/package.json" - }, - { - "path": "node_modules/slice-ansi/node_modules/color-convert/package.json" - }, - { - "path": "node_modules/power-assert-renderer-comparison/package.json" - }, - { - "path": "node_modules/flatted/package.json" - }, - { - "path": "node_modules/unset-value/package.json" - }, - { - "path": "node_modules/unset-value/node_modules/has-value/package.json" - }, - { - "path": "node_modules/unset-value/node_modules/has-value/node_modules/isobject/package.json" - }, - { - "path": "node_modules/unset-value/node_modules/has-values/package.json" - }, - { - "path": "node_modules/inherits/package.json" - }, - { - "path": "node_modules/depd/package.json" - }, - { - "path": "node_modules/es6-promisify/package.json" - }, - { - "path": "node_modules/long/package.json" - }, - { - "path": "node_modules/regexpp/package.json" - }, - { - "path": "node_modules/cli-width/package.json" - }, - { - "path": "node_modules/call-matcher/package.json" - }, - { - "path": "node_modules/resolve-cwd/package.json" - }, - { - "path": "node_modules/resolve-cwd/node_modules/resolve-from/package.json" - }, - { - "path": "node_modules/eslint/package.json" - }, - { - "path": "node_modules/eslint/node_modules/debug/package.json" - }, - { - "path": "node_modules/eslint/node_modules/ansi-regex/package.json" - }, - { - "path": "node_modules/eslint/node_modules/path-key/package.json" - }, - { - "path": "node_modules/eslint/node_modules/shebang-command/package.json" - }, - { - "path": "node_modules/eslint/node_modules/strip-ansi/package.json" - }, - { - "path": "node_modules/eslint/node_modules/which/package.json" - }, - { - "path": "node_modules/eslint/node_modules/shebang-regex/package.json" - }, - { - "path": "node_modules/eslint/node_modules/semver/package.json" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/index.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/README.md" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/package.json" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/LICENSE" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/CHANGELOG.md" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/parse.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/enoent.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/escape.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/resolveCommand.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/lib/util/readShebang.js" - }, - { - "path": "node_modules/eslint/node_modules/cross-spawn/node_modules/semver/package.json" - }, - { - "path": "node_modules/npm-bundled/package.json" - }, - { - "path": "node_modules/is-wsl/package.json" - }, - { - "path": "node_modules/mdurl/package.json" - }, - { - "path": "node_modules/typedarray/package.json" - }, - { - "path": "node_modules/v8-to-istanbul/package.json" - }, - { - "path": "node_modules/espower-loader/package.json" - }, - { - "path": "node_modules/object.getownpropertydescriptors/package.json" - }, - { - "path": "node_modules/cache-base/package.json" - }, - { - "path": "node_modules/array-find-index/package.json" - }, - { - "path": "node_modules/yargs/package.json" - }, - { - "path": "node_modules/ci-info/package.json" - }, - { - "path": "node_modules/miller-rabin/package.json" - }, - { - "path": "node_modules/color-convert/package.json" - }, - { - "path": "node_modules/use/package.json" - }, - { - "path": "node_modules/write-file-atomic/package.json" - }, - { - "path": "node_modules/to-arraybuffer/package.json" - }, - { - "path": "node_modules/extglob/package.json" - }, - { - "path": "node_modules/extglob/node_modules/define-property/package.json" - }, - { - "path": "node_modules/extglob/node_modules/is-data-descriptor/package.json" - }, - { - "path": "node_modules/extglob/node_modules/is-accessor-descriptor/package.json" - }, - { - "path": "node_modules/extglob/node_modules/extend-shallow/package.json" - }, - { - "path": "node_modules/extglob/node_modules/is-descriptor/package.json" - }, - { - "path": "node_modules/eslint-visitor-keys/package.json" - }, - { - "path": "node_modules/to-regex/package.json" - }, - { - "path": "node_modules/path-browserify/package.json" - }, - { - "path": "node_modules/agent-base/package.json" - }, - { - "path": "node_modules/repeat-string/package.json" - }, - { - "path": "node_modules/flat/package.json" - }, - { - "path": "node_modules/through2/package.json" - }, - { - "path": "node_modules/gaxios/package.json" - }, - { - "path": "node_modules/p-queue/package.json" - }, - { - "path": "node_modules/encodeurl/package.json" - }, - { - "path": "node_modules/normalize-path/package.json" - }, - { - "path": "node_modules/js-tokens/package.json" - }, - { - "path": "node_modules/strip-json-comments/package.json" - }, - { - "path": "node_modules/eslint-config-prettier/package.json" - }, - { - "path": "node_modules/uri-js/package.json" - }, - { - "path": "node_modules/test-exclude/package.json" - }, - { - "path": "node_modules/safer-buffer/package.json" - }, - { - "path": "node_modules/prettier/package.json" - }, - { - "path": "node_modules/regexp.prototype.flags/package.json" - }, - { - "path": "node_modules/yargs-parser/package.json" - }, - { - "path": "node_modules/copy-descriptor/package.json" - }, - { - "path": "node_modules/@babel/code-frame/package.json" - }, - { - "path": "node_modules/@babel/highlight/package.json" - }, - { - "path": "node_modules/@babel/parser/package.json" - }, - { - "path": "node_modules/configstore/package.json" - }, - { - "path": "node_modules/configstore/node_modules/make-dir/package.json" - }, - { - "path": "node_modules/configstore/node_modules/write-file-atomic/package.json" - }, - { - "path": "node_modules/is-plain-obj/package.json" - }, - { - "path": "node_modules/eastasianwidth/package.json" - }, - { - "path": "node_modules/memory-fs/package.json" - }, - { - "path": "node_modules/has-yarn/package.json" - }, - { - "path": "node_modules/core-js/package.json" - }, - { - "path": "samples/README.md" - }, - { - "path": "samples/.eslintrc" - }, - { - "path": "samples/package.json" - }, - { - "path": "samples/quickstart.js" - }, - { - "path": "samples/test/.eslintrc" - }, - { - "path": "samples/test/samples.test.js" - }, - { - "path": "__pycache__/synth.cpython-36.pyc" - } ] } \ No newline at end of file From 93f90ef75a2dc0c005e041ebdd9c047a0e30b51c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2020 13:27:25 -0800 Subject: [PATCH 068/253] chore: release 1.5.1 (#96) --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index e683b3b3d07..b71347378d3 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [1.5.1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.5.0...v1.5.1) (2020-01-09) + + +### Bug Fixes + +* proper routing headers ([4d1b1d3](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/4d1b1d31da7e5ca064ad2d26f0a1b1103251bdfa)) + ## [1.5.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.4.0...v1.5.0) (2020-01-02) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 6a5cc14c7d2..8262f919e7c 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.5.0", + "version": "1.5.1", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 047d7cb135d..054e2de5b93 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.5.0" + "@google-cloud/recaptcha-enterprise": "^1.5.1" }, "devDependencies": { "chai": "^4.2.0", From 73b06f48f7a565b62fb5f2a34a0ff9a3edf79d36 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 23 Jan 2020 17:21:39 -0800 Subject: [PATCH 069/253] chore: clear synth.metadata --- .../synth.metadata | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 packages/google-cloud-recaptchaenterprise/synth.metadata diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata deleted file mode 100644 index d98c859d7dd..00000000000 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ /dev/null @@ -1,31 +0,0 @@ -{ - "updateTime": "2020-01-09T12:22:42.967870Z", - "sources": [ - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6ace586805c08896fef43e28a261337fcf3f022b", - "internalRef": "288783603" - } - }, - { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "recaptchaenterprise", - "apiVersion": "v1beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" - } - } - ] -} \ No newline at end of file From 3c56be6f2cd270bfe3d6442d24990afa23d8a074 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 27 Jan 2020 16:18:24 -0800 Subject: [PATCH 070/253] chore: regenerate synth.metadata (#100) --- .../synth.metadata | 291 ++++++++++++++++++ 1 file changed, 291 insertions(+) create mode 100644 packages/google-cloud-recaptchaenterprise/synth.metadata diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata new file mode 100644 index 00000000000..0c1222243ac --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -0,0 +1,291 @@ +{ + "updateTime": "2020-01-24T12:29:08.578416Z", + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "e26cab8afd19d396b929039dac5d874cf0b5336c", + "internalRef": "291240093" + } + }, + { + "template": { + "name": "node_library", + "origin": "synthtool.gcp", + "version": "2019.10.17" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "recaptchaenterprise", + "apiVersion": "v1beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } + } + ], + "newFiles": [ + { + "path": ".eslintignore" + }, + { + "path": ".eslintrc.yml" + }, + { + "path": ".github/ISSUE_TEMPLATE/bug_report.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/feature_request.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/support_request.md" + }, + { + "path": ".github/PULL_REQUEST_TEMPLATE.md" + }, + { + "path": ".github/release-please.yml" + }, + { + "path": ".gitignore" + }, + { + "path": ".jsdoc.js" + }, + { + "path": ".kokoro/.gitattributes" + }, + { + "path": ".kokoro/common.cfg" + }, + { + "path": ".kokoro/continuous/node10/common.cfg" + }, + { + "path": ".kokoro/continuous/node10/docs.cfg" + }, + { + "path": ".kokoro/continuous/node10/lint.cfg" + }, + { + "path": ".kokoro/continuous/node10/samples-test.cfg" + }, + { + "path": ".kokoro/continuous/node10/system-test.cfg" + }, + { + "path": ".kokoro/continuous/node10/test.cfg" + }, + { + "path": ".kokoro/continuous/node12/common.cfg" + }, + { + "path": ".kokoro/continuous/node12/test.cfg" + }, + { + "path": ".kokoro/continuous/node6/common.cfg" + }, + { + "path": ".kokoro/continuous/node6/test.cfg" + }, + { + "path": ".kokoro/continuous/node8/common.cfg" + }, + { + "path": ".kokoro/continuous/node8/test.cfg" + }, + { + "path": ".kokoro/docs.sh" + }, + { + "path": ".kokoro/lint.sh" + }, + { + "path": ".kokoro/presubmit/node10/common.cfg" + }, + { + "path": ".kokoro/presubmit/node10/docs.cfg" + }, + { + "path": ".kokoro/presubmit/node10/lint.cfg" + }, + { + "path": ".kokoro/presubmit/node10/samples-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/system-test.cfg" + }, + { + "path": ".kokoro/presubmit/node10/test.cfg" + }, + { + "path": ".kokoro/presubmit/node12/common.cfg" + }, + { + "path": ".kokoro/presubmit/node12/test.cfg" + }, + { + "path": ".kokoro/presubmit/node6/common.cfg" + }, + { + "path": ".kokoro/presubmit/node6/test.cfg" + }, + { + "path": ".kokoro/presubmit/node8/common.cfg" + }, + { + "path": ".kokoro/presubmit/node8/test.cfg" + }, + { + "path": ".kokoro/presubmit/windows/common.cfg" + }, + { + "path": ".kokoro/presubmit/windows/test.cfg" + }, + { + "path": ".kokoro/publish.sh" + }, + { + "path": ".kokoro/release/common.cfg" + }, + { + "path": ".kokoro/release/docs.cfg" + }, + { + "path": ".kokoro/release/docs.sh" + }, + { + "path": ".kokoro/release/publish.cfg" + }, + { + "path": ".kokoro/samples-test.sh" + }, + { + "path": ".kokoro/system-test.sh" + }, + { + "path": ".kokoro/test.bat" + }, + { + "path": ".kokoro/test.sh" + }, + { + "path": ".kokoro/trampoline.sh" + }, + { + "path": ".nycrc" + }, + { + "path": ".prettierignore" + }, + { + "path": ".prettierrc" + }, + { + "path": ".repo-metadata.json" + }, + { + "path": "CHANGELOG.md" + }, + { + "path": "CODE_OF_CONDUCT.md" + }, + { + "path": "CONTRIBUTING.md" + }, + { + "path": "LICENSE" + }, + { + "path": "README.md" + }, + { + "path": "codecov.yaml" + }, + { + "path": "linkinator.config.json" + }, + { + "path": "package.json" + }, + { + "path": "protos/google/cloud/common_resources.proto" + }, + { + "path": "protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto" + }, + { + "path": "protos/protos.d.ts" + }, + { + "path": "protos/protos.js" + }, + { + "path": "protos/protos.json" + }, + { + "path": "renovate.json" + }, + { + "path": "samples/.eslintrc" + }, + { + "path": "samples/README.md" + }, + { + "path": "samples/package.json" + }, + { + "path": "samples/quickstart.js" + }, + { + "path": "samples/test/.eslintrc" + }, + { + "path": "samples/test/samples.test.js" + }, + { + "path": "src/index.ts" + }, + { + "path": "src/v1beta1/index.ts" + }, + { + "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts" + }, + { + "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json" + }, + { + "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_proto_list.json" + }, + { + "path": "synth.py" + }, + { + "path": "system-test/fixtures/sample/src/index.js" + }, + { + "path": "system-test/fixtures/sample/src/index.ts" + }, + { + "path": "system-test/install.ts" + }, + { + "path": "test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts" + }, + { + "path": "tsconfig.json" + }, + { + "path": "tslint.json" + }, + { + "path": "webpack.config.js" + } + ] +} \ No newline at end of file From 67b1412c3ead2c7cae7cc6017e355889dbad1b56 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 28 Jan 2020 14:29:21 -0800 Subject: [PATCH 071/253] fix: enum, bytes, and Long types now accept strings --- .../protos/protos.d.ts | 60 +++++++++---------- .../synth.metadata | 10 +++- 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index ac3530b36d7..a65b651c1f0 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -300,7 +300,7 @@ export namespace google { name?: (string|null); /** AnnotateAssessmentRequest annotation */ - annotation?: (google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation|null); + annotation?: (google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation|keyof typeof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation|null); } /** Represents an AnnotateAssessmentRequest. */ @@ -316,7 +316,7 @@ export namespace google { public name: string; /** AnnotateAssessmentRequest annotation. */ - public annotation: google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation; + public annotation: (google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation|keyof typeof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation); /** * Creates a new AnnotateAssessmentRequest instance using the specified properties. @@ -731,7 +731,7 @@ export namespace google { valid?: (boolean|null); /** TokenProperties invalidReason */ - invalidReason?: (google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason|null); + invalidReason?: (google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason|keyof typeof google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason|null); /** TokenProperties createTime */ createTime?: (google.protobuf.ITimestamp|null); @@ -756,7 +756,7 @@ export namespace google { public valid: boolean; /** TokenProperties invalidReason. */ - public invalidReason: google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason; + public invalidReason: (google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason|keyof typeof google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason); /** TokenProperties createTime. */ public createTime?: (google.protobuf.ITimestamp|null); @@ -1552,10 +1552,10 @@ export namespace google { allowAmpTraffic?: (boolean|null); /** WebKeySettings integrationType */ - integrationType?: (google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType|null); + integrationType?: (google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType|keyof typeof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType|null); /** WebKeySettings challengeSecurityPreference */ - challengeSecurityPreference?: (google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference|null); + challengeSecurityPreference?: (google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference|keyof typeof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference|null); } /** Represents a WebKeySettings. */ @@ -1577,10 +1577,10 @@ export namespace google { public allowAmpTraffic: boolean; /** WebKeySettings integrationType. */ - public integrationType: google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType; + public integrationType: (google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType|keyof typeof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType); /** WebKeySettings challengeSecurityPreference. */ - public challengeSecurityPreference: google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference; + public challengeSecurityPreference: (google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference|keyof typeof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference); /** * Creates a new WebKeySettings instance using the specified properties. @@ -2220,7 +2220,7 @@ export namespace google { nameField?: (string|null); /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|null); + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); /** ResourceDescriptor plural */ plural?: (string|null); @@ -2248,7 +2248,7 @@ export namespace google { public nameField: string; /** ResourceDescriptor history. */ - public history: google.api.ResourceDescriptor.History; + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); /** ResourceDescriptor plural. */ public plural: string; @@ -3128,10 +3128,10 @@ export namespace google { number?: (number|null); /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|null); + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|null); + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); /** FieldDescriptorProto typeName */ typeName?: (string|null); @@ -3168,10 +3168,10 @@ export namespace google { public number: number; /** FieldDescriptorProto label. */ - public label: google.protobuf.FieldDescriptorProto.Label; + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); /** FieldDescriptorProto type. */ - public type: google.protobuf.FieldDescriptorProto.Type; + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); /** FieldDescriptorProto typeName. */ public typeName: string; @@ -3946,7 +3946,7 @@ export namespace google { javaStringCheckUtf8?: (boolean|null); /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null); + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); /** FileOptions goPackage */ goPackage?: (string|null); @@ -4022,7 +4022,7 @@ export namespace google { public javaStringCheckUtf8: boolean; /** FileOptions optimizeFor. */ - public optimizeFor: google.protobuf.FileOptions.OptimizeMode; + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); /** FileOptions goPackage. */ public goPackage: string; @@ -4271,13 +4271,13 @@ export namespace google { interface IFieldOptions { /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|null); + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); /** FieldOptions packed */ packed?: (boolean|null); /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|null); + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); /** FieldOptions lazy */ lazy?: (boolean|null); @@ -4308,13 +4308,13 @@ export namespace google { constructor(properties?: google.protobuf.IFieldOptions); /** FieldOptions ctype. */ - public ctype: google.protobuf.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; + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); /** FieldOptions lazy. */ public lazy: boolean; @@ -4813,7 +4813,7 @@ export namespace google { deprecated?: (boolean|null); /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|null); + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); /** MethodOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -4838,7 +4838,7 @@ export namespace google { public deprecated: boolean; /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: google.protobuf.MethodOptions.IdempotencyLevel; + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); /** MethodOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -4934,16 +4934,16 @@ export namespace google { identifierValue?: (string|null); /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|null); + positiveIntValue?: (number|Long|string|null); /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|null); + negativeIntValue?: (number|Long|string|null); /** UninterpretedOption doubleValue */ doubleValue?: (number|null); /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|null); + stringValue?: (Uint8Array|string|null); /** UninterpretedOption aggregateValue */ aggregateValue?: (string|null); @@ -4965,16 +4965,16 @@ export namespace google { public identifierValue: string; /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long); + public positiveIntValue: (number|Long|string); /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long); + public negativeIntValue: (number|Long|string); /** UninterpretedOption doubleValue. */ public doubleValue: number; /** UninterpretedOption stringValue. */ - public stringValue: Uint8Array; + public stringValue: (Uint8Array|string); /** UninterpretedOption aggregateValue. */ public aggregateValue: string; @@ -5735,7 +5735,7 @@ export namespace google { interface ITimestamp { /** Timestamp seconds */ - seconds?: (number|Long|null); + seconds?: (number|Long|string|null); /** Timestamp nanos */ nanos?: (number|null); @@ -5751,7 +5751,7 @@ export namespace google { constructor(properties?: google.protobuf.ITimestamp); /** Timestamp seconds. */ - public seconds: (number|Long); + public seconds: (number|Long|string); /** Timestamp nanos. */ public nanos: number; diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 0c1222243ac..2c01b8e477e 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,12 +1,13 @@ { - "updateTime": "2020-01-24T12:29:08.578416Z", + "updateTime": "2020-01-28T12:29:51.947454Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e26cab8afd19d396b929039dac5d874cf0b5336c", - "internalRef": "291240093" + "sha": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea", + "internalRef": "291821782", + "log": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\n" } }, { @@ -263,6 +264,9 @@ { "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_proto_list.json" }, + { + "path": "synth.metadata" + }, { "path": "synth.py" }, From 2f6aa0a482f31a000dd1176f624b5f0913d29b9d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2020 21:02:11 -0800 Subject: [PATCH 072/253] chore: release 1.5.2 (#102) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index b71347378d3..5ae474c14b9 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [1.5.2](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.5.1...v1.5.2) (2020-01-28) + + +### Bug Fixes + +* enum, bytes, and Long types now accept strings ([394cfd8](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/394cfd824a655245d1430afd68682b51e99b90d3)) + ### [1.5.1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.5.0...v1.5.1) (2020-01-09) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 8262f919e7c..8bfe0ba88de 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.5.1", + "version": "1.5.2", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 054e2de5b93..91be832a11a 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.5.1" + "@google-cloud/recaptcha-enterprise": "^1.5.2" }, "devDependencies": { "chai": "^4.2.0", From 60fb09e826a63723d3979d3a12fd112f62be7728 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 30 Jan 2020 16:34:19 +0100 Subject: [PATCH 073/253] chore(deps): update dependency @types/mocha to v7 --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 8bfe0ba88de..66860efd2f8 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -28,7 +28,7 @@ "google-gax": "^1.9.0" }, "devDependencies": { - "@types/mocha": "^5.2.5", + "@types/mocha": "^7.0.0", "@types/node": "^12.0.0", "c8": "^7.0.0", "eslint": "^6.0.0", From 33988072c0dc11bc6f6c4064ad004d4f2cff3023 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 31 Jan 2020 17:22:48 -0800 Subject: [PATCH 074/253] chore: skip img.shields.io in docs test --- .../google-cloud-recaptchaenterprise/linkinator.config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/linkinator.config.json b/packages/google-cloud-recaptchaenterprise/linkinator.config.json index d780d6bfff5..b555215ca02 100644 --- a/packages/google-cloud-recaptchaenterprise/linkinator.config.json +++ b/packages/google-cloud-recaptchaenterprise/linkinator.config.json @@ -2,6 +2,7 @@ "recurse": true, "skip": [ "https://codecov.io/gh/googleapis/", - "www.googleapis.com" + "www.googleapis.com", + "img.shields.io" ] } From 1c459b215740e0592fde44ca02c18bad50cbdbc5 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 31 Jan 2020 18:49:50 -0800 Subject: [PATCH 075/253] test: modernize mocha config (#105) --- packages/google-cloud-recaptchaenterprise/.mocharc.json | 5 +++++ packages/google-cloud-recaptchaenterprise/package.json | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/.mocharc.json diff --git a/packages/google-cloud-recaptchaenterprise/.mocharc.json b/packages/google-cloud-recaptchaenterprise/.mocharc.json new file mode 100644 index 00000000000..670c5e2c24b --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 66860efd2f8..dcbea951e6e 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -36,7 +36,6 @@ "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", "gts": "^1.0.0", - "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", @@ -44,7 +43,6 @@ "mocha": "^7.0.0", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", - "power-assert": "^1.4.4", "prettier": "^1.17.1", "ts-loader": "^6.2.1", "typescript": "^3.7.0", From 827ae88103de5054d1822ad592181d8b7ebb0e53 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 7 Feb 2020 10:30:05 -0800 Subject: [PATCH 076/253] fix: pass x-goog-request-params header for streaming calls --- .../.gitignore | 5 +- ...tcha_enterprise_service_v1_beta1_client.ts | 58 ++-- .../synth.metadata | 273 +----------------- ...cha_enterprise_service_v1_beta1-v1beta1.ts | 16 +- 4 files changed, 55 insertions(+), 297 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.gitignore b/packages/google-cloud-recaptchaenterprise/.gitignore index b1b074b5cd2..5d32b23782f 100644 --- a/packages/google-cloud-recaptchaenterprise/.gitignore +++ b/packages/google-cloud-recaptchaenterprise/.gitignore @@ -1,13 +1,14 @@ **/*.log **/node_modules .coverage +coverage .nyc_output docs/ +out/ build/ system-test/secrets.js system-test/*key.json *.lock -**/package-lock.json .DS_Store -__pycache__ package-lock.json +__pycache__ diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 1a281534ba3..f63b0288545 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -144,13 +144,13 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), assessmentPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/assessments/{assessment}' ), keyPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/keys/{key}' ), + projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), }; // Some of the methods on this service return "paged" results, @@ -901,9 +901,17 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { */ listKeysStream( request?: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - options?: gax.CallOptions | {} + 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); return this._descriptors.page.listKeys.createStream( this._innerApiCalls.listKeys as gax.GaxCall, @@ -915,29 +923,6 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // -- Path templates -- // -------------------- - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project: string) { - return this._pathTemplates.projectPathTemplate.render({ - project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; - } - /** * Return a fully-qualified assessment resource name string. * @@ -1012,6 +997,29 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { return this._pathTemplates.keyPathTemplate.match(keyName).key; } + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this._pathTemplates.projectPathTemplate.render({ + project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this._pathTemplates.projectPathTemplate.match(projectName).project; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 2c01b8e477e..8ded9ed843e 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,20 +1,20 @@ { - "updateTime": "2020-01-28T12:29:51.947454Z", + "updateTime": "2020-02-07T12:31:52.295987Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea", - "internalRef": "291821782", - "log": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\n" + "sha": "e46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585", + "internalRef": "293710856", + "log": "e46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585\nGenerate the Bazel build file for recommendengine public api\n\nPiperOrigin-RevId: 293710856\n\n68477017c4173c98addac0373950c6aa9d7b375f\nMake `language_code` optional for UpdateIntentRequest and BatchUpdateIntentsRequest.\n\nThe comments and proto annotations describe this parameter as optional.\n\nPiperOrigin-RevId: 293703548\n\n16f823f578bca4e845a19b88bb9bc5870ea71ab2\nAdd BUILD.bazel files for managedidentities API\n\nPiperOrigin-RevId: 293698246\n\n2f53fd8178c9a9de4ad10fae8dd17a7ba36133f2\nAdd v1p1beta1 config file\n\nPiperOrigin-RevId: 293696729\n\n052b274138fce2be80f97b6dcb83ab343c7c8812\nAdd source field for user event and add field behavior annotations\n\nPiperOrigin-RevId: 293693115\n\n1e89732b2d69151b1b3418fff3d4cc0434f0dded\ndatacatalog: v1beta1 add three new RPCs to gapic v1beta1 config\n\nPiperOrigin-RevId: 293692823\n\n9c8bd09bbdc7c4160a44f1fbab279b73cd7a2337\nchange the name of AccessApproval service to AccessApprovalAdmin\n\nPiperOrigin-RevId: 293690934\n\n2e23b8fbc45f5d9e200572ca662fe1271bcd6760\nAdd ListEntryGroups method, add http bindings to support entry group tagging, and update some comments.\n\nPiperOrigin-RevId: 293666452\n\n0275e38a4ca03a13d3f47a9613aac8c8b0d3f1f2\nAdd proto_package field to managedidentities API. It is needed for APIs that still depend on artman generation.\n\nPiperOrigin-RevId: 293643323\n\n4cdfe8278cb6f308106580d70648001c9146e759\nRegenerating public protos for Data Catalog to add new Custom Type Entry feature.\n\nPiperOrigin-RevId: 293614782\n\n45d2a569ab526a1fad3720f95eefb1c7330eaada\nEnable client generation for v1 ManagedIdentities API.\n\nPiperOrigin-RevId: 293515675\n\n2c17086b77e6f3bcf04a1f65758dfb0c3da1568f\nAdd the Actions on Google common types (//google/actions/type/*).\n\nPiperOrigin-RevId: 293478245\n\n781aadb932e64a12fb6ead7cd842698d99588433\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293443396\n\ne2602608c9138c2fca24162720e67f9307c30b95\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293442964\n\nc8aef82028d06b7992278fa9294c18570dc86c3d\nAdd cc_proto_library and cc_grpc_library targets for Bigtable protos.\n\nAlso fix indentation of cc_grpc_library targets in Spanner and IAM protos.\n\nPiperOrigin-RevId: 293440538\n\ne2faab04f4cb7f9755072330866689b1943a16e9\ncloudtasks: v2 replace non-standard retry params in gapic config v2\n\nPiperOrigin-RevId: 293424055\n\ndfb4097ea628a8470292c6590a4313aee0c675bd\nerrorreporting: v1beta1 add legacy artman config for php\n\nPiperOrigin-RevId: 293423790\n\nb18aed55b45bfe5b62476292c72759e6c3e573c6\nasset: v1p1beta1 updated comment for `page_size` limit.\n\nPiperOrigin-RevId: 293421386\n\nc9ef36b7956d9859a2fc86ad35fcaa16958ab44f\nbazel: Refactor CI build scripts\n\nPiperOrigin-RevId: 293387911\n\na8ed9d921fdddc61d8467bfd7c1668f0ad90435c\nfix: set Ruby module name for OrgPolicy\n\nPiperOrigin-RevId: 293257997\n\n6c7d28509bd8315de8af0889688ee20099594269\nredis: v1beta1 add UpgradeInstance and connect_mode field to Instance\n\nPiperOrigin-RevId: 293242878\n\nae0abed4fcb4c21f5cb67a82349a049524c4ef68\nredis: v1 add connect_mode field to Instance\n\nPiperOrigin-RevId: 293241914\n\n3f7a0d29b28ee9365771da2b66edf7fa2b4e9c56\nAdds service config definition for bigqueryreservation v1beta1\n\nPiperOrigin-RevId: 293234418\n\n0c88168d5ed6fe353a8cf8cbdc6bf084f6bb66a5\naddition of BUILD & configuration for accessapproval v1\n\nPiperOrigin-RevId: 293219198\n\n39bedc2e30f4778ce81193f6ba1fec56107bcfc4\naccessapproval: v1 publish protos\n\nPiperOrigin-RevId: 293167048\n\n69d9945330a5721cd679f17331a78850e2618226\nAdd file-level `Session` resource definition\n\nPiperOrigin-RevId: 293080182\n\nf6a1a6b417f39694275ca286110bc3c1ca4db0dc\nAdd file-level `Session` resource definition\n\nPiperOrigin-RevId: 293080178\n\n29d40b78e3dc1579b0b209463fbcb76e5767f72a\nExpose managedidentities/v1beta1/ API for client library usage.\n\nPiperOrigin-RevId: 292979741\n\na22129a1fb6e18056d576dfb7717aef74b63734a\nExpose managedidentities/v1/ API for client library usage.\n\nPiperOrigin-RevId: 292968186\n\nb5cbe4a4ba64ab19e6627573ff52057a1657773d\nSecurityCenter v1p1beta1: move file-level option on top to workaround protobuf.js bug.\n\nPiperOrigin-RevId: 292647187\n\nb224b317bf20c6a4fbc5030b4a969c3147f27ad3\nAdds API definitions for bigqueryreservation v1beta1.\n\nPiperOrigin-RevId: 292634722\n\nc1468702f9b17e20dd59007c0804a089b83197d2\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 292626173\n\nffdfa4f55ab2f0afc11d0eb68f125ccbd5e404bd\nvision: v1p3beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292605599\n\n78f61482cd028fc1d9892aa5d89d768666a954cd\nvision: v1p1beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292605125\n\n60bb5a294a604fd1778c7ec87b265d13a7106171\nvision: v1p2beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292604980\n\n3bcf7aa79d45eb9ec29ab9036e9359ea325a7fc3\nvision: v1p4beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292604656\n\n2717b8a1c762b26911b45ecc2e4ee01d98401b28\nFix dataproc artman client library generation.\n\nPiperOrigin-RevId: 292555664\n\n7ac66d9be8a7d7de4f13566d8663978c9ee9dcd7\nAdd Dataproc Autoscaling API to V1.\n\nPiperOrigin-RevId: 292450564\n\n5d932b2c1be3a6ef487d094e3cf5c0673d0241dd\n- Improve documentation\n- Add a client_id field to StreamingPullRequest\n\nPiperOrigin-RevId: 292434036\n\neaff9fa8edec3e914995ce832b087039c5417ea7\nmonitoring: v3 publish annotations and client retry config\n\nPiperOrigin-RevId: 292425288\n\n70958bab8c5353870d31a23fb2c40305b050d3fe\nBigQuery Storage Read API v1 clients.\n\nPiperOrigin-RevId: 292407644\n\n7a15e7fe78ff4b6d5c9606a3264559e5bde341d1\nUpdate backend proto for Google Cloud Endpoints\n\nPiperOrigin-RevId: 292391607\n\n3ca2c014e24eb5111c8e7248b1e1eb833977c83d\nbazel: Add --flaky_test_attempts=3 argument to prevent CI failures caused by flaky tests\n\nPiperOrigin-RevId: 292382559\n\n9933347c1f677e81e19a844c2ef95bfceaf694fe\nbazel:Integrate latest protoc-java-resource-names-plugin changes (fix for PyYAML dependency in bazel rules)\n\nPiperOrigin-RevId: 292376626\n\nb835ab9d2f62c88561392aa26074c0b849fb0bd3\nasset: v1p2beta1 add client config annotations\n\n* remove unintentionally exposed RPCs\n* remove messages relevant to removed RPCs\n\nPiperOrigin-RevId: 292369593\n\nc1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\ncf3b61102ed5f36b827bc82ec39be09525f018c8\n Fix to protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 292034635\n\n4e1cfaa7c0fede9e65d64213ca3da1b1255816c0\nUpdate the public proto to support UTF-8 encoded id for CatalogService API, increase the ListCatalogItems deadline to 300s and some minor documentation change\n\nPiperOrigin-RevId: 292030970\n\n9c483584f8fd5a1b862ae07973f4cc7bb3e46648\nasset: add annotations to v1p1beta1\n\nPiperOrigin-RevId: 292009868\n\ne19209fac29731d0baf6d9ac23da1164f7bdca24\nAdd the google.rpc.context.AttributeContext message to the open source\ndirectories.\n\nPiperOrigin-RevId: 291999930\n\nae5662960573f279502bf98a108a35ba1175e782\noslogin API: move file level option on top of the file to avoid protobuf.js bug.\n\nPiperOrigin-RevId: 291990506\n\neba3897fff7c49ed85d3c47fc96fe96e47f6f684\nAdd cc_proto_library and cc_grpc_library targets for Spanner and IAM protos.\n\nPiperOrigin-RevId: 291988651\n\n" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.10.17" + "version": "2020.2.4" } } ], @@ -28,268 +28,5 @@ "generator": "gapic-generator-typescript" } } - ], - "newFiles": [ - { - "path": ".eslintignore" - }, - { - "path": ".eslintrc.yml" - }, - { - "path": ".github/ISSUE_TEMPLATE/bug_report.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/feature_request.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/support_request.md" - }, - { - "path": ".github/PULL_REQUEST_TEMPLATE.md" - }, - { - "path": ".github/release-please.yml" - }, - { - "path": ".gitignore" - }, - { - "path": ".jsdoc.js" - }, - { - "path": ".kokoro/.gitattributes" - }, - { - "path": ".kokoro/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/docs.cfg" - }, - { - "path": ".kokoro/continuous/node10/lint.cfg" - }, - { - "path": ".kokoro/continuous/node10/samples-test.cfg" - }, - { - "path": ".kokoro/continuous/node10/system-test.cfg" - }, - { - "path": ".kokoro/continuous/node10/test.cfg" - }, - { - "path": ".kokoro/continuous/node12/common.cfg" - }, - { - "path": ".kokoro/continuous/node12/test.cfg" - }, - { - "path": ".kokoro/continuous/node6/common.cfg" - }, - { - "path": ".kokoro/continuous/node6/test.cfg" - }, - { - "path": ".kokoro/continuous/node8/common.cfg" - }, - { - "path": ".kokoro/continuous/node8/test.cfg" - }, - { - "path": ".kokoro/docs.sh" - }, - { - "path": ".kokoro/lint.sh" - }, - { - "path": ".kokoro/presubmit/node10/common.cfg" - }, - { - "path": ".kokoro/presubmit/node10/docs.cfg" - }, - { - "path": ".kokoro/presubmit/node10/lint.cfg" - }, - { - "path": ".kokoro/presubmit/node10/samples-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/system-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/test.cfg" - }, - { - "path": ".kokoro/presubmit/node12/common.cfg" - }, - { - "path": ".kokoro/presubmit/node12/test.cfg" - }, - { - "path": ".kokoro/presubmit/node6/common.cfg" - }, - { - "path": ".kokoro/presubmit/node6/test.cfg" - }, - { - "path": ".kokoro/presubmit/node8/common.cfg" - }, - { - "path": ".kokoro/presubmit/node8/test.cfg" - }, - { - "path": ".kokoro/presubmit/windows/common.cfg" - }, - { - "path": ".kokoro/presubmit/windows/test.cfg" - }, - { - "path": ".kokoro/publish.sh" - }, - { - "path": ".kokoro/release/common.cfg" - }, - { - "path": ".kokoro/release/docs.cfg" - }, - { - "path": ".kokoro/release/docs.sh" - }, - { - "path": ".kokoro/release/publish.cfg" - }, - { - "path": ".kokoro/samples-test.sh" - }, - { - "path": ".kokoro/system-test.sh" - }, - { - "path": ".kokoro/test.bat" - }, - { - "path": ".kokoro/test.sh" - }, - { - "path": ".kokoro/trampoline.sh" - }, - { - "path": ".nycrc" - }, - { - "path": ".prettierignore" - }, - { - "path": ".prettierrc" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "CODE_OF_CONDUCT.md" - }, - { - "path": "CONTRIBUTING.md" - }, - { - "path": "LICENSE" - }, - { - "path": "README.md" - }, - { - "path": "codecov.yaml" - }, - { - "path": "linkinator.config.json" - }, - { - "path": "package.json" - }, - { - "path": "protos/google/cloud/common_resources.proto" - }, - { - "path": "protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto" - }, - { - "path": "protos/protos.d.ts" - }, - { - "path": "protos/protos.js" - }, - { - "path": "protos/protos.json" - }, - { - "path": "renovate.json" - }, - { - "path": "samples/.eslintrc" - }, - { - "path": "samples/README.md" - }, - { - "path": "samples/package.json" - }, - { - "path": "samples/quickstart.js" - }, - { - "path": "samples/test/.eslintrc" - }, - { - "path": "samples/test/samples.test.js" - }, - { - "path": "src/index.ts" - }, - { - "path": "src/v1beta1/index.ts" - }, - { - "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts" - }, - { - "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json" - }, - { - "path": "src/v1beta1/recaptcha_enterprise_service_v1_beta1_proto_list.json" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "system-test/fixtures/sample/src/index.js" - }, - { - "path": "system-test/fixtures/sample/src/index.ts" - }, - { - "path": "system-test/install.ts" - }, - { - "path": "test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts" - }, - { - "path": "tsconfig.json" - }, - { - "path": "tslint.json" - }, - { - "path": "webpack.config.js" - } ] } \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts index 3e7d352f4af..8bdb923c4e6 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts @@ -99,6 +99,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -123,6 +124,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -149,6 +151,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -173,6 +176,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -199,6 +203,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -223,6 +228,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -249,6 +255,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -273,6 +280,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -349,6 +357,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -373,6 +382,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest = {}; + request.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -399,6 +409,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest = {}; + request.parent = ''; // Mock response const expectedResponse = {}; // Mock Grpc layer @@ -427,8 +438,9 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest = {}; + request.parent = ''; // Mock response - const expectedResponse = {}; + const expectedResponse = {response: 'data'}; // Mock Grpc layer client._innerApiCalls.listKeys = ( actualRequest: {}, @@ -447,7 +459,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { .on('error', (err: FakeError) => { done(err); }); - stream.write(request); + stream.write(expectedResponse); }); }); }); From 2b86ed85475c70ebf4385f48920e18941e87f5f7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 10 Feb 2020 18:05:00 +0100 Subject: [PATCH 077/253] chore(deps): update dependency linkinator to v2 --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index dcbea951e6e..e612c5ad75b 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -39,7 +39,7 @@ "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", - "linkinator": "^1.5.0", + "linkinator": "^2.0.0", "mocha": "^7.0.0", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", From 725754425fd85b189516c6ebab2c2827a9319d1b Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 11 Feb 2020 22:35:29 -0800 Subject: [PATCH 078/253] build: add GitHub actions config for unit tests * build: add GitHub actions config for unit tests * chore: link root directory before linting * chore: also need to npm i --- packages/google-cloud-recaptchaenterprise/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index e612c5ad75b..acf84f5c78c 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -61,7 +61,8 @@ "compile": "tsc -p . && cp -r protos build/", "compile-protos": "compileProtos src", "predocs-test": "npm run docs", - "prepare": "npm run compile" + "prepare": "npm run compile", + "prelint": "cd samples; npm link ../; npm i" }, "license": "Apache-2.0", "engines": { From fcd66553aa7a0a523df6f7de0c19f43350f5c5db Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2020 11:17:11 -0800 Subject: [PATCH 079/253] chore: release 1.5.3 (#112) --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 5ae474c14b9..46dcd53529f 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [1.5.3](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.5.2...v1.5.3) (2020-02-12) + + +### Bug Fixes + +* pass x-goog-request-params header for streaming calls ([983411e](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/983411e0a115c6be6fe9ac0001d333bfef5e81a8)) + ### [1.5.2](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.5.1...v1.5.2) (2020-01-28) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index acf84f5c78c..f9e1096d563 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.5.2", + "version": "1.5.3", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 91be832a11a..d04fd9101bf 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.5.2" + "@google-cloud/recaptcha-enterprise": "^1.5.3" }, "devDependencies": { "chai": "^4.2.0", From 6cbe3bf6f1c999cec7a9dde5dff1c4ff3a98a841 Mon Sep 17 00:00:00 2001 From: Xiaozhen Liu Date: Wed, 26 Feb 2020 15:43:39 -0800 Subject: [PATCH 080/253] feat: export protos in src/index.ts --- packages/google-cloud-recaptchaenterprise/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-recaptchaenterprise/src/index.ts b/packages/google-cloud-recaptchaenterprise/src/index.ts index 6ef81cfdc58..2370fbef0ec 100644 --- a/packages/google-cloud-recaptchaenterprise/src/index.ts +++ b/packages/google-cloud-recaptchaenterprise/src/index.ts @@ -23,3 +23,5 @@ export {v1beta1, RecaptchaEnterpriseServiceV1Beta1Client}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v1beta1, RecaptchaEnterpriseServiceV1Beta1Client}; +import * as protos from '../protos/protos'; +export {protos}; From c91926aebddea8eb7e262ca2ca3776794b829cb8 Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Thu, 27 Feb 2020 11:54:33 -0800 Subject: [PATCH 081/253] chore: update jsdoc.js (#121) --- packages/google-cloud-recaptchaenterprise/.jsdoc.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.jsdoc.js b/packages/google-cloud-recaptchaenterprise/.jsdoc.js index 04290c7f2d3..578c65257f2 100644 --- a/packages/google-cloud-recaptchaenterprise/.jsdoc.js +++ b/packages/google-cloud-recaptchaenterprise/.jsdoc.js @@ -36,11 +36,14 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2018 Google, LLC.', + copyright: 'Copyright 2019 Google, LLC.', includeDate: false, sourceFiles: false, systemName: '@google-cloud/recaptcha-enterprise', - theme: 'lumen' + theme: 'lumen', + default: { + "outputSourceFiles": false + } }, markdown: { idInHeadings: true From bede8813f685a74dd10531c75fd86a4dc53c27f3 Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Thu, 27 Feb 2020 21:42:43 -0800 Subject: [PATCH 082/253] chore: correct .jsdoc.js protos and double quotes (#123) --- packages/google-cloud-recaptchaenterprise/.jsdoc.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.jsdoc.js b/packages/google-cloud-recaptchaenterprise/.jsdoc.js index 578c65257f2..73d992cbd60 100644 --- a/packages/google-cloud-recaptchaenterprise/.jsdoc.js +++ b/packages/google-cloud-recaptchaenterprise/.jsdoc.js @@ -31,7 +31,8 @@ module.exports = { source: { excludePattern: '(^|\\/|\\\\)[._]', include: [ - 'build/src' + 'build/src', + 'protos' ], includePattern: '\\.js$' }, @@ -42,7 +43,7 @@ module.exports = { systemName: '@google-cloud/recaptcha-enterprise', theme: 'lumen', default: { - "outputSourceFiles": false + outputSourceFiles: false } }, markdown: { From 3c9c3fb41036a77277f2679728de38e05a25d633 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 5 Mar 2020 07:58:01 -0800 Subject: [PATCH 083/253] chore: update samples test and .jsdoc.js (#127) * [CHANGE ME] Re-generated to pick up changes in the API or client library generator. * test: update sample test to pass Co-authored-by: Alexander Fenster --- packages/google-cloud-recaptchaenterprise/.jsdoc.js | 3 +++ packages/google-cloud-recaptchaenterprise/synth.metadata | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.jsdoc.js b/packages/google-cloud-recaptchaenterprise/.jsdoc.js index 73d992cbd60..177f672ce12 100644 --- a/packages/google-cloud-recaptchaenterprise/.jsdoc.js +++ b/packages/google-cloud-recaptchaenterprise/.jsdoc.js @@ -12,6 +12,9 @@ // 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-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 8ded9ed843e..562ec8b831d 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,13 +1,13 @@ { - "updateTime": "2020-02-07T12:31:52.295987Z", + "updateTime": "2020-03-01T12:36:45.013657Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585", - "internalRef": "293710856", - "log": "e46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585\nGenerate the Bazel build file for recommendengine public api\n\nPiperOrigin-RevId: 293710856\n\n68477017c4173c98addac0373950c6aa9d7b375f\nMake `language_code` optional for UpdateIntentRequest and BatchUpdateIntentsRequest.\n\nThe comments and proto annotations describe this parameter as optional.\n\nPiperOrigin-RevId: 293703548\n\n16f823f578bca4e845a19b88bb9bc5870ea71ab2\nAdd BUILD.bazel files for managedidentities API\n\nPiperOrigin-RevId: 293698246\n\n2f53fd8178c9a9de4ad10fae8dd17a7ba36133f2\nAdd v1p1beta1 config file\n\nPiperOrigin-RevId: 293696729\n\n052b274138fce2be80f97b6dcb83ab343c7c8812\nAdd source field for user event and add field behavior annotations\n\nPiperOrigin-RevId: 293693115\n\n1e89732b2d69151b1b3418fff3d4cc0434f0dded\ndatacatalog: v1beta1 add three new RPCs to gapic v1beta1 config\n\nPiperOrigin-RevId: 293692823\n\n9c8bd09bbdc7c4160a44f1fbab279b73cd7a2337\nchange the name of AccessApproval service to AccessApprovalAdmin\n\nPiperOrigin-RevId: 293690934\n\n2e23b8fbc45f5d9e200572ca662fe1271bcd6760\nAdd ListEntryGroups method, add http bindings to support entry group tagging, and update some comments.\n\nPiperOrigin-RevId: 293666452\n\n0275e38a4ca03a13d3f47a9613aac8c8b0d3f1f2\nAdd proto_package field to managedidentities API. It is needed for APIs that still depend on artman generation.\n\nPiperOrigin-RevId: 293643323\n\n4cdfe8278cb6f308106580d70648001c9146e759\nRegenerating public protos for Data Catalog to add new Custom Type Entry feature.\n\nPiperOrigin-RevId: 293614782\n\n45d2a569ab526a1fad3720f95eefb1c7330eaada\nEnable client generation for v1 ManagedIdentities API.\n\nPiperOrigin-RevId: 293515675\n\n2c17086b77e6f3bcf04a1f65758dfb0c3da1568f\nAdd the Actions on Google common types (//google/actions/type/*).\n\nPiperOrigin-RevId: 293478245\n\n781aadb932e64a12fb6ead7cd842698d99588433\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293443396\n\ne2602608c9138c2fca24162720e67f9307c30b95\nDialogflow weekly v2/v2beta1 library update:\n- Documentation updates\nImportant updates are also posted at\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 293442964\n\nc8aef82028d06b7992278fa9294c18570dc86c3d\nAdd cc_proto_library and cc_grpc_library targets for Bigtable protos.\n\nAlso fix indentation of cc_grpc_library targets in Spanner and IAM protos.\n\nPiperOrigin-RevId: 293440538\n\ne2faab04f4cb7f9755072330866689b1943a16e9\ncloudtasks: v2 replace non-standard retry params in gapic config v2\n\nPiperOrigin-RevId: 293424055\n\ndfb4097ea628a8470292c6590a4313aee0c675bd\nerrorreporting: v1beta1 add legacy artman config for php\n\nPiperOrigin-RevId: 293423790\n\nb18aed55b45bfe5b62476292c72759e6c3e573c6\nasset: v1p1beta1 updated comment for `page_size` limit.\n\nPiperOrigin-RevId: 293421386\n\nc9ef36b7956d9859a2fc86ad35fcaa16958ab44f\nbazel: Refactor CI build scripts\n\nPiperOrigin-RevId: 293387911\n\na8ed9d921fdddc61d8467bfd7c1668f0ad90435c\nfix: set Ruby module name for OrgPolicy\n\nPiperOrigin-RevId: 293257997\n\n6c7d28509bd8315de8af0889688ee20099594269\nredis: v1beta1 add UpgradeInstance and connect_mode field to Instance\n\nPiperOrigin-RevId: 293242878\n\nae0abed4fcb4c21f5cb67a82349a049524c4ef68\nredis: v1 add connect_mode field to Instance\n\nPiperOrigin-RevId: 293241914\n\n3f7a0d29b28ee9365771da2b66edf7fa2b4e9c56\nAdds service config definition for bigqueryreservation v1beta1\n\nPiperOrigin-RevId: 293234418\n\n0c88168d5ed6fe353a8cf8cbdc6bf084f6bb66a5\naddition of BUILD & configuration for accessapproval v1\n\nPiperOrigin-RevId: 293219198\n\n39bedc2e30f4778ce81193f6ba1fec56107bcfc4\naccessapproval: v1 publish protos\n\nPiperOrigin-RevId: 293167048\n\n69d9945330a5721cd679f17331a78850e2618226\nAdd file-level `Session` resource definition\n\nPiperOrigin-RevId: 293080182\n\nf6a1a6b417f39694275ca286110bc3c1ca4db0dc\nAdd file-level `Session` resource definition\n\nPiperOrigin-RevId: 293080178\n\n29d40b78e3dc1579b0b209463fbcb76e5767f72a\nExpose managedidentities/v1beta1/ API for client library usage.\n\nPiperOrigin-RevId: 292979741\n\na22129a1fb6e18056d576dfb7717aef74b63734a\nExpose managedidentities/v1/ API for client library usage.\n\nPiperOrigin-RevId: 292968186\n\nb5cbe4a4ba64ab19e6627573ff52057a1657773d\nSecurityCenter v1p1beta1: move file-level option on top to workaround protobuf.js bug.\n\nPiperOrigin-RevId: 292647187\n\nb224b317bf20c6a4fbc5030b4a969c3147f27ad3\nAdds API definitions for bigqueryreservation v1beta1.\n\nPiperOrigin-RevId: 292634722\n\nc1468702f9b17e20dd59007c0804a089b83197d2\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 292626173\n\nffdfa4f55ab2f0afc11d0eb68f125ccbd5e404bd\nvision: v1p3beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292605599\n\n78f61482cd028fc1d9892aa5d89d768666a954cd\nvision: v1p1beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292605125\n\n60bb5a294a604fd1778c7ec87b265d13a7106171\nvision: v1p2beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292604980\n\n3bcf7aa79d45eb9ec29ab9036e9359ea325a7fc3\nvision: v1p4beta1 publish annotations and retry config\n\nPiperOrigin-RevId: 292604656\n\n2717b8a1c762b26911b45ecc2e4ee01d98401b28\nFix dataproc artman client library generation.\n\nPiperOrigin-RevId: 292555664\n\n7ac66d9be8a7d7de4f13566d8663978c9ee9dcd7\nAdd Dataproc Autoscaling API to V1.\n\nPiperOrigin-RevId: 292450564\n\n5d932b2c1be3a6ef487d094e3cf5c0673d0241dd\n- Improve documentation\n- Add a client_id field to StreamingPullRequest\n\nPiperOrigin-RevId: 292434036\n\neaff9fa8edec3e914995ce832b087039c5417ea7\nmonitoring: v3 publish annotations and client retry config\n\nPiperOrigin-RevId: 292425288\n\n70958bab8c5353870d31a23fb2c40305b050d3fe\nBigQuery Storage Read API v1 clients.\n\nPiperOrigin-RevId: 292407644\n\n7a15e7fe78ff4b6d5c9606a3264559e5bde341d1\nUpdate backend proto for Google Cloud Endpoints\n\nPiperOrigin-RevId: 292391607\n\n3ca2c014e24eb5111c8e7248b1e1eb833977c83d\nbazel: Add --flaky_test_attempts=3 argument to prevent CI failures caused by flaky tests\n\nPiperOrigin-RevId: 292382559\n\n9933347c1f677e81e19a844c2ef95bfceaf694fe\nbazel:Integrate latest protoc-java-resource-names-plugin changes (fix for PyYAML dependency in bazel rules)\n\nPiperOrigin-RevId: 292376626\n\nb835ab9d2f62c88561392aa26074c0b849fb0bd3\nasset: v1p2beta1 add client config annotations\n\n* remove unintentionally exposed RPCs\n* remove messages relevant to removed RPCs\n\nPiperOrigin-RevId: 292369593\n\nc1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\ncf3b61102ed5f36b827bc82ec39be09525f018c8\n Fix to protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 292034635\n\n4e1cfaa7c0fede9e65d64213ca3da1b1255816c0\nUpdate the public proto to support UTF-8 encoded id for CatalogService API, increase the ListCatalogItems deadline to 300s and some minor documentation change\n\nPiperOrigin-RevId: 292030970\n\n9c483584f8fd5a1b862ae07973f4cc7bb3e46648\nasset: add annotations to v1p1beta1\n\nPiperOrigin-RevId: 292009868\n\ne19209fac29731d0baf6d9ac23da1164f7bdca24\nAdd the google.rpc.context.AttributeContext message to the open source\ndirectories.\n\nPiperOrigin-RevId: 291999930\n\nae5662960573f279502bf98a108a35ba1175e782\noslogin API: move file level option on top of the file to avoid protobuf.js bug.\n\nPiperOrigin-RevId: 291990506\n\neba3897fff7c49ed85d3c47fc96fe96e47f6f684\nAdd cc_proto_library and cc_grpc_library targets for Spanner and IAM protos.\n\nPiperOrigin-RevId: 291988651\n\n" + "sha": "83c6f84035ee0f80eaa44d8b688a010461cc4080", + "internalRef": "297918498", + "log": "83c6f84035ee0f80eaa44d8b688a010461cc4080\nUpdate google/api/auth.proto to make AuthProvider to have JwtLocation\n\nPiperOrigin-RevId: 297918498\n\ne9e90a787703ec5d388902e2cb796aaed3a385b4\nDialogflow weekly v2/v2beta1 library update:\n - adding get validation result\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297671458\n\n1a2b05cc3541a5f7714529c665aecc3ea042c646\nAdding .yaml and .json config files.\n\nPiperOrigin-RevId: 297570622\n\ndfe1cf7be44dee31d78f78e485d8c95430981d6e\nPublish `QueryOptions` proto.\n\nIntroduced a `query_options` input in `ExecuteSqlRequest`.\n\nPiperOrigin-RevId: 297497710\n\ndafc905f71e5d46f500b41ed715aad585be062c3\npubsub: revert pull init_rpc_timeout & max_rpc_timeout back to 25 seconds and reset multiplier to 1.0\n\nPiperOrigin-RevId: 297486523\n\nf077632ba7fee588922d9e8717ee272039be126d\nfirestore: add update_transform\n\nPiperOrigin-RevId: 297405063\n\n0aba1900ffef672ec5f0da677cf590ee5686e13b\ncluster: use square brace for cross-reference\n\nPiperOrigin-RevId: 297204568\n\n5dac2da18f6325cbaed54603c43f0667ecd50247\nRestore retry params in gapic config because securitycenter has non-standard default retry params.\nRestore a few retry codes for some idempotent methods.\n\nPiperOrigin-RevId: 297196720\n\n1eb61455530252bba8b2c8d4bc9832960e5a56f6\npubsub: v1 replace IAM HTTP rules\n\nPiperOrigin-RevId: 297188590\n\n80b2d25f8d43d9d47024ff06ead7f7166548a7ba\nDialogflow weekly v2/v2beta1 library update:\n - updates to mega agent api\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297187629\n\n0b1876b35e98f560f9c9ca9797955f020238a092\nUse an older version of protoc-docs-plugin that is compatible with the specified gapic-generator and protobuf versions.\n\nprotoc-docs-plugin >=0.4.0 (see commit https://github.com/googleapis/protoc-docs-plugin/commit/979f03ede6678c487337f3d7e88bae58df5207af) is incompatible with protobuf 3.9.1.\n\nPiperOrigin-RevId: 296986742\n\n1e47e676cddbbd8d93f19ba0665af15b5532417e\nFix: Restore a method signature for UpdateCluster\n\nPiperOrigin-RevId: 296901854\n\n7f910bcc4fc4704947ccfd3ceed015d16b9e00c2\nUpdate Dataproc v1beta2 client.\n\nPiperOrigin-RevId: 296451205\n\nde287524405a3dce124d301634731584fc0432d7\nFix: Reinstate method signatures that had been missed off some RPCs\nFix: Correct resource types for two fields\n\nPiperOrigin-RevId: 296435091\n\ne5bc9566ae057fb4c92f8b7e047f1c8958235b53\nDeprecate the endpoint_uris field, as it is unused.\n\nPiperOrigin-RevId: 296357191\n\n8c12e2b4dca94e12bff9f538bdac29524ff7ef7a\nUpdate Dataproc v1 client.\n\nPiperOrigin-RevId: 296336662\n\n17567c4a1ef0a9b50faa87024d66f8acbb561089\nRemoving erroneous comment, a la https://github.com/googleapis/java-speech/pull/103\n\nPiperOrigin-RevId: 296332968\n\n3eaaaf8626ce5b0c0bc7eee05e143beffa373b01\nAdd BUILD.bazel for v1 secretmanager.googleapis.com\n\nPiperOrigin-RevId: 296274723\n\ne76149c3d992337f85eeb45643106aacae7ede82\nMove securitycenter v1 to use generate from annotations.\n\nPiperOrigin-RevId: 296266862\n\n203740c78ac69ee07c3bf6be7408048751f618f8\nAdd StackdriverLoggingConfig field to Cloud Tasks v2 API.\n\nPiperOrigin-RevId: 296256388\n\ne4117d5e9ed8bbca28da4a60a94947ca51cb2083\nCreate a Bazel BUILD file for the google.actions.type export.\n\nPiperOrigin-RevId: 296212567\n\na9639a0a9854fd6e1be08bba1ac3897f4f16cb2f\nAdd secretmanager.googleapis.com v1 protos\n\nPiperOrigin-RevId: 295983266\n\nce4f4c21d9dd2bfab18873a80449b9d9851efde8\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295861722\n\ncb61d6c2d070b589980c779b68ffca617f789116\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295855449\n\nab2685d8d3a0e191dc8aef83df36773c07cb3d06\nfix: Dataproc v1 - AutoscalingPolicy annotation\n\nThis adds the second resource name pattern to the\nAutoscalingPolicy resource.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 295738415\n\n8a1020bf6828f6e3c84c3014f2c51cb62b739140\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295286165\n\n5cfa105206e77670369e4b2225597386aba32985\nAdd service control related proto build rule.\n\nPiperOrigin-RevId: 295262088\n\nee4dddf805072004ab19ac94df2ce669046eec26\nmonitoring v3: Add prefix \"https://cloud.google.com/\" into the link for global access\ncl 295167522, get ride of synth.py hacks\n\nPiperOrigin-RevId: 295238095\n\nd9835e922ea79eed8497db270d2f9f85099a519c\nUpdate some minor docs changes about user event proto\n\nPiperOrigin-RevId: 295185610\n\n5f311e416e69c170243de722023b22f3df89ec1c\nfix: use correct PHP package name in gapic configuration\n\nPiperOrigin-RevId: 295161330\n\n6cdd74dcdb071694da6a6b5a206e3a320b62dd11\npubsub: v1 add client config annotations and retry config\n\nPiperOrigin-RevId: 295158776\n\n5169f46d9f792e2934d9fa25c36d0515b4fd0024\nAdded cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295026522\n\n56b55aa8818cd0a532a7d779f6ef337ba809ccbd\nFix: Resource annotations for CreateTimeSeriesRequest and ListTimeSeriesRequest should refer to valid resources. TimeSeries is not a named resource.\n\nPiperOrigin-RevId: 294931650\n\n0646bc775203077226c2c34d3e4d50cc4ec53660\nRemove unnecessary languages from bigquery-related artman configuration files.\n\nPiperOrigin-RevId: 294809380\n\n8b78aa04382e3d4147112ad6d344666771bb1909\nUpdate backend.proto for schemes and protocol\n\nPiperOrigin-RevId: 294788800\n\n80b8f8b3de2359831295e24e5238641a38d8488f\nAdds artman config files for bigquerystorage endpoints v1beta2, v1alpha2, v1\n\nPiperOrigin-RevId: 294763931\n\n2c17ac33b226194041155bb5340c3f34733f1b3a\nAdd parameter to sample generated for UpdateInstance. Related to https://github.com/googleapis/python-redis/issues/4\n\nPiperOrigin-RevId: 294734008\n\nd5e8a8953f2acdfe96fb15e85eb2f33739623957\nMove bigquery datatransfer to gapic v2.\n\nPiperOrigin-RevId: 294703703\n\nefd36705972cfcd7d00ab4c6dfa1135bafacd4ae\nfix: Add two annotations that we missed.\n\nPiperOrigin-RevId: 294664231\n\n8a36b928873ff9c05b43859b9d4ea14cd205df57\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1beta2).\n\nPiperOrigin-RevId: 294459768\n\nc7a3caa2c40c49f034a3c11079dd90eb24987047\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1).\n\nPiperOrigin-RevId: 294456889\n\n5006247aa157e59118833658084345ee59af7c09\nFix: Make deprecated fields optional\nFix: Deprecate SetLoggingServiceRequest.zone in line with the comments\nFeature: Add resource name method signatures where appropriate\n\nPiperOrigin-RevId: 294383128\n\neabba40dac05c5cbe0fca3a35761b17e372036c4\nFix: C# and PHP package/namespace capitalization for BigQuery Storage v1.\n\nPiperOrigin-RevId: 294382444\n\nf8d9a858a7a55eba8009a23aa3f5cc5fe5e88dde\nfix: artman configuration file for bigtable-admin\n\nPiperOrigin-RevId: 294322616\n\n0f29555d1cfcf96add5c0b16b089235afbe9b1a9\nAPI definition for (not-yet-launched) GCS gRPC.\n\nPiperOrigin-RevId: 294321472\n\nfcc86bee0e84dc11e9abbff8d7c3529c0626f390\nfix: Bigtable Admin v2\n\nChange LRO metadata from PartialUpdateInstanceMetadata\nto UpdateInstanceMetadata. (Otherwise, it will not build.)\n\nPiperOrigin-RevId: 294264582\n\n6d9361eae2ebb3f42d8c7ce5baf4bab966fee7c0\nrefactor: Add annotations to Bigtable Admin v2.\n\nPiperOrigin-RevId: 294243406\n\nad7616f3fc8e123451c8b3a7987bc91cea9e6913\nFix: Resource type in CreateLogMetricRequest should use logging.googleapis.com.\nFix: ListLogEntries should have a method signature for convenience of calling it.\n\nPiperOrigin-RevId: 294222165\n\n63796fcbb08712676069e20a3e455c9f7aa21026\nFix: Remove extraneous resource definition for cloudkms.googleapis.com/CryptoKey.\n\nPiperOrigin-RevId: 294176658\n\ne7d8a694f4559201e6913f6610069cb08b39274e\nDepend on the latest gapic-generator and resource names plugin.\n\nThis fixes the very old an very annoying bug: https://github.com/googleapis/gapic-generator/pull/3087\n\nPiperOrigin-RevId: 293903652\n\n806b2854a966d55374ee26bb0cef4e30eda17b58\nfix: correct capitalization of Ruby namespaces in SecurityCenter V1p1beta1\n\nPiperOrigin-RevId: 293903613\n\n1b83c92462b14d67a7644e2980f723112472e03a\nPublish annotations and grpc service config for Logging API.\n\nPiperOrigin-RevId: 293893514\n\n" } }, { From 5a1d8dd98f11da4d2d553ade4173f35e8861d9e8 Mon Sep 17 00:00:00 2001 From: "gcf-merge-on-green[bot]" <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2020 16:04:05 +0000 Subject: [PATCH 084/253] chore: release 1.6.0 (#118) :robot: I have created a release \*beep\* \*boop\* --- ## [1.6.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.5.3...v1.6.0) (2020-03-05) ### Features * export protos in src/index.ts ([ffd77ca](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/ffd77caffcec5d341517e7b82e58d1c50288ea22)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 46dcd53529f..341d3718b6c 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [1.6.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.5.3...v1.6.0) (2020-03-05) + + +### Features + +* export protos in src/index.ts ([ffd77ca](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/ffd77caffcec5d341517e7b82e58d1c50288ea22)) + ### [1.5.3](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.5.2...v1.5.3) (2020-02-12) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index f9e1096d563..8508e7fbda2 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.5.3", + "version": "1.6.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index d04fd9101bf..a6ff0686ce7 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.5.3" + "@google-cloud/recaptcha-enterprise": "^1.6.0" }, "devDependencies": { "chai": "^4.2.0", From db85e5725f77f72c49e103d8891e8f51214833c4 Mon Sep 17 00:00:00 2001 From: "gcf-merge-on-green[bot]" <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2020 00:22:18 +0000 Subject: [PATCH 085/253] feat: deferred client initialization (#128) This PR includes changes from https://github.com/googleapis/gapic-generator-typescript/pull/317 that will move the asynchronous initialization and authentication from the client constructor to an `initialize()` method. This method will be automatically called when the first RPC call is performed. The client library usage has not changed, there is no need to update any code. If you want to make sure the client is authenticated _before_ the first RPC call, you can do ```js await client.initialize(); ``` manually before calling any client method. --- ...tcha_enterprise_service_v1_beta1_client.ts | 83 ++++++++++++++----- .../synth.metadata | 8 +- ...cha_enterprise_service_v1_beta1-v1beta1.ts | 48 +++++++++++ 3 files changed, 112 insertions(+), 27 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index f63b0288545..b8c39a5f513 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -44,8 +44,13 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; 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; - recaptchaEnterpriseServiceV1Beta1Stub: Promise<{[name: string]: Function}>; + recaptchaEnterpriseServiceV1Beta1Stub?: Promise<{[name: string]: Function}>; /** * Construct an instance of RecaptchaEnterpriseServiceV1Beta1Client. @@ -69,8 +74,6 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * 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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ @@ -101,26 +104,29 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // 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. - const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + 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 RecaptchaEnterpriseServiceV1Beta1Client).scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); + 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 = gaxGrpc.auth as gax.GoogleAuth; + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { - clientHeader.push(`gl-web/${gaxModule.version}`); + clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -136,7 +142,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 'protos', 'protos.json' ); - const protos = gaxGrpc.loadProto( + this._protos = this._gaxGrpc.loadProto( opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); @@ -144,20 +150,22 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - assessmentPathTemplate: new gaxModule.PathTemplate( + assessmentPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/assessments/{assessment}' ), - keyPathTemplate: new gaxModule.PathTemplate( + keyPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/keys/{key}' ), - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), }; // 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 = { - listKeys: new gaxModule.PageDescriptor( + listKeys: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'keys' @@ -165,7 +173,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { }; // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( + this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1', gapicConfig as gax.ClientConfig, opts.clientConfig || {}, @@ -176,18 +184,36 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // 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.recaptchaEnterpriseServiceV1Beta1Stub) { + return this.recaptchaEnterpriseServiceV1Beta1Stub; + } // Put together the "service stub" for // google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1. - this.recaptchaEnterpriseServiceV1Beta1Stub = gaxGrpc.createStub( - opts.fallback - ? (protos as protobuf.Root).lookupService( + this.recaptchaEnterpriseServiceV1Beta1Stub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1' ) : // tslint:disable-next-line no-any - (protos as any).google.cloud.recaptchaenterprise.v1beta1 + (this._protos as any).google.cloud.recaptchaenterprise.v1beta1 .RecaptchaEnterpriseServiceV1Beta1, - opts + this._opts ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides @@ -215,9 +241,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { } ); - const apiCall = gaxModule.createApiCall( + const apiCall = this._gaxModule.createApiCall( innerCallPromise, - defaults[methodName], + this._defaults[methodName], this._descriptors.page[methodName] || this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] @@ -231,6 +257,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { return apiCall(argument, callOptions, callback); }; } + + return this.recaptchaEnterpriseServiceV1Beta1Stub; } /** @@ -364,6 +392,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createAssessment(request, options, callback); } annotateAssessment( @@ -448,6 +477,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.annotateAssessment(request, options, callback); } createKey( @@ -531,6 +561,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createKey(request, options, callback); } getKey( @@ -612,6 +643,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getKey(request, options, callback); } updateKey( @@ -695,6 +727,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ] = gax.routingHeader.fromParams({ 'key.name': request.key!.name || '', }); + this.initialize(); return this._innerApiCalls.updateKey(request, options, callback); } deleteKey( @@ -776,6 +809,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.deleteKey(request, options, callback); } @@ -867,6 +901,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listKeys(request, options, callback); } @@ -913,6 +948,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); + this.initialize(); return this._descriptors.page.listKeys.createStream( this._innerApiCalls.listKeys as gax.GaxCall, request, @@ -1026,8 +1062,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * The client will no longer be usable and all future behavior is undefined. */ close(): Promise { + this.initialize(); if (!this._terminated) { - return this.recaptchaEnterpriseServiceV1Beta1Stub.then(stub => { + return this.recaptchaEnterpriseServiceV1Beta1Stub!.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 562ec8b831d..40ceba48ec7 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,13 +1,13 @@ { - "updateTime": "2020-03-01T12:36:45.013657Z", + "updateTime": "2020-03-05T23:13:05.861046Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "83c6f84035ee0f80eaa44d8b688a010461cc4080", - "internalRef": "297918498", - "log": "83c6f84035ee0f80eaa44d8b688a010461cc4080\nUpdate google/api/auth.proto to make AuthProvider to have JwtLocation\n\nPiperOrigin-RevId: 297918498\n\ne9e90a787703ec5d388902e2cb796aaed3a385b4\nDialogflow weekly v2/v2beta1 library update:\n - adding get validation result\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297671458\n\n1a2b05cc3541a5f7714529c665aecc3ea042c646\nAdding .yaml and .json config files.\n\nPiperOrigin-RevId: 297570622\n\ndfe1cf7be44dee31d78f78e485d8c95430981d6e\nPublish `QueryOptions` proto.\n\nIntroduced a `query_options` input in `ExecuteSqlRequest`.\n\nPiperOrigin-RevId: 297497710\n\ndafc905f71e5d46f500b41ed715aad585be062c3\npubsub: revert pull init_rpc_timeout & max_rpc_timeout back to 25 seconds and reset multiplier to 1.0\n\nPiperOrigin-RevId: 297486523\n\nf077632ba7fee588922d9e8717ee272039be126d\nfirestore: add update_transform\n\nPiperOrigin-RevId: 297405063\n\n0aba1900ffef672ec5f0da677cf590ee5686e13b\ncluster: use square brace for cross-reference\n\nPiperOrigin-RevId: 297204568\n\n5dac2da18f6325cbaed54603c43f0667ecd50247\nRestore retry params in gapic config because securitycenter has non-standard default retry params.\nRestore a few retry codes for some idempotent methods.\n\nPiperOrigin-RevId: 297196720\n\n1eb61455530252bba8b2c8d4bc9832960e5a56f6\npubsub: v1 replace IAM HTTP rules\n\nPiperOrigin-RevId: 297188590\n\n80b2d25f8d43d9d47024ff06ead7f7166548a7ba\nDialogflow weekly v2/v2beta1 library update:\n - updates to mega agent api\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297187629\n\n0b1876b35e98f560f9c9ca9797955f020238a092\nUse an older version of protoc-docs-plugin that is compatible with the specified gapic-generator and protobuf versions.\n\nprotoc-docs-plugin >=0.4.0 (see commit https://github.com/googleapis/protoc-docs-plugin/commit/979f03ede6678c487337f3d7e88bae58df5207af) is incompatible with protobuf 3.9.1.\n\nPiperOrigin-RevId: 296986742\n\n1e47e676cddbbd8d93f19ba0665af15b5532417e\nFix: Restore a method signature for UpdateCluster\n\nPiperOrigin-RevId: 296901854\n\n7f910bcc4fc4704947ccfd3ceed015d16b9e00c2\nUpdate Dataproc v1beta2 client.\n\nPiperOrigin-RevId: 296451205\n\nde287524405a3dce124d301634731584fc0432d7\nFix: Reinstate method signatures that had been missed off some RPCs\nFix: Correct resource types for two fields\n\nPiperOrigin-RevId: 296435091\n\ne5bc9566ae057fb4c92f8b7e047f1c8958235b53\nDeprecate the endpoint_uris field, as it is unused.\n\nPiperOrigin-RevId: 296357191\n\n8c12e2b4dca94e12bff9f538bdac29524ff7ef7a\nUpdate Dataproc v1 client.\n\nPiperOrigin-RevId: 296336662\n\n17567c4a1ef0a9b50faa87024d66f8acbb561089\nRemoving erroneous comment, a la https://github.com/googleapis/java-speech/pull/103\n\nPiperOrigin-RevId: 296332968\n\n3eaaaf8626ce5b0c0bc7eee05e143beffa373b01\nAdd BUILD.bazel for v1 secretmanager.googleapis.com\n\nPiperOrigin-RevId: 296274723\n\ne76149c3d992337f85eeb45643106aacae7ede82\nMove securitycenter v1 to use generate from annotations.\n\nPiperOrigin-RevId: 296266862\n\n203740c78ac69ee07c3bf6be7408048751f618f8\nAdd StackdriverLoggingConfig field to Cloud Tasks v2 API.\n\nPiperOrigin-RevId: 296256388\n\ne4117d5e9ed8bbca28da4a60a94947ca51cb2083\nCreate a Bazel BUILD file for the google.actions.type export.\n\nPiperOrigin-RevId: 296212567\n\na9639a0a9854fd6e1be08bba1ac3897f4f16cb2f\nAdd secretmanager.googleapis.com v1 protos\n\nPiperOrigin-RevId: 295983266\n\nce4f4c21d9dd2bfab18873a80449b9d9851efde8\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295861722\n\ncb61d6c2d070b589980c779b68ffca617f789116\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295855449\n\nab2685d8d3a0e191dc8aef83df36773c07cb3d06\nfix: Dataproc v1 - AutoscalingPolicy annotation\n\nThis adds the second resource name pattern to the\nAutoscalingPolicy resource.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 295738415\n\n8a1020bf6828f6e3c84c3014f2c51cb62b739140\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295286165\n\n5cfa105206e77670369e4b2225597386aba32985\nAdd service control related proto build rule.\n\nPiperOrigin-RevId: 295262088\n\nee4dddf805072004ab19ac94df2ce669046eec26\nmonitoring v3: Add prefix \"https://cloud.google.com/\" into the link for global access\ncl 295167522, get ride of synth.py hacks\n\nPiperOrigin-RevId: 295238095\n\nd9835e922ea79eed8497db270d2f9f85099a519c\nUpdate some minor docs changes about user event proto\n\nPiperOrigin-RevId: 295185610\n\n5f311e416e69c170243de722023b22f3df89ec1c\nfix: use correct PHP package name in gapic configuration\n\nPiperOrigin-RevId: 295161330\n\n6cdd74dcdb071694da6a6b5a206e3a320b62dd11\npubsub: v1 add client config annotations and retry config\n\nPiperOrigin-RevId: 295158776\n\n5169f46d9f792e2934d9fa25c36d0515b4fd0024\nAdded cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295026522\n\n56b55aa8818cd0a532a7d779f6ef337ba809ccbd\nFix: Resource annotations for CreateTimeSeriesRequest and ListTimeSeriesRequest should refer to valid resources. TimeSeries is not a named resource.\n\nPiperOrigin-RevId: 294931650\n\n0646bc775203077226c2c34d3e4d50cc4ec53660\nRemove unnecessary languages from bigquery-related artman configuration files.\n\nPiperOrigin-RevId: 294809380\n\n8b78aa04382e3d4147112ad6d344666771bb1909\nUpdate backend.proto for schemes and protocol\n\nPiperOrigin-RevId: 294788800\n\n80b8f8b3de2359831295e24e5238641a38d8488f\nAdds artman config files for bigquerystorage endpoints v1beta2, v1alpha2, v1\n\nPiperOrigin-RevId: 294763931\n\n2c17ac33b226194041155bb5340c3f34733f1b3a\nAdd parameter to sample generated for UpdateInstance. Related to https://github.com/googleapis/python-redis/issues/4\n\nPiperOrigin-RevId: 294734008\n\nd5e8a8953f2acdfe96fb15e85eb2f33739623957\nMove bigquery datatransfer to gapic v2.\n\nPiperOrigin-RevId: 294703703\n\nefd36705972cfcd7d00ab4c6dfa1135bafacd4ae\nfix: Add two annotations that we missed.\n\nPiperOrigin-RevId: 294664231\n\n8a36b928873ff9c05b43859b9d4ea14cd205df57\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1beta2).\n\nPiperOrigin-RevId: 294459768\n\nc7a3caa2c40c49f034a3c11079dd90eb24987047\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1).\n\nPiperOrigin-RevId: 294456889\n\n5006247aa157e59118833658084345ee59af7c09\nFix: Make deprecated fields optional\nFix: Deprecate SetLoggingServiceRequest.zone in line with the comments\nFeature: Add resource name method signatures where appropriate\n\nPiperOrigin-RevId: 294383128\n\neabba40dac05c5cbe0fca3a35761b17e372036c4\nFix: C# and PHP package/namespace capitalization for BigQuery Storage v1.\n\nPiperOrigin-RevId: 294382444\n\nf8d9a858a7a55eba8009a23aa3f5cc5fe5e88dde\nfix: artman configuration file for bigtable-admin\n\nPiperOrigin-RevId: 294322616\n\n0f29555d1cfcf96add5c0b16b089235afbe9b1a9\nAPI definition for (not-yet-launched) GCS gRPC.\n\nPiperOrigin-RevId: 294321472\n\nfcc86bee0e84dc11e9abbff8d7c3529c0626f390\nfix: Bigtable Admin v2\n\nChange LRO metadata from PartialUpdateInstanceMetadata\nto UpdateInstanceMetadata. (Otherwise, it will not build.)\n\nPiperOrigin-RevId: 294264582\n\n6d9361eae2ebb3f42d8c7ce5baf4bab966fee7c0\nrefactor: Add annotations to Bigtable Admin v2.\n\nPiperOrigin-RevId: 294243406\n\nad7616f3fc8e123451c8b3a7987bc91cea9e6913\nFix: Resource type in CreateLogMetricRequest should use logging.googleapis.com.\nFix: ListLogEntries should have a method signature for convenience of calling it.\n\nPiperOrigin-RevId: 294222165\n\n63796fcbb08712676069e20a3e455c9f7aa21026\nFix: Remove extraneous resource definition for cloudkms.googleapis.com/CryptoKey.\n\nPiperOrigin-RevId: 294176658\n\ne7d8a694f4559201e6913f6610069cb08b39274e\nDepend on the latest gapic-generator and resource names plugin.\n\nThis fixes the very old an very annoying bug: https://github.com/googleapis/gapic-generator/pull/3087\n\nPiperOrigin-RevId: 293903652\n\n806b2854a966d55374ee26bb0cef4e30eda17b58\nfix: correct capitalization of Ruby namespaces in SecurityCenter V1p1beta1\n\nPiperOrigin-RevId: 293903613\n\n1b83c92462b14d67a7644e2980f723112472e03a\nPublish annotations and grpc service config for Logging API.\n\nPiperOrigin-RevId: 293893514\n\n" + "sha": "f0b581b5bdf803e45201ecdb3688b60e381628a8", + "internalRef": "299181282", + "log": "f0b581b5bdf803e45201ecdb3688b60e381628a8\nfix: recommendationengine/v1beta1 update some comments\n\nPiperOrigin-RevId: 299181282\n\n10e9a0a833dc85ff8f05b2c67ebe5ac785fe04ff\nbuild: add generated BUILD file for Routes Preferred API\n\nPiperOrigin-RevId: 299164808\n\n86738c956a8238d7c77f729be78b0ed887a6c913\npublish v1p1beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299152383\n\n73d9f2ad4591de45c2e1f352bc99d70cbd2a6d95\npublish v1: update with absolute address in comments\n\nPiperOrigin-RevId: 299147194\n\nd2158f24cb77b0b0ccfe68af784c6a628705e3c6\npublish v1beta2: update with absolute address in comments\n\nPiperOrigin-RevId: 299147086\n\n7fca61292c11b4cd5b352cee1a50bf88819dd63b\npublish v1p2beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146903\n\n583b7321624736e2c490e328f4b1957335779295\npublish v1p3beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146674\n\n638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\na78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n" } }, { diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts index 8bdb923c4e6..228bafee487 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts @@ -89,6 +89,26 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); assert(client); }); + it('has initialize method and supports deferred initialization', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.recaptchaEnterpriseServiceV1Beta1Stub, undefined); + await client.initialize(); + assert(client.recaptchaEnterpriseServiceV1Beta1Stub); + }); + it('has close method', () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); describe('createAssessment', () => { it('invokes createAssessment without error', done => { const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( @@ -97,6 +117,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest = {}; request.parent = ''; @@ -122,6 +144,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest = {}; request.parent = ''; @@ -149,6 +173,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest = {}; request.name = ''; @@ -174,6 +200,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest = {}; request.name = ''; @@ -201,6 +229,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest = {}; request.parent = ''; @@ -226,6 +256,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest = {}; request.parent = ''; @@ -253,6 +285,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest = {}; request.name = ''; @@ -278,6 +312,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest = {}; request.name = ''; @@ -301,6 +337,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest = {}; request.key = {}; @@ -327,6 +365,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest = {}; request.key = {}; @@ -355,6 +395,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest = {}; request.name = ''; @@ -380,6 +422,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest = {}; request.name = ''; @@ -407,6 +451,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest = {}; request.parent = ''; @@ -436,6 +482,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest = {}; request.parent = ''; From d76dee9f6486a49f1cb93901ccefcb91b45bcff5 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 5 Mar 2020 17:25:34 -0800 Subject: [PATCH 086/253] build: update linkinator config (#130) --- .../google-cloud-recaptchaenterprise/linkinator.config.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/linkinator.config.json b/packages/google-cloud-recaptchaenterprise/linkinator.config.json index b555215ca02..29a223b6db6 100644 --- a/packages/google-cloud-recaptchaenterprise/linkinator.config.json +++ b/packages/google-cloud-recaptchaenterprise/linkinator.config.json @@ -4,5 +4,7 @@ "https://codecov.io/gh/googleapis/", "www.googleapis.com", "img.shields.io" - ] + ], + "silent": true, + "concurrency": 10 } From c77a3d112efbac0425d64d67ad5a9b2837040d80 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 6 Mar 2020 14:58:22 -0800 Subject: [PATCH 087/253] build(tests): fix coveralls and enable build cop (#132) --- .../.mocharc.js | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/google-cloud-recaptchaenterprise/.mocharc.js diff --git a/packages/google-cloud-recaptchaenterprise/.mocharc.js b/packages/google-cloud-recaptchaenterprise/.mocharc.js new file mode 100644 index 00000000000..ff7b34fa5d1 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/.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 From 8ac3fc8fb507c9c3b0f19fb521f0217702320bf1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 10 Mar 2020 17:08:28 +0100 Subject: [PATCH 088/253] chore(deps): update dependency uuid to v7 (#131) --- packages/google-cloud-recaptchaenterprise/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index a6ff0686ce7..d607cf057db 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -18,6 +18,6 @@ "devDependencies": { "chai": "^4.2.0", "mocha": "^7.0.0", - "uuid": "^3.3.2" + "uuid": "^7.0.0" } } From 2f6d143b19b3cdec03d7252f280ea599d0afcffa Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2020 14:30:44 -0700 Subject: [PATCH 089/253] chore: release 1.7.0 (#129) --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 341d3718b6c..5972875e007 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [1.7.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.6.0...v1.7.0) (2020-03-10) + + +### Features + +* deferred client initialization ([#128](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/128)) ([3de999e](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/3de999e1d4efc823dd52844a7ee19ec9b8c3ebfd)) + ## [1.6.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.5.3...v1.6.0) (2020-03-05) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 8508e7fbda2..370fff26b72 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.6.0", + "version": "1.7.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index d607cf057db..3ba7793a834 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.6.0" + "@google-cloud/recaptcha-enterprise": "^1.7.0" }, "devDependencies": { "chai": "^4.2.0", From c8614727c83e3750ac52a670ef8ca306657db5af Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 18 Mar 2020 12:59:43 -0700 Subject: [PATCH 090/253] docs: mention templates in contributing section of README (#134) --- packages/google-cloud-recaptchaenterprise/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index 294e21ff80b..bbfc94a4a2b 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -120,6 +120,12 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-recaptcha-enterprise/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 From 764b35f5eb3d150664b43241323f2c79acecdb3a Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 23 Mar 2020 18:32:50 -0700 Subject: [PATCH 091/253] docs: document version support goals (#140) --- .../README.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index bbfc94a4a2b..c021f5450be 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -98,6 +98,27 @@ has instructions for running the samples. The [Google Cloud reCAPTCHA Enterprise 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/). From d0b7b0f6c833ddf6b00637a8630b6a8233698519 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 24 Mar 2020 17:05:05 -0700 Subject: [PATCH 092/253] feat: add the v1 API surface (#141) --- .../.jsdoc.js | 2 +- .../.repo-metadata.json | 2 +- .../README.md | 15 +- .../v1/recaptchaenterprise.proto | 459 ++ .../protos/protos.d.ts | 1933 +++++++ .../protos/protos.js | 4532 +++++++++++++++++ .../protos/protos.json | 477 ++ .../samples/quickstart.js | 4 +- .../src/index.ts | 16 +- .../src/v1/index.ts | 19 + .../v1/recaptcha_enterprise_service_client.ts | 1080 ++++ ...tcha_enterprise_service_client_config.json | 61 + ...captcha_enterprise_service_proto_list.json | 3 + .../src/v1beta1/index.ts | 2 +- ...tcha_enterprise_service_v1_beta1_client.ts | 12 +- .../synth.metadata | 24 +- .../google-cloud-recaptchaenterprise/synth.py | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../system-test/install.ts | 2 +- .../gapic-recaptcha_enterprise_service-v1.ts | 512 ++ ...cha_enterprise_service_v1_beta1-v1beta1.ts | 2 +- .../webpack.config.js | 2 +- 23 files changed, 9131 insertions(+), 34 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto create mode 100644 packages/google-cloud-recaptchaenterprise/src/v1/index.ts create mode 100644 packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts create mode 100644 packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json create mode 100644 packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_proto_list.json create mode 100644 packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service-v1.ts diff --git a/packages/google-cloud-recaptchaenterprise/.jsdoc.js b/packages/google-cloud-recaptchaenterprise/.jsdoc.js index 177f672ce12..367a9d8883e 100644 --- a/packages/google-cloud-recaptchaenterprise/.jsdoc.js +++ b/packages/google-cloud-recaptchaenterprise/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-recaptchaenterprise/.repo-metadata.json b/packages/google-cloud-recaptchaenterprise/.repo-metadata.json index 30ed2bd2ad1..0b9b6d62a99 100644 --- a/packages/google-cloud-recaptchaenterprise/.repo-metadata.json +++ b/packages/google-cloud-recaptchaenterprise/.repo-metadata.json @@ -4,7 +4,7 @@ "product_documentation": "https://cloud.google.com/recaptcha-enterprise/docs/", "client_documentation": "https://googleapis.dev/nodejs/recaptcha-enterprise/latest", "issue_tracker": "", - "release_level": "beta", + "release_level": "ga", "language": "nodejs", "repo": "googleapis/nodejs-recaptcha-enterprise", "distribution_name": "@google-cloud/recaptcha-enterprise", diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index c021f5450be..bd9cb9be542 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -4,7 +4,7 @@ # [Google Cloud reCAPTCHA Enterprise: Node.js Client](https://github.com/googleapis/nodejs-recaptcha-enterprise) -[![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/recaptcha-enterprise.svg)](https://www.npmjs.org/package/@google-cloud/recaptcha-enterprise) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-recaptcha-enterprise/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-recaptcha-enterprise) @@ -62,9 +62,9 @@ npm install @google-cloud/recaptcha-enterprise async function main(projectNumber) { // Create the reCAPTCHA client library. const { - RecaptchaEnterpriseServiceV1Beta1Client, + RecaptchaEnterpriseServiceClient, } = require('@google-cloud/recaptcha-enterprise'); - const client = new RecaptchaEnterpriseServiceV1Beta1Client(); + const client = new RecaptchaEnterpriseServiceClient(); // format the path to the project (it should be prefaced with projects/). const formattedParent = client.projectPath(projectNumber); @@ -124,11 +124,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-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto new file mode 100644 index 00000000000..68c331b2b0e --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -0,0 +1,459 @@ +// 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.recaptchaenterprise.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.RecaptchaEnterprise.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1;recaptchaenterprise"; +option java_multiple_files = true; +option java_outer_classname = "RecaptchaEnterpriseProto"; +option java_package = "com.google.recaptchaenterprise.v1"; +option objc_class_prefix = "GCRE"; +option php_namespace = "Google\\Cloud\\RecaptchaEnterprise\\V1"; + +// Service to determine the likelihood an event is legitimate. +service RecaptchaEnterpriseService { + option (google.api.default_host) = "recaptchaenterprise.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates an Assessment of the likelihood an event is legitimate. + rpc CreateAssessment(CreateAssessmentRequest) returns (Assessment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/assessments" + body: "assessment" + }; + option (google.api.method_signature) = "parent,assessment"; + } + + // Annotates a previously created Assessment to provide additional information + // on whether the event turned out to be authentic or fradulent. + rpc AnnotateAssessment(AnnotateAssessmentRequest) returns (AnnotateAssessmentResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/assessments/*}:annotate" + body: "*" + }; + option (google.api.method_signature) = "name,annotation"; + } + + // Creates a new reCAPTCHA Enterprise key. + rpc CreateKey(CreateKeyRequest) returns (Key) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/keys" + body: "key" + }; + } + + // Returns the list of all keys that belong to a project. + rpc ListKeys(ListKeysRequest) returns (ListKeysResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/keys" + }; + } + + // Returns the specified key. + rpc GetKey(GetKeyRequest) returns (Key) { + option (google.api.http) = { + get: "/v1/{name=projects/*/keys/*}" + }; + } + + // Updates the specified key. + rpc UpdateKey(UpdateKeyRequest) returns (Key) { + option (google.api.http) = { + patch: "/v1/{key.name=projects/*/keys/*}" + body: "key" + }; + } + + // Deletes the specified key. + rpc DeleteKey(DeleteKeyRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/keys/*}" + }; + } +} + +// The create assessment request message. +message CreateAssessmentRequest { + // Required. The name of the project in which the assessment will be created, + // in the format "projects/{project}". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The assessment details. + Assessment assessment = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message to annotate an Assessment. +message AnnotateAssessmentRequest { + // Enum that reprensents the types of annotations. + enum Annotation { + // Default unspecified type. + ANNOTATION_UNSPECIFIED = 0; + + // Provides information that the event turned out to be legitimate. + LEGITIMATE = 1; + + // Provides information that the event turned out to be fraudulent. + FRAUDULENT = 2; + + // Provides information that the event was related to a login event in which + // the user typed the correct password. + PASSWORD_CORRECT = 3; + + // Provides information that the event was related to a login event in which + // the user typed the incorrect password. + PASSWORD_INCORRECT = 4; + } + + // Required. The resource name of the Assessment, in the format + // "projects/{project}/assessments/{assessment}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/Assessment" + } + ]; + + // Required. The annotation that will be assigned to the Event. + Annotation annotation = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Empty response for AnnotateAssessment. +message AnnotateAssessmentResponse { + +} + +// A recaptcha assessment resource. +message Assessment { + option (google.api.resource) = { + type: "recaptchaenterprise.googleapis.com/Assessment" + pattern: "projects/{project}/assessments/{assessment}" + }; + + // Output only. The resource name for the Assessment in the format + // "projects/{project}/assessments/{assessment}". + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The event being assessed. + Event event = 2; + + // Output only. The risk analysis result for the event being assessed. + RiskAnalysis risk_analysis = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Properties of the provided event token. + TokenProperties token_properties = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +message Event { + // Optional. The user response token provided by the reCAPTCHA client-side integration + // on your site. + string token = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The site key that was used to invoke reCAPTCHA on your site and generate + // the token. + string site_key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The user agent present in the request from the user's device related to + // this event. + string user_agent = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The IP address in the request from the user's device related to this event. + string user_ip_address = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The expected action for this type of event. This should be the same action + // provided at token generation time on client-side platforms already + // integrated with recaptcha enterprise. + string expected_action = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Risk analysis result for an event. +message RiskAnalysis { + // LINT.IfChange(classification_reason) + // Reasons contributing to the risk analysis verdict. + enum ClassificationReason { + // Default unspecified type. + CLASSIFICATION_REASON_UNSPECIFIED = 0; + + // Interactions matched the behavior of an automated agent. + AUTOMATION = 1; + + // The event originated from an illegitimate environment. + UNEXPECTED_ENVIRONMENT = 2; + + // Traffic volume from the event source is higher than normal. + TOO_MUCH_TRAFFIC = 3; + + // Interactions with the site were significantly different than expected + // patterns. + UNEXPECTED_USAGE_PATTERNS = 4; + + // Too little traffic has been received from this site thus far to generate + // quality risk analysis. + LOW_CONFIDENCE_SCORE = 5; + } + + // Legitimate event score from 0.0 to 1.0. + // (1.0 means very likely legitimate traffic while 0.0 means very likely + // non-legitimate traffic). + float score = 1; + + // Reasons contributing to the risk analysis verdict. + repeated ClassificationReason reasons = 2; +} + +message TokenProperties { + // LINT.IfChange + // Enum that represents the types of invalid token reasons. + enum InvalidReason { + // Default unspecified type. + INVALID_REASON_UNSPECIFIED = 0; + + // If the failure reason was not accounted for. + UNKNOWN_INVALID_REASON = 1; + + // The provided user verification token was malformed. + MALFORMED = 2; + + // The user verification token had expired. + EXPIRED = 3; + + // The user verification had already been seen. + DUPE = 4; + + // The user verification token was not present. + MISSING = 5; + } + + // Whether the provided user response token is valid. When valid = false, the + // reason could be specified in invalid_reason or it could also be due to + // a user failing to solve a challenge or a sitekey mismatch (i.e the sitekey + // used to generate the token was different than the one specified in the + // assessment). + bool valid = 1; + + // Reason associated with the response when valid = false. + InvalidReason invalid_reason = 2; + + // The timestamp corresponding to the generation of the token. + google.protobuf.Timestamp create_time = 3; + + // The hostname of the page on which the token was generated. + string hostname = 4; + + // Action name provided at token generation. + string action = 5; +} + +// The create key request message. +message CreateKeyRequest { + // Required. The name of the project in which the key will be created, in the + // format "projects/{project}". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. Information to create a reCAPTCHA Enterprise key. + Key key = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The list keys request message. +message ListKeysRequest { + // Required. The name of the project that contains the keys that will be + // listed, in the format "projects/{project}". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. The maximum number of keys to return. Default is 10. Max limit is + // 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous. + // ListKeysRequest, if any. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response to request to list keys in a project. +message ListKeysResponse { + // Key details. + repeated Key keys = 1; + + // Token to retrieve the next page of results. It is set to empty if no keys + // remain in results. + string next_page_token = 2; +} + +// The get key request message. +message GetKeyRequest { + // Required. The name of the requested key, in the format + // "projects/{project}/keys/{key}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/Key" + } + ]; +} + +// The update key request message. +message UpdateKeyRequest { + // Required. The key to update. + Key key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The mask to control which field of the key get updated. If the mask is not + // present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The delete key request message. +message DeleteKeyRequest { + // Required. The name of the key to be deleted, in the format + // "projects/{project}/keys/{key}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/Key" + } + ]; +} + +// A key used to identify and configure applications (web and/or mobile) that +// use reCAPTCHA Enterprise. +message Key { + option (google.api.resource) = { + type: "recaptchaenterprise.googleapis.com/Key" + pattern: "projects/{project}/keys/{key}" + }; + + // The resource name for the Key in the format + // "projects/{project}/keys/{key}". + string name = 1; + + // Human-readable display name of this key. Modifiable by user. + string display_name = 2; + + // Platform specific settings for this key. The key can only be used on one + // platform, the one it has settings for. + oneof platform_settings { + // Settings for keys that can be used by websites. + WebKeySettings web_settings = 3; + + // Settings for keys that can be used by Android apps. + AndroidKeySettings android_settings = 4; + + // Settings for keys that can be used by iOS apps. + IOSKeySettings ios_settings = 5; + } + + // Optional. See + // Creating and managing labels. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // The timestamp corresponding to the creation of this Key. + google.protobuf.Timestamp create_time = 7; +} + +// Settings specific to keys that can be used by websites. +message WebKeySettings { + // Enum that represents the integration types for web keys. + enum IntegrationType { + // Default type that indicates this enum hasn't been specified. This is not + // a valid IntegrationType, one of the other types must be specified + // instead. + INTEGRATION_TYPE_UNSPECIFIED = 0; + + // Only used to produce scores. It doesn't display the "I'm not a robot" + // checkbox and never shows captcha challenges. + SCORE = 1; + + // Displays the "I'm not a robot" checkbox and may show captcha challenges + // after it is checked. + CHECKBOX = 2; + + // Doesn't display the "I'm not a robot" checkbox, but may show captcha + // challenges after risk analysis. + INVISIBLE = 3; + } + + // Enum that represents the possible challenge frequency and difficulty + // configurations for a web key. + enum ChallengeSecurityPreference { + // Default type that indicates this enum hasn't been specified. + CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0; + + // Key tends to show fewer and easier challenges. + USABILITY = 1; + + // Key tends to show balanced (in amount and difficulty) challenges. + BALANCE = 2; + + // Key tends to show more and harder challenges. + SECURITY = 3; + } + + // If set to true, it means allowed_domains will not be enforced. + bool allow_all_domains = 3; + + // Domains or subdomains of websites allowed to use the key. All subdomains + // of an allowed domain are automatically allowed. A valid domain requires a + // host and must not include any path, port, query or fragment. + // Examples: 'example.com' or 'subdomain.example.com' + repeated string allowed_domains = 1; + + // Required. Whether this key can be used on AMP (Accelerated Mobile Pages) websites. + bool allow_amp_traffic = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Describes how this key is integrated with the website. + IntegrationType integration_type = 4 [(google.api.field_behavior) = REQUIRED]; + + // Settings for the frequency and difficulty at which this key triggers + // captcha challenges. This should only be specified for IntegrationTypes + // CHECKBOX and INVISIBLE. + ChallengeSecurityPreference challenge_security_preference = 5; +} + +// Settings specific to keys that can be used by Android apps. +message AndroidKeySettings { + // Android package names of apps allowed to use the key. + // Example: 'com.companyname.appname' + repeated string allowed_package_names = 1; +} + +// Settings specific to keys that can be used by iOS apps. +message IOSKeySettings { + // iOS bundle ids of apps allowed to use the key. + // Example: 'com.companyname.productname.appname' + repeated string allowed_bundle_ids = 1; +} diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index a65b651c1f0..9b6337d91cc 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -23,6 +23,1939 @@ export namespace google { /** Namespace recaptchaenterprise. */ namespace recaptchaenterprise { + /** Namespace v1. */ + namespace v1 { + + /** Represents a RecaptchaEnterpriseService */ + class RecaptchaEnterpriseService extends $protobuf.rpc.Service { + + /** + * Constructs a new RecaptchaEnterpriseService 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 RecaptchaEnterpriseService 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): RecaptchaEnterpriseService; + + /** + * Calls CreateAssessment. + * @param request CreateAssessmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Assessment + */ + public createAssessment(request: google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, callback: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateAssessmentCallback): void; + + /** + * Calls CreateAssessment. + * @param request CreateAssessmentRequest message or plain object + * @returns Promise + */ + public createAssessment(request: google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest): Promise; + + /** + * Calls AnnotateAssessment. + * @param request AnnotateAssessmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnnotateAssessmentResponse + */ + public annotateAssessment(request: google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, callback: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.AnnotateAssessmentCallback): void; + + /** + * Calls AnnotateAssessment. + * @param request AnnotateAssessmentRequest message or plain object + * @returns Promise + */ + public annotateAssessment(request: google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest): Promise; + + /** + * Calls CreateKey. + * @param request CreateKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Key + */ + public createKey(request: google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, callback: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateKeyCallback): void; + + /** + * Calls CreateKey. + * @param request CreateKeyRequest message or plain object + * @returns Promise + */ + public createKey(request: google.cloud.recaptchaenterprise.v1.ICreateKeyRequest): Promise; + + /** + * Calls ListKeys. + * @param request ListKeysRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListKeysResponse + */ + public listKeys(request: google.cloud.recaptchaenterprise.v1.IListKeysRequest, callback: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListKeysCallback): void; + + /** + * Calls ListKeys. + * @param request ListKeysRequest message or plain object + * @returns Promise + */ + public listKeys(request: google.cloud.recaptchaenterprise.v1.IListKeysRequest): Promise; + + /** + * Calls GetKey. + * @param request GetKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Key + */ + public getKey(request: google.cloud.recaptchaenterprise.v1.IGetKeyRequest, callback: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetKeyCallback): void; + + /** + * Calls GetKey. + * @param request GetKeyRequest message or plain object + * @returns Promise + */ + public getKey(request: google.cloud.recaptchaenterprise.v1.IGetKeyRequest): Promise; + + /** + * Calls UpdateKey. + * @param request UpdateKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Key + */ + public updateKey(request: google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, callback: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.UpdateKeyCallback): void; + + /** + * Calls UpdateKey. + * @param request UpdateKeyRequest message or plain object + * @returns Promise + */ + public updateKey(request: google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest): Promise; + + /** + * Calls DeleteKey. + * @param request DeleteKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteKey(request: google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, callback: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.DeleteKeyCallback): void; + + /** + * Calls DeleteKey. + * @param request DeleteKeyRequest message or plain object + * @returns Promise + */ + public deleteKey(request: google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest): Promise; + } + + namespace RecaptchaEnterpriseService { + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#createAssessment}. + * @param error Error, if any + * @param [response] Assessment + */ + type CreateAssessmentCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.Assessment) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#annotateAssessment}. + * @param error Error, if any + * @param [response] AnnotateAssessmentResponse + */ + type AnnotateAssessmentCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#createKey}. + * @param error Error, if any + * @param [response] Key + */ + type CreateKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.Key) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#listKeys}. + * @param error Error, if any + * @param [response] ListKeysResponse + */ + type ListKeysCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.ListKeysResponse) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#getKey}. + * @param error Error, if any + * @param [response] Key + */ + type GetKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.Key) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#updateKey}. + * @param error Error, if any + * @param [response] Key + */ + type UpdateKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.Key) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#deleteKey}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteKeyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a CreateAssessmentRequest. */ + interface ICreateAssessmentRequest { + + /** CreateAssessmentRequest parent */ + parent?: (string|null); + + /** CreateAssessmentRequest assessment */ + assessment?: (google.cloud.recaptchaenterprise.v1.IAssessment|null); + } + + /** Represents a CreateAssessmentRequest. */ + class CreateAssessmentRequest implements ICreateAssessmentRequest { + + /** + * Constructs a new CreateAssessmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest); + + /** CreateAssessmentRequest parent. */ + public parent: string; + + /** CreateAssessmentRequest assessment. */ + public assessment?: (google.cloud.recaptchaenterprise.v1.IAssessment|null); + + /** + * Creates a new CreateAssessmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAssessmentRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest): google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest; + + /** + * Encodes the specified CreateAssessmentRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest.verify|verify} messages. + * @param message CreateAssessmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAssessmentRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest.verify|verify} messages. + * @param message CreateAssessmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAssessmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAssessmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest; + + /** + * Decodes a CreateAssessmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAssessmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest; + + /** + * Verifies a CreateAssessmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAssessmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAssessmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest; + + /** + * Creates a plain object from a CreateAssessmentRequest message. Also converts values to other types if specified. + * @param message CreateAssessmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAssessmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateAssessmentRequest. */ + interface IAnnotateAssessmentRequest { + + /** AnnotateAssessmentRequest name */ + name?: (string|null); + + /** AnnotateAssessmentRequest annotation */ + annotation?: (google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation|keyof typeof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation|null); + } + + /** Represents an AnnotateAssessmentRequest. */ + class AnnotateAssessmentRequest implements IAnnotateAssessmentRequest { + + /** + * Constructs a new AnnotateAssessmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest); + + /** AnnotateAssessmentRequest name. */ + public name: string; + + /** AnnotateAssessmentRequest annotation. */ + public annotation: (google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation|keyof typeof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation); + + /** + * Creates a new AnnotateAssessmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateAssessmentRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest): google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest; + + /** + * Encodes the specified AnnotateAssessmentRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.verify|verify} messages. + * @param message AnnotateAssessmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateAssessmentRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.verify|verify} messages. + * @param message AnnotateAssessmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateAssessmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateAssessmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest; + + /** + * Decodes an AnnotateAssessmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateAssessmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest; + + /** + * Verifies an AnnotateAssessmentRequest message. + * @param message Plain 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 AnnotateAssessmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateAssessmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest; + + /** + * Creates a plain object from an AnnotateAssessmentRequest message. Also converts values to other types if specified. + * @param message AnnotateAssessmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateAssessmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AnnotateAssessmentRequest { + + /** Annotation enum. */ + enum Annotation { + ANNOTATION_UNSPECIFIED = 0, + LEGITIMATE = 1, + FRAUDULENT = 2, + PASSWORD_CORRECT = 3, + PASSWORD_INCORRECT = 4 + } + } + + /** Properties of an AnnotateAssessmentResponse. */ + interface IAnnotateAssessmentResponse { + } + + /** Represents an AnnotateAssessmentResponse. */ + class AnnotateAssessmentResponse implements IAnnotateAssessmentResponse { + + /** + * Constructs a new AnnotateAssessmentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse); + + /** + * Creates a new AnnotateAssessmentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateAssessmentResponse instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse): google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse; + + /** + * Encodes the specified AnnotateAssessmentResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse.verify|verify} messages. + * @param message AnnotateAssessmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateAssessmentResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse.verify|verify} messages. + * @param message AnnotateAssessmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateAssessmentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateAssessmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse; + + /** + * Decodes an AnnotateAssessmentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateAssessmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse; + + /** + * Verifies an AnnotateAssessmentResponse message. + * @param message Plain 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 AnnotateAssessmentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateAssessmentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse; + + /** + * Creates a plain object from an AnnotateAssessmentResponse message. Also converts values to other types if specified. + * @param message AnnotateAssessmentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateAssessmentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Assessment. */ + interface IAssessment { + + /** Assessment name */ + name?: (string|null); + + /** Assessment event */ + event?: (google.cloud.recaptchaenterprise.v1.IEvent|null); + + /** Assessment riskAnalysis */ + riskAnalysis?: (google.cloud.recaptchaenterprise.v1.IRiskAnalysis|null); + + /** Assessment tokenProperties */ + tokenProperties?: (google.cloud.recaptchaenterprise.v1.ITokenProperties|null); + } + + /** Represents an Assessment. */ + class Assessment implements IAssessment { + + /** + * Constructs a new Assessment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IAssessment); + + /** Assessment name. */ + public name: string; + + /** Assessment event. */ + public event?: (google.cloud.recaptchaenterprise.v1.IEvent|null); + + /** Assessment riskAnalysis. */ + public riskAnalysis?: (google.cloud.recaptchaenterprise.v1.IRiskAnalysis|null); + + /** Assessment tokenProperties. */ + public tokenProperties?: (google.cloud.recaptchaenterprise.v1.ITokenProperties|null); + + /** + * Creates a new Assessment instance using the specified properties. + * @param [properties] Properties to set + * @returns Assessment instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IAssessment): google.cloud.recaptchaenterprise.v1.Assessment; + + /** + * Encodes the specified Assessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Assessment.verify|verify} messages. + * @param message Assessment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Assessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Assessment.verify|verify} messages. + * @param message Assessment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Assessment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Assessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.Assessment; + + /** + * Decodes an Assessment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Assessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.Assessment; + + /** + * Verifies an Assessment message. + * @param message Plain 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 Assessment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Assessment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.Assessment; + + /** + * Creates a plain object from an Assessment message. Also converts values to other types if specified. + * @param message Assessment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.Assessment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Assessment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Event. */ + interface IEvent { + + /** Event token */ + token?: (string|null); + + /** Event siteKey */ + siteKey?: (string|null); + + /** Event userAgent */ + userAgent?: (string|null); + + /** Event userIpAddress */ + userIpAddress?: (string|null); + + /** Event expectedAction */ + expectedAction?: (string|null); + } + + /** Represents an Event. */ + class Event implements IEvent { + + /** + * Constructs a new Event. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IEvent); + + /** Event token. */ + public token: string; + + /** Event siteKey. */ + public siteKey: string; + + /** Event userAgent. */ + public userAgent: string; + + /** Event userIpAddress. */ + public userIpAddress: string; + + /** Event expectedAction. */ + public expectedAction: string; + + /** + * Creates a new Event instance using the specified properties. + * @param [properties] Properties to set + * @returns Event instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IEvent): google.cloud.recaptchaenterprise.v1.Event; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Event message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.Event; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.Event; + + /** + * Verifies an Event message. + * @param message Plain 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 Event message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Event + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.Event; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @param message Event + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.Event, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Event to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RiskAnalysis. */ + interface IRiskAnalysis { + + /** RiskAnalysis score */ + score?: (number|null); + + /** RiskAnalysis reasons */ + reasons?: (google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason[]|null); + } + + /** Represents a RiskAnalysis. */ + class RiskAnalysis implements IRiskAnalysis { + + /** + * Constructs a new RiskAnalysis. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IRiskAnalysis); + + /** RiskAnalysis score. */ + public score: number; + + /** RiskAnalysis reasons. */ + public reasons: google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason[]; + + /** + * Creates a new RiskAnalysis instance using the specified properties. + * @param [properties] Properties to set + * @returns RiskAnalysis instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IRiskAnalysis): google.cloud.recaptchaenterprise.v1.RiskAnalysis; + + /** + * Encodes the specified RiskAnalysis message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RiskAnalysis.verify|verify} messages. + * @param message RiskAnalysis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IRiskAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RiskAnalysis message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RiskAnalysis.verify|verify} messages. + * @param message RiskAnalysis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IRiskAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RiskAnalysis message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RiskAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.RiskAnalysis; + + /** + * Decodes a RiskAnalysis message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RiskAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.RiskAnalysis; + + /** + * Verifies a RiskAnalysis message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RiskAnalysis message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RiskAnalysis + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.RiskAnalysis; + + /** + * Creates a plain object from a RiskAnalysis message. Also converts values to other types if specified. + * @param message RiskAnalysis + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.RiskAnalysis, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RiskAnalysis to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RiskAnalysis { + + /** ClassificationReason enum. */ + enum ClassificationReason { + CLASSIFICATION_REASON_UNSPECIFIED = 0, + AUTOMATION = 1, + UNEXPECTED_ENVIRONMENT = 2, + TOO_MUCH_TRAFFIC = 3, + UNEXPECTED_USAGE_PATTERNS = 4, + LOW_CONFIDENCE_SCORE = 5 + } + } + + /** Properties of a TokenProperties. */ + interface ITokenProperties { + + /** TokenProperties valid */ + valid?: (boolean|null); + + /** TokenProperties invalidReason */ + invalidReason?: (google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason|keyof typeof google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason|null); + + /** TokenProperties createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** TokenProperties hostname */ + hostname?: (string|null); + + /** TokenProperties action */ + action?: (string|null); + } + + /** Represents a TokenProperties. */ + class TokenProperties implements ITokenProperties { + + /** + * Constructs a new TokenProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.ITokenProperties); + + /** TokenProperties valid. */ + public valid: boolean; + + /** TokenProperties invalidReason. */ + public invalidReason: (google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason|keyof typeof google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason); + + /** TokenProperties createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** TokenProperties hostname. */ + public hostname: string; + + /** TokenProperties action. */ + public action: string; + + /** + * Creates a new TokenProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenProperties instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.ITokenProperties): google.cloud.recaptchaenterprise.v1.TokenProperties; + + /** + * Encodes the specified TokenProperties message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TokenProperties.verify|verify} messages. + * @param message TokenProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.ITokenProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TokenProperties message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TokenProperties.verify|verify} messages. + * @param message TokenProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.ITokenProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TokenProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.TokenProperties; + + /** + * Decodes a TokenProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TokenProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.TokenProperties; + + /** + * Verifies a TokenProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TokenProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TokenProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.TokenProperties; + + /** + * Creates a plain object from a TokenProperties message. Also converts values to other types if specified. + * @param message TokenProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.TokenProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TokenProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TokenProperties { + + /** InvalidReason enum. */ + enum InvalidReason { + INVALID_REASON_UNSPECIFIED = 0, + UNKNOWN_INVALID_REASON = 1, + MALFORMED = 2, + EXPIRED = 3, + DUPE = 4, + MISSING = 5 + } + } + + /** Properties of a CreateKeyRequest. */ + interface ICreateKeyRequest { + + /** CreateKeyRequest parent */ + parent?: (string|null); + + /** CreateKeyRequest key */ + key?: (google.cloud.recaptchaenterprise.v1.IKey|null); + } + + /** Represents a CreateKeyRequest. */ + class CreateKeyRequest implements ICreateKeyRequest { + + /** + * Constructs a new CreateKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.ICreateKeyRequest); + + /** CreateKeyRequest parent. */ + public parent: string; + + /** CreateKeyRequest key. */ + public key?: (google.cloud.recaptchaenterprise.v1.IKey|null); + + /** + * Creates a new CreateKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateKeyRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.ICreateKeyRequest): google.cloud.recaptchaenterprise.v1.CreateKeyRequest; + + /** + * Encodes the specified CreateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.CreateKeyRequest.verify|verify} messages. + * @param message CreateKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.CreateKeyRequest.verify|verify} messages. + * @param message CreateKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.CreateKeyRequest; + + /** + * Decodes a CreateKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.CreateKeyRequest; + + /** + * Verifies a CreateKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.CreateKeyRequest; + + /** + * Creates a plain object from a CreateKeyRequest message. Also converts values to other types if specified. + * @param message CreateKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.CreateKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListKeysRequest. */ + interface IListKeysRequest { + + /** ListKeysRequest parent */ + parent?: (string|null); + + /** ListKeysRequest pageSize */ + pageSize?: (number|null); + + /** ListKeysRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListKeysRequest. */ + class ListKeysRequest implements IListKeysRequest { + + /** + * Constructs a new ListKeysRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IListKeysRequest); + + /** ListKeysRequest parent. */ + public parent: string; + + /** ListKeysRequest pageSize. */ + public pageSize: number; + + /** ListKeysRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListKeysRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListKeysRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IListKeysRequest): google.cloud.recaptchaenterprise.v1.ListKeysRequest; + + /** + * Encodes the specified ListKeysRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysRequest.verify|verify} messages. + * @param message ListKeysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IListKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListKeysRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysRequest.verify|verify} messages. + * @param message ListKeysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IListKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListKeysRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.ListKeysRequest; + + /** + * Decodes a ListKeysRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.ListKeysRequest; + + /** + * Verifies a ListKeysRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListKeysRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListKeysRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.ListKeysRequest; + + /** + * Creates a plain object from a ListKeysRequest message. Also converts values to other types if specified. + * @param message ListKeysRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.ListKeysRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListKeysRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListKeysResponse. */ + interface IListKeysResponse { + + /** ListKeysResponse keys */ + keys?: (google.cloud.recaptchaenterprise.v1.IKey[]|null); + + /** ListKeysResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListKeysResponse. */ + class ListKeysResponse implements IListKeysResponse { + + /** + * Constructs a new ListKeysResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IListKeysResponse); + + /** ListKeysResponse keys. */ + public keys: google.cloud.recaptchaenterprise.v1.IKey[]; + + /** ListKeysResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListKeysResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListKeysResponse instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IListKeysResponse): google.cloud.recaptchaenterprise.v1.ListKeysResponse; + + /** + * Encodes the specified ListKeysResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysResponse.verify|verify} messages. + * @param message ListKeysResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IListKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListKeysResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysResponse.verify|verify} messages. + * @param message ListKeysResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IListKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListKeysResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.ListKeysResponse; + + /** + * Decodes a ListKeysResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.ListKeysResponse; + + /** + * Verifies a ListKeysResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListKeysResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListKeysResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.ListKeysResponse; + + /** + * Creates a plain object from a ListKeysResponse message. Also converts values to other types if specified. + * @param message ListKeysResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.ListKeysResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListKeysResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetKeyRequest. */ + interface IGetKeyRequest { + + /** GetKeyRequest name */ + name?: (string|null); + } + + /** Represents a GetKeyRequest. */ + class GetKeyRequest implements IGetKeyRequest { + + /** + * Constructs a new GetKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IGetKeyRequest); + + /** GetKeyRequest name. */ + public name: string; + + /** + * Creates a new GetKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetKeyRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IGetKeyRequest): google.cloud.recaptchaenterprise.v1.GetKeyRequest; + + /** + * Encodes the specified GetKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetKeyRequest.verify|verify} messages. + * @param message GetKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IGetKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetKeyRequest.verify|verify} messages. + * @param message GetKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IGetKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.GetKeyRequest; + + /** + * Decodes a GetKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.GetKeyRequest; + + /** + * Verifies a GetKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.GetKeyRequest; + + /** + * Creates a plain object from a GetKeyRequest message. Also converts values to other types if specified. + * @param message GetKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.GetKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateKeyRequest. */ + interface IUpdateKeyRequest { + + /** UpdateKeyRequest key */ + key?: (google.cloud.recaptchaenterprise.v1.IKey|null); + + /** UpdateKeyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateKeyRequest. */ + class UpdateKeyRequest implements IUpdateKeyRequest { + + /** + * Constructs a new UpdateKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest); + + /** UpdateKeyRequest key. */ + public key?: (google.cloud.recaptchaenterprise.v1.IKey|null); + + /** UpdateKeyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateKeyRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest): google.cloud.recaptchaenterprise.v1.UpdateKeyRequest; + + /** + * Encodes the specified UpdateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.UpdateKeyRequest.verify|verify} messages. + * @param message UpdateKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.UpdateKeyRequest.verify|verify} messages. + * @param message UpdateKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.UpdateKeyRequest; + + /** + * Decodes an UpdateKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.UpdateKeyRequest; + + /** + * Verifies an UpdateKeyRequest message. + * @param message Plain 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 UpdateKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.UpdateKeyRequest; + + /** + * Creates a plain object from an UpdateKeyRequest message. Also converts values to other types if specified. + * @param message UpdateKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.UpdateKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteKeyRequest. */ + interface IDeleteKeyRequest { + + /** DeleteKeyRequest name */ + name?: (string|null); + } + + /** Represents a DeleteKeyRequest. */ + class DeleteKeyRequest implements IDeleteKeyRequest { + + /** + * Constructs a new DeleteKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest); + + /** DeleteKeyRequest name. */ + public name: string; + + /** + * Creates a new DeleteKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteKeyRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest): google.cloud.recaptchaenterprise.v1.DeleteKeyRequest; + + /** + * Encodes the specified DeleteKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.DeleteKeyRequest.verify|verify} messages. + * @param message DeleteKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.DeleteKeyRequest.verify|verify} messages. + * @param message DeleteKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.DeleteKeyRequest; + + /** + * Decodes a DeleteKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.DeleteKeyRequest; + + /** + * Verifies a DeleteKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.DeleteKeyRequest; + + /** + * Creates a plain object from a DeleteKeyRequest message. Also converts values to other types if specified. + * @param message DeleteKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.DeleteKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Key. */ + interface IKey { + + /** Key name */ + name?: (string|null); + + /** Key displayName */ + displayName?: (string|null); + + /** Key webSettings */ + webSettings?: (google.cloud.recaptchaenterprise.v1.IWebKeySettings|null); + + /** Key androidSettings */ + androidSettings?: (google.cloud.recaptchaenterprise.v1.IAndroidKeySettings|null); + + /** Key iosSettings */ + iosSettings?: (google.cloud.recaptchaenterprise.v1.IIOSKeySettings|null); + + /** Key labels */ + labels?: ({ [k: string]: string }|null); + + /** Key createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Key. */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IKey); + + /** Key name. */ + public name: string; + + /** Key displayName. */ + public displayName: string; + + /** Key webSettings. */ + public webSettings?: (google.cloud.recaptchaenterprise.v1.IWebKeySettings|null); + + /** Key androidSettings. */ + public androidSettings?: (google.cloud.recaptchaenterprise.v1.IAndroidKeySettings|null); + + /** Key iosSettings. */ + public iosSettings?: (google.cloud.recaptchaenterprise.v1.IIOSKeySettings|null); + + /** Key labels. */ + public labels: { [k: string]: string }; + + /** Key createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Key platformSettings. */ + public platformSettings?: ("webSettings"|"androidSettings"|"iosSettings"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IKey): google.cloud.recaptchaenterprise.v1.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Key.verify|verify} messages. + * @param message Key message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Key message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Key.verify|verify} messages. + * @param message Key message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.Key; + + /** + * Decodes a Key message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.Key; + + /** + * Verifies a Key message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Key message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Key + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.Key; + + /** + * Creates a plain object from a Key message. Also converts values to other types if specified. + * @param message Key + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.Key, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Key to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebKeySettings. */ + interface IWebKeySettings { + + /** WebKeySettings allowAllDomains */ + allowAllDomains?: (boolean|null); + + /** WebKeySettings allowedDomains */ + allowedDomains?: (string[]|null); + + /** WebKeySettings allowAmpTraffic */ + allowAmpTraffic?: (boolean|null); + + /** WebKeySettings integrationType */ + integrationType?: (google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType|keyof typeof google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType|null); + + /** WebKeySettings challengeSecurityPreference */ + challengeSecurityPreference?: (google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference|keyof typeof google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference|null); + } + + /** Represents a WebKeySettings. */ + class WebKeySettings implements IWebKeySettings { + + /** + * Constructs a new WebKeySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IWebKeySettings); + + /** WebKeySettings allowAllDomains. */ + public allowAllDomains: boolean; + + /** WebKeySettings allowedDomains. */ + public allowedDomains: string[]; + + /** WebKeySettings allowAmpTraffic. */ + public allowAmpTraffic: boolean; + + /** WebKeySettings integrationType. */ + public integrationType: (google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType|keyof typeof google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType); + + /** WebKeySettings challengeSecurityPreference. */ + public challengeSecurityPreference: (google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference|keyof typeof google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference); + + /** + * Creates a new WebKeySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns WebKeySettings instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IWebKeySettings): google.cloud.recaptchaenterprise.v1.WebKeySettings; + + /** + * Encodes the specified WebKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WebKeySettings.verify|verify} messages. + * @param message WebKeySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IWebKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WebKeySettings.verify|verify} messages. + * @param message WebKeySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IWebKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebKeySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.WebKeySettings; + + /** + * Decodes a WebKeySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.WebKeySettings; + + /** + * Verifies a WebKeySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebKeySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebKeySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.WebKeySettings; + + /** + * Creates a plain object from a WebKeySettings message. Also converts values to other types if specified. + * @param message WebKeySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.WebKeySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebKeySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace WebKeySettings { + + /** IntegrationType enum. */ + enum IntegrationType { + INTEGRATION_TYPE_UNSPECIFIED = 0, + SCORE = 1, + CHECKBOX = 2, + INVISIBLE = 3 + } + + /** ChallengeSecurityPreference enum. */ + enum ChallengeSecurityPreference { + CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0, + USABILITY = 1, + BALANCE = 2, + SECURITY = 3 + } + } + + /** Properties of an AndroidKeySettings. */ + interface IAndroidKeySettings { + + /** AndroidKeySettings allowedPackageNames */ + allowedPackageNames?: (string[]|null); + } + + /** Represents an AndroidKeySettings. */ + class AndroidKeySettings implements IAndroidKeySettings { + + /** + * Constructs a new AndroidKeySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IAndroidKeySettings); + + /** AndroidKeySettings allowedPackageNames. */ + public allowedPackageNames: string[]; + + /** + * Creates a new AndroidKeySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns AndroidKeySettings instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IAndroidKeySettings): google.cloud.recaptchaenterprise.v1.AndroidKeySettings; + + /** + * Encodes the specified AndroidKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify|verify} messages. + * @param message AndroidKeySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IAndroidKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AndroidKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify|verify} messages. + * @param message AndroidKeySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IAndroidKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AndroidKeySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AndroidKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.AndroidKeySettings; + + /** + * Decodes an AndroidKeySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AndroidKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.AndroidKeySettings; + + /** + * Verifies an AndroidKeySettings message. + * @param message Plain 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 AndroidKeySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AndroidKeySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.AndroidKeySettings; + + /** + * Creates a plain object from an AndroidKeySettings message. Also converts values to other types if specified. + * @param message AndroidKeySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.AndroidKeySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AndroidKeySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a IOSKeySettings. */ + interface IIOSKeySettings { + + /** IOSKeySettings allowedBundleIds */ + allowedBundleIds?: (string[]|null); + } + + /** Represents a IOSKeySettings. */ + class IOSKeySettings implements IIOSKeySettings { + + /** + * Constructs a new IOSKeySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IIOSKeySettings); + + /** IOSKeySettings allowedBundleIds. */ + public allowedBundleIds: string[]; + + /** + * Creates a new IOSKeySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns IOSKeySettings instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IIOSKeySettings): google.cloud.recaptchaenterprise.v1.IOSKeySettings; + + /** + * Encodes the specified IOSKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify|verify} messages. + * @param message IOSKeySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IIOSKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IOSKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify|verify} messages. + * @param message IOSKeySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IIOSKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a IOSKeySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IOSKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.IOSKeySettings; + + /** + * Decodes a IOSKeySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IOSKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.IOSKeySettings; + + /** + * Verifies a IOSKeySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a IOSKeySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IOSKeySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.IOSKeySettings; + + /** + * Creates a plain object from a IOSKeySettings message. Also converts values to other types if specified. + * @param message IOSKeySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.IOSKeySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IOSKeySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + /** Namespace v1beta1. */ namespace v1beta1 { diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 584780d9f0c..9db953e4d87 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -57,6 +57,4538 @@ */ var recaptchaenterprise = {}; + recaptchaenterprise.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.recaptchaenterprise + * @namespace + */ + var v1 = {}; + + v1.RecaptchaEnterpriseService = (function() { + + /** + * Constructs a new RecaptchaEnterpriseService service. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a RecaptchaEnterpriseService + * @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 RecaptchaEnterpriseService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RecaptchaEnterpriseService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RecaptchaEnterpriseService; + + /** + * Creates new RecaptchaEnterpriseService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @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 {RecaptchaEnterpriseService} RPC service. Useful where requests and/or responses are streamed. + */ + RecaptchaEnterpriseService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#createAssessment}. + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @typedef CreateAssessmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1.Assessment} [response] Assessment + */ + + /** + * Calls CreateAssessment. + * @function createAssessment + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest} request CreateAssessmentRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateAssessmentCallback} callback Node-style callback called with the error, if any, and Assessment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseService.prototype.createAssessment = function createAssessment(request, callback) { + return this.rpcCall(createAssessment, $root.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest, $root.google.cloud.recaptchaenterprise.v1.Assessment, request, callback); + }, "name", { value: "CreateAssessment" }); + + /** + * Calls CreateAssessment. + * @function createAssessment + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest} request CreateAssessmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#annotateAssessment}. + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @typedef AnnotateAssessmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse} [response] AnnotateAssessmentResponse + */ + + /** + * Calls AnnotateAssessment. + * @function annotateAssessment + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest} request AnnotateAssessmentRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.AnnotateAssessmentCallback} callback Node-style callback called with the error, if any, and AnnotateAssessmentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseService.prototype.annotateAssessment = function annotateAssessment(request, callback) { + return this.rpcCall(annotateAssessment, $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest, $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse, request, callback); + }, "name", { value: "AnnotateAssessment" }); + + /** + * Calls AnnotateAssessment. + * @function annotateAssessment + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest} request AnnotateAssessmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#createKey}. + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @typedef CreateKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1.Key} [response] Key + */ + + /** + * Calls CreateKey. + * @function createKey + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.ICreateKeyRequest} request CreateKeyRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateKeyCallback} callback Node-style callback called with the error, if any, and Key + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseService.prototype.createKey = function createKey(request, callback) { + return this.rpcCall(createKey, $root.google.cloud.recaptchaenterprise.v1.CreateKeyRequest, $root.google.cloud.recaptchaenterprise.v1.Key, request, callback); + }, "name", { value: "CreateKey" }); + + /** + * Calls CreateKey. + * @function createKey + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.ICreateKeyRequest} request CreateKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#listKeys}. + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @typedef ListKeysCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1.ListKeysResponse} [response] ListKeysResponse + */ + + /** + * Calls ListKeys. + * @function listKeys + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IListKeysRequest} request ListKeysRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListKeysCallback} callback Node-style callback called with the error, if any, and ListKeysResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseService.prototype.listKeys = function listKeys(request, callback) { + return this.rpcCall(listKeys, $root.google.cloud.recaptchaenterprise.v1.ListKeysRequest, $root.google.cloud.recaptchaenterprise.v1.ListKeysResponse, request, callback); + }, "name", { value: "ListKeys" }); + + /** + * Calls ListKeys. + * @function listKeys + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IListKeysRequest} request ListKeysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#getKey}. + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @typedef GetKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1.Key} [response] Key + */ + + /** + * Calls GetKey. + * @function getKey + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IGetKeyRequest} request GetKeyRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetKeyCallback} callback Node-style callback called with the error, if any, and Key + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseService.prototype.getKey = function getKey(request, callback) { + return this.rpcCall(getKey, $root.google.cloud.recaptchaenterprise.v1.GetKeyRequest, $root.google.cloud.recaptchaenterprise.v1.Key, request, callback); + }, "name", { value: "GetKey" }); + + /** + * Calls GetKey. + * @function getKey + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IGetKeyRequest} request GetKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#updateKey}. + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @typedef UpdateKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1.Key} [response] Key + */ + + /** + * Calls UpdateKey. + * @function updateKey + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest} request UpdateKeyRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.UpdateKeyCallback} callback Node-style callback called with the error, if any, and Key + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseService.prototype.updateKey = function updateKey(request, callback) { + return this.rpcCall(updateKey, $root.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest, $root.google.cloud.recaptchaenterprise.v1.Key, request, callback); + }, "name", { value: "UpdateKey" }); + + /** + * Calls UpdateKey. + * @function updateKey + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest} request UpdateKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#deleteKey}. + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @typedef DeleteKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteKey. + * @function deleteKey + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest} request DeleteKeyRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.DeleteKeyCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseService.prototype.deleteKey = function deleteKey(request, callback) { + return this.rpcCall(deleteKey, $root.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteKey" }); + + /** + * Calls DeleteKey. + * @function deleteKey + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest} request DeleteKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RecaptchaEnterpriseService; + })(); + + v1.CreateAssessmentRequest = (function() { + + /** + * Properties of a CreateAssessmentRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface ICreateAssessmentRequest + * @property {string|null} [parent] CreateAssessmentRequest parent + * @property {google.cloud.recaptchaenterprise.v1.IAssessment|null} [assessment] CreateAssessmentRequest assessment + */ + + /** + * Constructs a new CreateAssessmentRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a CreateAssessmentRequest. + * @implements ICreateAssessmentRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest=} [properties] Properties to set + */ + function CreateAssessmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAssessmentRequest parent. + * @member {string} parent + * @memberof google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest + * @instance + */ + CreateAssessmentRequest.prototype.parent = ""; + + /** + * CreateAssessmentRequest assessment. + * @member {google.cloud.recaptchaenterprise.v1.IAssessment|null|undefined} assessment + * @memberof google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest + * @instance + */ + CreateAssessmentRequest.prototype.assessment = null; + + /** + * Creates a new CreateAssessmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest} CreateAssessmentRequest instance + */ + CreateAssessmentRequest.create = function create(properties) { + return new CreateAssessmentRequest(properties); + }; + + /** + * Encodes the specified CreateAssessmentRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest} message CreateAssessmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAssessmentRequest.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.assessment != null && message.hasOwnProperty("assessment")) + $root.google.cloud.recaptchaenterprise.v1.Assessment.encode(message.assessment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAssessmentRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest} message CreateAssessmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAssessmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAssessmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest} CreateAssessmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAssessmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.assessment = $root.google.cloud.recaptchaenterprise.v1.Assessment.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAssessmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest} CreateAssessmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAssessmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAssessmentRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAssessmentRequest.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.assessment != null && message.hasOwnProperty("assessment")) { + var error = $root.google.cloud.recaptchaenterprise.v1.Assessment.verify(message.assessment); + if (error) + return "assessment." + error; + } + return null; + }; + + /** + * Creates a CreateAssessmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest} CreateAssessmentRequest + */ + CreateAssessmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.assessment != null) { + if (typeof object.assessment !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest.assessment: object expected"); + message.assessment = $root.google.cloud.recaptchaenterprise.v1.Assessment.fromObject(object.assessment); + } + return message; + }; + + /** + * Creates a plain object from a CreateAssessmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest} message CreateAssessmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAssessmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.assessment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.assessment != null && message.hasOwnProperty("assessment")) + object.assessment = $root.google.cloud.recaptchaenterprise.v1.Assessment.toObject(message.assessment, options); + return object; + }; + + /** + * Converts this CreateAssessmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAssessmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateAssessmentRequest; + })(); + + v1.AnnotateAssessmentRequest = (function() { + + /** + * Properties of an AnnotateAssessmentRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IAnnotateAssessmentRequest + * @property {string|null} [name] AnnotateAssessmentRequest name + * @property {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation|null} [annotation] AnnotateAssessmentRequest annotation + */ + + /** + * Constructs a new AnnotateAssessmentRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents an AnnotateAssessmentRequest. + * @implements IAnnotateAssessmentRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest=} [properties] Properties to set + */ + function AnnotateAssessmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateAssessmentRequest name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest + * @instance + */ + AnnotateAssessmentRequest.prototype.name = ""; + + /** + * AnnotateAssessmentRequest annotation. + * @member {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} annotation + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest + * @instance + */ + AnnotateAssessmentRequest.prototype.annotation = 0; + + /** + * Creates a new AnnotateAssessmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest} AnnotateAssessmentRequest instance + */ + AnnotateAssessmentRequest.create = function create(properties) { + return new AnnotateAssessmentRequest(properties); + }; + + /** + * Encodes the specified AnnotateAssessmentRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest} message AnnotateAssessmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateAssessmentRequest.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.annotation != null && message.hasOwnProperty("annotation")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.annotation); + return writer; + }; + + /** + * Encodes the specified AnnotateAssessmentRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest} message AnnotateAssessmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateAssessmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateAssessmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest} AnnotateAssessmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateAssessmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.annotation = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateAssessmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest} AnnotateAssessmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateAssessmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateAssessmentRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateAssessmentRequest.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.annotation != null && message.hasOwnProperty("annotation")) + switch (message.annotation) { + default: + return "annotation: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates an AnnotateAssessmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest} AnnotateAssessmentRequest + */ + AnnotateAssessmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.annotation) { + case "ANNOTATION_UNSPECIFIED": + case 0: + message.annotation = 0; + break; + case "LEGITIMATE": + case 1: + message.annotation = 1; + break; + case "FRAUDULENT": + case 2: + message.annotation = 2; + break; + case "PASSWORD_CORRECT": + case 3: + message.annotation = 3; + break; + case "PASSWORD_INCORRECT": + case 4: + message.annotation = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnnotateAssessmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest} message AnnotateAssessmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateAssessmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.annotation = options.enums === String ? "ANNOTATION_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.annotation != null && message.hasOwnProperty("annotation")) + object.annotation = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation[message.annotation] : message.annotation; + return object; + }; + + /** + * Converts this AnnotateAssessmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest + * @instance + * @returns {Object.} JSON object + */ + AnnotateAssessmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Annotation enum. + * @name google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation + * @enum {string} + * @property {number} ANNOTATION_UNSPECIFIED=0 ANNOTATION_UNSPECIFIED value + * @property {number} LEGITIMATE=1 LEGITIMATE value + * @property {number} FRAUDULENT=2 FRAUDULENT value + * @property {number} PASSWORD_CORRECT=3 PASSWORD_CORRECT value + * @property {number} PASSWORD_INCORRECT=4 PASSWORD_INCORRECT value + */ + AnnotateAssessmentRequest.Annotation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANNOTATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "LEGITIMATE"] = 1; + values[valuesById[2] = "FRAUDULENT"] = 2; + values[valuesById[3] = "PASSWORD_CORRECT"] = 3; + values[valuesById[4] = "PASSWORD_INCORRECT"] = 4; + return values; + })(); + + return AnnotateAssessmentRequest; + })(); + + v1.AnnotateAssessmentResponse = (function() { + + /** + * Properties of an AnnotateAssessmentResponse. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IAnnotateAssessmentResponse + */ + + /** + * Constructs a new AnnotateAssessmentResponse. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents an AnnotateAssessmentResponse. + * @implements IAnnotateAssessmentResponse + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse=} [properties] Properties to set + */ + function AnnotateAssessmentResponse(properties) { + if (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 AnnotateAssessmentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse} AnnotateAssessmentResponse instance + */ + AnnotateAssessmentResponse.create = function create(properties) { + return new AnnotateAssessmentResponse(properties); + }; + + /** + * Encodes the specified AnnotateAssessmentResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse} message AnnotateAssessmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateAssessmentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AnnotateAssessmentResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse} message AnnotateAssessmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateAssessmentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateAssessmentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse} AnnotateAssessmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateAssessmentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateAssessmentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse} AnnotateAssessmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateAssessmentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateAssessmentResponse message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateAssessmentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AnnotateAssessmentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse} AnnotateAssessmentResponse + */ + AnnotateAssessmentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse) + return object; + return new $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse(); + }; + + /** + * Creates a plain object from an AnnotateAssessmentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse} message AnnotateAssessmentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateAssessmentResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AnnotateAssessmentResponse to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateAssessmentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateAssessmentResponse; + })(); + + v1.Assessment = (function() { + + /** + * Properties of an Assessment. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IAssessment + * @property {string|null} [name] Assessment name + * @property {google.cloud.recaptchaenterprise.v1.IEvent|null} [event] Assessment event + * @property {google.cloud.recaptchaenterprise.v1.IRiskAnalysis|null} [riskAnalysis] Assessment riskAnalysis + * @property {google.cloud.recaptchaenterprise.v1.ITokenProperties|null} [tokenProperties] Assessment tokenProperties + */ + + /** + * Constructs a new Assessment. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents an Assessment. + * @implements IAssessment + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IAssessment=} [properties] Properties to set + */ + function Assessment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Assessment name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @instance + */ + Assessment.prototype.name = ""; + + /** + * Assessment event. + * @member {google.cloud.recaptchaenterprise.v1.IEvent|null|undefined} event + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @instance + */ + Assessment.prototype.event = null; + + /** + * Assessment riskAnalysis. + * @member {google.cloud.recaptchaenterprise.v1.IRiskAnalysis|null|undefined} riskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @instance + */ + Assessment.prototype.riskAnalysis = null; + + /** + * Assessment tokenProperties. + * @member {google.cloud.recaptchaenterprise.v1.ITokenProperties|null|undefined} tokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @instance + */ + Assessment.prototype.tokenProperties = null; + + /** + * Creates a new Assessment instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAssessment=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.Assessment} Assessment instance + */ + Assessment.create = function create(properties) { + return new Assessment(properties); + }; + + /** + * Encodes the specified Assessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Assessment.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAssessment} message Assessment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Assessment.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.event != null && message.hasOwnProperty("event")) + $root.google.cloud.recaptchaenterprise.v1.Event.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.riskAnalysis != null && message.hasOwnProperty("riskAnalysis")) + $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.encode(message.riskAnalysis, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) + $root.google.cloud.recaptchaenterprise.v1.TokenProperties.encode(message.tokenProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Assessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Assessment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAssessment} message Assessment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Assessment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Assessment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.Assessment} Assessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Assessment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.Assessment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.event = $root.google.cloud.recaptchaenterprise.v1.Event.decode(reader, reader.uint32()); + break; + case 3: + message.riskAnalysis = $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.decode(reader, reader.uint32()); + break; + case 4: + message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Assessment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.Assessment} Assessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Assessment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Assessment message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Assessment.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.event != null && message.hasOwnProperty("event")) { + var error = $root.google.cloud.recaptchaenterprise.v1.Event.verify(message.event); + if (error) + return "event." + error; + } + if (message.riskAnalysis != null && message.hasOwnProperty("riskAnalysis")) { + var error = $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.verify(message.riskAnalysis); + if (error) + return "riskAnalysis." + error; + } + if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) { + var error = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.verify(message.tokenProperties); + if (error) + return "tokenProperties." + error; + } + return null; + }; + + /** + * Creates an Assessment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.Assessment} Assessment + */ + Assessment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.Assessment) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.Assessment(); + if (object.name != null) + message.name = String(object.name); + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.event: object expected"); + message.event = $root.google.cloud.recaptchaenterprise.v1.Event.fromObject(object.event); + } + if (object.riskAnalysis != null) { + if (typeof object.riskAnalysis !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.riskAnalysis: object expected"); + message.riskAnalysis = $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.fromObject(object.riskAnalysis); + } + if (object.tokenProperties != null) { + if (typeof object.tokenProperties !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.tokenProperties: object expected"); + message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.fromObject(object.tokenProperties); + } + return message; + }; + + /** + * Creates a plain object from an Assessment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @static + * @param {google.cloud.recaptchaenterprise.v1.Assessment} message Assessment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Assessment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.event = null; + object.riskAnalysis = null; + object.tokenProperties = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.event != null && message.hasOwnProperty("event")) + object.event = $root.google.cloud.recaptchaenterprise.v1.Event.toObject(message.event, options); + if (message.riskAnalysis != null && message.hasOwnProperty("riskAnalysis")) + object.riskAnalysis = $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.toObject(message.riskAnalysis, options); + if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) + object.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.toObject(message.tokenProperties, options); + return object; + }; + + /** + * Converts this Assessment to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @instance + * @returns {Object.} JSON object + */ + Assessment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Assessment; + })(); + + v1.Event = (function() { + + /** + * Properties of an Event. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IEvent + * @property {string|null} [token] Event token + * @property {string|null} [siteKey] Event siteKey + * @property {string|null} [userAgent] Event userAgent + * @property {string|null} [userIpAddress] Event userIpAddress + * @property {string|null} [expectedAction] Event expectedAction + */ + + /** + * Constructs a new Event. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents an Event. + * @implements IEvent + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IEvent=} [properties] Properties to set + */ + function Event(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Event token. + * @member {string} token + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @instance + */ + Event.prototype.token = ""; + + /** + * Event siteKey. + * @member {string} siteKey + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @instance + */ + Event.prototype.siteKey = ""; + + /** + * Event userAgent. + * @member {string} userAgent + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @instance + */ + Event.prototype.userAgent = ""; + + /** + * Event userIpAddress. + * @member {string} userIpAddress + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @instance + */ + Event.prototype.userIpAddress = ""; + + /** + * Event expectedAction. + * @member {string} expectedAction + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @instance + */ + Event.prototype.expectedAction = ""; + + /** + * Creates a new Event instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @static + * @param {google.cloud.recaptchaenterprise.v1.IEvent=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.Event} Event instance + */ + Event.create = function create(properties) { + return new Event(properties); + }; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Event.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @static + * @param {google.cloud.recaptchaenterprise.v1.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.token != null && message.hasOwnProperty("token")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); + if (message.siteKey != null && message.hasOwnProperty("siteKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.siteKey); + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userAgent); + if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.userIpAddress); + if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.expectedAction); + return writer; + }; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Event.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @static + * @param {google.cloud.recaptchaenterprise.v1.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Event message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.Event(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.token = reader.string(); + break; + case 2: + message.siteKey = reader.string(); + break; + case 3: + message.userAgent = reader.string(); + break; + case 4: + message.userIpAddress = reader.string(); + break; + case 5: + message.expectedAction = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Event message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Event.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + if (message.siteKey != null && message.hasOwnProperty("siteKey")) + if (!$util.isString(message.siteKey)) + return "siteKey: string expected"; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + if (!$util.isString(message.userAgent)) + return "userAgent: string expected"; + if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) + if (!$util.isString(message.userIpAddress)) + return "userIpAddress: string expected"; + if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) + if (!$util.isString(message.expectedAction)) + return "expectedAction: string expected"; + return null; + }; + + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.Event} Event + */ + Event.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.Event) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.Event(); + if (object.token != null) + message.token = String(object.token); + if (object.siteKey != null) + message.siteKey = String(object.siteKey); + if (object.userAgent != null) + message.userAgent = String(object.userAgent); + if (object.userIpAddress != null) + message.userIpAddress = String(object.userIpAddress); + if (object.expectedAction != null) + message.expectedAction = String(object.expectedAction); + return message; + }; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @static + * @param {google.cloud.recaptchaenterprise.v1.Event} message Event + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Event.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.token = ""; + object.siteKey = ""; + object.userAgent = ""; + object.userIpAddress = ""; + object.expectedAction = ""; + } + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + if (message.siteKey != null && message.hasOwnProperty("siteKey")) + object.siteKey = message.siteKey; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + object.userAgent = message.userAgent; + if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) + object.userIpAddress = message.userIpAddress; + if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) + object.expectedAction = message.expectedAction; + return object; + }; + + /** + * Converts this Event to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @instance + * @returns {Object.} JSON object + */ + Event.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Event; + })(); + + v1.RiskAnalysis = (function() { + + /** + * Properties of a RiskAnalysis. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IRiskAnalysis + * @property {number|null} [score] RiskAnalysis score + * @property {Array.|null} [reasons] RiskAnalysis reasons + */ + + /** + * Constructs a new RiskAnalysis. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a RiskAnalysis. + * @implements IRiskAnalysis + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis=} [properties] Properties to set + */ + function RiskAnalysis(properties) { + this.reasons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RiskAnalysis score. + * @member {number} score + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @instance + */ + RiskAnalysis.prototype.score = 0; + + /** + * RiskAnalysis reasons. + * @member {Array.} reasons + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @instance + */ + RiskAnalysis.prototype.reasons = $util.emptyArray; + + /** + * Creates a new RiskAnalysis instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @static + * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis instance + */ + RiskAnalysis.create = function create(properties) { + return new RiskAnalysis(properties); + }; + + /** + * Encodes the specified RiskAnalysis message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RiskAnalysis.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @static + * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis} message RiskAnalysis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RiskAnalysis.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + if (message.reasons != null && message.reasons.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.reasons.length; ++i) + writer.int32(message.reasons[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified RiskAnalysis message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RiskAnalysis.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @static + * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis} message RiskAnalysis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RiskAnalysis.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RiskAnalysis message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RiskAnalysis.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.score = reader.float(); + break; + case 2: + if (!(message.reasons && message.reasons.length)) + message.reasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.reasons.push(reader.int32()); + } else + message.reasons.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RiskAnalysis message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RiskAnalysis.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RiskAnalysis message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RiskAnalysis.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.reasons != null && message.hasOwnProperty("reasons")) { + if (!Array.isArray(message.reasons)) + return "reasons: array expected"; + for (var i = 0; i < message.reasons.length; ++i) + switch (message.reasons[i]) { + default: + return "reasons: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + } + return null; + }; + + /** + * Creates a RiskAnalysis message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis + */ + RiskAnalysis.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis(); + if (object.score != null) + message.score = Number(object.score); + if (object.reasons) { + if (!Array.isArray(object.reasons)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.RiskAnalysis.reasons: array expected"); + message.reasons = []; + for (var i = 0; i < object.reasons.length; ++i) + switch (object.reasons[i]) { + default: + case "CLASSIFICATION_REASON_UNSPECIFIED": + case 0: + message.reasons[i] = 0; + break; + case "AUTOMATION": + case 1: + message.reasons[i] = 1; + break; + case "UNEXPECTED_ENVIRONMENT": + case 2: + message.reasons[i] = 2; + break; + case "TOO_MUCH_TRAFFIC": + case 3: + message.reasons[i] = 3; + break; + case "UNEXPECTED_USAGE_PATTERNS": + case 4: + message.reasons[i] = 4; + break; + case "LOW_CONFIDENCE_SCORE": + case 5: + message.reasons[i] = 5; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a RiskAnalysis message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @static + * @param {google.cloud.recaptchaenterprise.v1.RiskAnalysis} message RiskAnalysis + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RiskAnalysis.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.reasons = []; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.reasons && message.reasons.length) { + object.reasons = []; + for (var j = 0; j < message.reasons.length; ++j) + object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason[message.reasons[j]] : message.reasons[j]; + } + return object; + }; + + /** + * Converts this RiskAnalysis to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @instance + * @returns {Object.} JSON object + */ + RiskAnalysis.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ClassificationReason enum. + * @name google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason + * @enum {string} + * @property {number} CLASSIFICATION_REASON_UNSPECIFIED=0 CLASSIFICATION_REASON_UNSPECIFIED value + * @property {number} AUTOMATION=1 AUTOMATION value + * @property {number} UNEXPECTED_ENVIRONMENT=2 UNEXPECTED_ENVIRONMENT value + * @property {number} TOO_MUCH_TRAFFIC=3 TOO_MUCH_TRAFFIC value + * @property {number} UNEXPECTED_USAGE_PATTERNS=4 UNEXPECTED_USAGE_PATTERNS value + * @property {number} LOW_CONFIDENCE_SCORE=5 LOW_CONFIDENCE_SCORE value + */ + RiskAnalysis.ClassificationReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLASSIFICATION_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTOMATION"] = 1; + values[valuesById[2] = "UNEXPECTED_ENVIRONMENT"] = 2; + values[valuesById[3] = "TOO_MUCH_TRAFFIC"] = 3; + values[valuesById[4] = "UNEXPECTED_USAGE_PATTERNS"] = 4; + values[valuesById[5] = "LOW_CONFIDENCE_SCORE"] = 5; + return values; + })(); + + return RiskAnalysis; + })(); + + v1.TokenProperties = (function() { + + /** + * Properties of a TokenProperties. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface ITokenProperties + * @property {boolean|null} [valid] TokenProperties valid + * @property {google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason|null} [invalidReason] TokenProperties invalidReason + * @property {google.protobuf.ITimestamp|null} [createTime] TokenProperties createTime + * @property {string|null} [hostname] TokenProperties hostname + * @property {string|null} [action] TokenProperties action + */ + + /** + * Constructs a new TokenProperties. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a TokenProperties. + * @implements ITokenProperties + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties=} [properties] Properties to set + */ + function TokenProperties(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenProperties valid. + * @member {boolean} valid + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @instance + */ + TokenProperties.prototype.valid = false; + + /** + * TokenProperties invalidReason. + * @member {google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason} invalidReason + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @instance + */ + TokenProperties.prototype.invalidReason = 0; + + /** + * TokenProperties createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @instance + */ + TokenProperties.prototype.createTime = null; + + /** + * TokenProperties hostname. + * @member {string} hostname + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @instance + */ + TokenProperties.prototype.hostname = ""; + + /** + * TokenProperties action. + * @member {string} action + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @instance + */ + TokenProperties.prototype.action = ""; + + /** + * Creates a new TokenProperties instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @static + * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties instance + */ + TokenProperties.create = function create(properties) { + return new TokenProperties(properties); + }; + + /** + * Encodes the specified TokenProperties message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TokenProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @static + * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties} message TokenProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.valid != null && message.hasOwnProperty("valid")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid); + if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.invalidReason); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.hostname != null && message.hasOwnProperty("hostname")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.hostname); + if (message.action != null && message.hasOwnProperty("action")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.action); + return writer; + }; + + /** + * Encodes the specified TokenProperties message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TokenProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @static + * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties} message TokenProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.TokenProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valid = reader.bool(); + break; + case 2: + message.invalidReason = reader.int32(); + break; + case 3: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.hostname = reader.string(); + break; + case 5: + message.action = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenProperties message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.valid != null && message.hasOwnProperty("valid")) + if (typeof message.valid !== "boolean") + return "valid: boolean expected"; + if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) + switch (message.invalidReason) { + default: + return "invalidReason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.hostname != null && message.hasOwnProperty("hostname")) + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + return null; + }; + + /** + * Creates a TokenProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties + */ + TokenProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.TokenProperties) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.TokenProperties(); + if (object.valid != null) + message.valid = Boolean(object.valid); + switch (object.invalidReason) { + case "INVALID_REASON_UNSPECIFIED": + case 0: + message.invalidReason = 0; + break; + case "UNKNOWN_INVALID_REASON": + case 1: + message.invalidReason = 1; + break; + case "MALFORMED": + case 2: + message.invalidReason = 2; + break; + case "EXPIRED": + case 3: + message.invalidReason = 3; + break; + case "DUPE": + case 4: + message.invalidReason = 4; + break; + case "MISSING": + case 5: + message.invalidReason = 5; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.TokenProperties.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.hostname != null) + message.hostname = String(object.hostname); + if (object.action != null) + message.action = String(object.action); + return message; + }; + + /** + * Creates a plain object from a TokenProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @static + * @param {google.cloud.recaptchaenterprise.v1.TokenProperties} message TokenProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.valid = false; + object.invalidReason = options.enums === String ? "INVALID_REASON_UNSPECIFIED" : 0; + object.createTime = null; + object.hostname = ""; + object.action = ""; + } + if (message.valid != null && message.hasOwnProperty("valid")) + object.valid = message.valid; + if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) + object.invalidReason = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason[message.invalidReason] : message.invalidReason; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.hostname != null && message.hasOwnProperty("hostname")) + object.hostname = message.hostname; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + return object; + }; + + /** + * Converts this TokenProperties to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @instance + * @returns {Object.} JSON object + */ + TokenProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * InvalidReason enum. + * @name google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason + * @enum {string} + * @property {number} INVALID_REASON_UNSPECIFIED=0 INVALID_REASON_UNSPECIFIED value + * @property {number} UNKNOWN_INVALID_REASON=1 UNKNOWN_INVALID_REASON value + * @property {number} MALFORMED=2 MALFORMED value + * @property {number} EXPIRED=3 EXPIRED value + * @property {number} DUPE=4 DUPE value + * @property {number} MISSING=5 MISSING value + */ + TokenProperties.InvalidReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INVALID_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNKNOWN_INVALID_REASON"] = 1; + values[valuesById[2] = "MALFORMED"] = 2; + values[valuesById[3] = "EXPIRED"] = 3; + values[valuesById[4] = "DUPE"] = 4; + values[valuesById[5] = "MISSING"] = 5; + return values; + })(); + + return TokenProperties; + })(); + + v1.CreateKeyRequest = (function() { + + /** + * Properties of a CreateKeyRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface ICreateKeyRequest + * @property {string|null} [parent] CreateKeyRequest parent + * @property {google.cloud.recaptchaenterprise.v1.IKey|null} [key] CreateKeyRequest key + */ + + /** + * Constructs a new CreateKeyRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a CreateKeyRequest. + * @implements ICreateKeyRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.ICreateKeyRequest=} [properties] Properties to set + */ + function CreateKeyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateKeyRequest parent. + * @member {string} parent + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @instance + */ + CreateKeyRequest.prototype.parent = ""; + + /** + * CreateKeyRequest key. + * @member {google.cloud.recaptchaenterprise.v1.IKey|null|undefined} key + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @instance + */ + CreateKeyRequest.prototype.key = null; + + /** + * Creates a new CreateKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.ICreateKeyRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.CreateKeyRequest} CreateKeyRequest instance + */ + CreateKeyRequest.create = function create(properties) { + return new CreateKeyRequest(properties); + }; + + /** + * Encodes the specified CreateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.CreateKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.ICreateKeyRequest} message CreateKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateKeyRequest.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.key != null && message.hasOwnProperty("key")) + $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.CreateKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.ICreateKeyRequest} message CreateKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.CreateKeyRequest} CreateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.CreateKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.key = $root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.CreateKeyRequest} CreateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateKeyRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateKeyRequest.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.key != null && message.hasOwnProperty("key")) { + var error = $root.google.cloud.recaptchaenterprise.v1.Key.verify(message.key); + if (error) + return "key." + error; + } + return null; + }; + + /** + * Creates a CreateKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.CreateKeyRequest} CreateKeyRequest + */ + CreateKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.CreateKeyRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.CreateKeyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.CreateKeyRequest.key: object expected"); + message.key = $root.google.cloud.recaptchaenterprise.v1.Key.fromObject(object.key); + } + return message; + }; + + /** + * Creates a plain object from a CreateKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.CreateKeyRequest} message CreateKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.key = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.google.cloud.recaptchaenterprise.v1.Key.toObject(message.key, options); + return object; + }; + + /** + * Converts this CreateKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateKeyRequest; + })(); + + v1.ListKeysRequest = (function() { + + /** + * Properties of a ListKeysRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IListKeysRequest + * @property {string|null} [parent] ListKeysRequest parent + * @property {number|null} [pageSize] ListKeysRequest pageSize + * @property {string|null} [pageToken] ListKeysRequest pageToken + */ + + /** + * Constructs a new ListKeysRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a ListKeysRequest. + * @implements IListKeysRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IListKeysRequest=} [properties] Properties to set + */ + function ListKeysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListKeysRequest parent. + * @member {string} parent + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @instance + */ + ListKeysRequest.prototype.parent = ""; + + /** + * ListKeysRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @instance + */ + ListKeysRequest.prototype.pageSize = 0; + + /** + * ListKeysRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @instance + */ + ListKeysRequest.prototype.pageToken = ""; + + /** + * Creates a new ListKeysRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListKeysRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysRequest} ListKeysRequest instance + */ + ListKeysRequest.create = function create(properties) { + return new ListKeysRequest(properties); + }; + + /** + * Encodes the specified ListKeysRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListKeysRequest} message ListKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKeysRequest.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); + return writer; + }; + + /** + * Encodes the specified ListKeysRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListKeysRequest} message ListKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListKeysRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysRequest} ListKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKeysRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.ListKeysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListKeysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysRequest} ListKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKeysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListKeysRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListKeysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListKeysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysRequest} ListKeysRequest + */ + ListKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ListKeysRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.ListKeysRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListKeysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.ListKeysRequest} message ListKeysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListKeysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListKeysRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @instance + * @returns {Object.} JSON object + */ + ListKeysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListKeysRequest; + })(); + + v1.ListKeysResponse = (function() { + + /** + * Properties of a ListKeysResponse. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IListKeysResponse + * @property {Array.|null} [keys] ListKeysResponse keys + * @property {string|null} [nextPageToken] ListKeysResponse nextPageToken + */ + + /** + * Constructs a new ListKeysResponse. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a ListKeysResponse. + * @implements IListKeysResponse + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse=} [properties] Properties to set + */ + function ListKeysResponse(properties) { + this.keys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListKeysResponse keys. + * @member {Array.} keys + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @instance + */ + ListKeysResponse.prototype.keys = $util.emptyArray; + + /** + * ListKeysResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @instance + */ + ListKeysResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListKeysResponse instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse instance + */ + ListKeysResponse.create = function create(properties) { + return new ListKeysResponse(properties); + }; + + /** + * Encodes the specified ListKeysResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse} message ListKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKeysResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.keys[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 ListKeysResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse} message ListKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListKeysResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKeysResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.ListKeysResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListKeysResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKeysResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListKeysResponse message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListKeysResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1.Key.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListKeysResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse + */ + ListKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ListKeysResponse) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.ListKeysResponse(); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.ListKeysResponse.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.ListKeysResponse.keys: object expected"); + message.keys[i] = $root.google.cloud.recaptchaenterprise.v1.Key.fromObject(object.keys[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListKeysResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.ListKeysResponse} message ListKeysResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListKeysResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keys = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.cloud.recaptchaenterprise.v1.Key.toObject(message.keys[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListKeysResponse to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @instance + * @returns {Object.} JSON object + */ + ListKeysResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListKeysResponse; + })(); + + v1.GetKeyRequest = (function() { + + /** + * Properties of a GetKeyRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IGetKeyRequest + * @property {string|null} [name] GetKeyRequest name + */ + + /** + * Constructs a new GetKeyRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a GetKeyRequest. + * @implements IGetKeyRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IGetKeyRequest=} [properties] Properties to set + */ + function GetKeyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetKeyRequest name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @instance + */ + GetKeyRequest.prototype.name = ""; + + /** + * Creates a new GetKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IGetKeyRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.GetKeyRequest} GetKeyRequest instance + */ + GetKeyRequest.create = function create(properties) { + return new GetKeyRequest(properties); + }; + + /** + * Encodes the specified GetKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IGetKeyRequest} message GetKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetKeyRequest.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 GetKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IGetKeyRequest} message GetKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.GetKeyRequest} GetKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.GetKeyRequest(); + 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 GetKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.GetKeyRequest} GetKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetKeyRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetKeyRequest.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 GetKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.GetKeyRequest} GetKeyRequest + */ + GetKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.GetKeyRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.GetKeyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.GetKeyRequest} message GetKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetKeyRequest.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 GetKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @instance + * @returns {Object.} JSON object + */ + GetKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetKeyRequest; + })(); + + v1.UpdateKeyRequest = (function() { + + /** + * Properties of an UpdateKeyRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IUpdateKeyRequest + * @property {google.cloud.recaptchaenterprise.v1.IKey|null} [key] UpdateKeyRequest key + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateKeyRequest updateMask + */ + + /** + * Constructs a new UpdateKeyRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents an UpdateKeyRequest. + * @implements IUpdateKeyRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest=} [properties] Properties to set + */ + function UpdateKeyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateKeyRequest key. + * @member {google.cloud.recaptchaenterprise.v1.IKey|null|undefined} key + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @instance + */ + UpdateKeyRequest.prototype.key = null; + + /** + * UpdateKeyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @instance + */ + UpdateKeyRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.UpdateKeyRequest} UpdateKeyRequest instance + */ + UpdateKeyRequest.create = function create(properties) { + return new UpdateKeyRequest(properties); + }; + + /** + * Encodes the specified UpdateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.UpdateKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest} message UpdateKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateKeyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && message.hasOwnProperty("key")) + $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.UpdateKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest} message UpdateKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.UpdateKeyRequest} UpdateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = $root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.UpdateKeyRequest} UpdateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateKeyRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateKeyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.google.cloud.recaptchaenterprise.v1.Key.verify(message.key); + if (error) + return "key." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.UpdateKeyRequest} UpdateKeyRequest + */ + UpdateKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.UpdateKeyRequest.key: object expected"); + message.key = $root.google.cloud.recaptchaenterprise.v1.Key.fromObject(object.key); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.UpdateKeyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.UpdateKeyRequest} message UpdateKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = null; + object.updateMask = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.google.cloud.recaptchaenterprise.v1.Key.toObject(message.key, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateKeyRequest; + })(); + + v1.DeleteKeyRequest = (function() { + + /** + * Properties of a DeleteKeyRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IDeleteKeyRequest + * @property {string|null} [name] DeleteKeyRequest name + */ + + /** + * Constructs a new DeleteKeyRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a DeleteKeyRequest. + * @implements IDeleteKeyRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest=} [properties] Properties to set + */ + function DeleteKeyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteKeyRequest name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @instance + */ + DeleteKeyRequest.prototype.name = ""; + + /** + * Creates a new DeleteKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.DeleteKeyRequest} DeleteKeyRequest instance + */ + DeleteKeyRequest.create = function create(properties) { + return new DeleteKeyRequest(properties); + }; + + /** + * Encodes the specified DeleteKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.DeleteKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest} message DeleteKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteKeyRequest.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 DeleteKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.DeleteKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest} message DeleteKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.DeleteKeyRequest} DeleteKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest(); + 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 DeleteKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.DeleteKeyRequest} DeleteKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteKeyRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteKeyRequest.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 DeleteKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.DeleteKeyRequest} DeleteKeyRequest + */ + DeleteKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.DeleteKeyRequest} message DeleteKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteKeyRequest.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 DeleteKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteKeyRequest; + })(); + + v1.Key = (function() { + + /** + * Properties of a Key. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IKey + * @property {string|null} [name] Key name + * @property {string|null} [displayName] Key displayName + * @property {google.cloud.recaptchaenterprise.v1.IWebKeySettings|null} [webSettings] Key webSettings + * @property {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings|null} [androidSettings] Key androidSettings + * @property {google.cloud.recaptchaenterprise.v1.IIOSKeySettings|null} [iosSettings] Key iosSettings + * @property {Object.|null} [labels] Key labels + * @property {google.protobuf.ITimestamp|null} [createTime] Key createTime + */ + + /** + * Constructs a new Key. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a Key. + * @implements IKey + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IKey=} [properties] Properties to set + */ + function Key(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Key name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.name = ""; + + /** + * Key displayName. + * @member {string} displayName + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.displayName = ""; + + /** + * Key webSettings. + * @member {google.cloud.recaptchaenterprise.v1.IWebKeySettings|null|undefined} webSettings + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.webSettings = null; + + /** + * Key androidSettings. + * @member {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings|null|undefined} androidSettings + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.androidSettings = null; + + /** + * Key iosSettings. + * @member {google.cloud.recaptchaenterprise.v1.IIOSKeySettings|null|undefined} iosSettings + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.iosSettings = null; + + /** + * Key labels. + * @member {Object.} labels + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.labels = $util.emptyObject; + + /** + * Key createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.createTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Key platformSettings. + * @member {"webSettings"|"androidSettings"|"iosSettings"|undefined} platformSettings + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Object.defineProperty(Key.prototype, "platformSettings", { + get: $util.oneOfGetter($oneOfFields = ["webSettings", "androidSettings", "iosSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {google.cloud.recaptchaenterprise.v1.IKey=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Key.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {google.cloud.recaptchaenterprise.v1.IKey} message Key message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.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.webSettings != null && message.hasOwnProperty("webSettings")) + $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.encode(message.webSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) + $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.encode(message.androidSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) + $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.encode(message.iosSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.labels != null && message.hasOwnProperty("labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Key message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Key.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {google.cloud.recaptchaenterprise.v1.IKey} message Key message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.Key(), 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: + message.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.decode(reader, reader.uint32()); + break; + case 4: + message.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.decode(reader, reader.uint32()); + break; + case 5: + message.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.decode(reader, reader.uint32()); + break; + case 6: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + break; + case 7: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Key message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Key message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Key.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.webSettings != null && message.hasOwnProperty("webSettings")) { + properties.platformSettings = 1; + { + var error = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.verify(message.webSettings); + if (error) + return "webSettings." + error; + } + } + if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) { + if (properties.platformSettings === 1) + return "platformSettings: multiple values"; + properties.platformSettings = 1; + { + var error = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify(message.androidSettings); + if (error) + return "androidSettings." + error; + } + } + if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) { + if (properties.platformSettings === 1) + return "platformSettings: multiple values"; + properties.platformSettings = 1; + { + var error = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify(message.iosSettings); + if (error) + return "iosSettings." + error; + } + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a Key message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.Key} Key + */ + Key.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.Key) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.Key(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.webSettings != null) { + if (typeof object.webSettings !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.webSettings: object expected"); + message.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.fromObject(object.webSettings); + } + if (object.androidSettings != null) { + if (typeof object.androidSettings !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.androidSettings: object expected"); + message.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.fromObject(object.androidSettings); + } + if (object.iosSettings != null) { + if (typeof object.iosSettings !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.iosSettings: object expected"); + message.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.fromObject(object.iosSettings); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.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.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a Key message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {google.cloud.recaptchaenterprise.v1.Key} message Key + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Key.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.webSettings != null && message.hasOwnProperty("webSettings")) { + object.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.toObject(message.webSettings, options); + if (options.oneofs) + object.platformSettings = "webSettings"; + } + if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) { + object.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.toObject(message.androidSettings, options); + if (options.oneofs) + object.platformSettings = "androidSettings"; + } + if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) { + object.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.toObject(message.iosSettings, options); + if (options.oneofs) + object.platformSettings = "iosSettings"; + } + 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.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this Key to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + * @returns {Object.} JSON object + */ + Key.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Key; + })(); + + v1.WebKeySettings = (function() { + + /** + * Properties of a WebKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IWebKeySettings + * @property {boolean|null} [allowAllDomains] WebKeySettings allowAllDomains + * @property {Array.|null} [allowedDomains] WebKeySettings allowedDomains + * @property {boolean|null} [allowAmpTraffic] WebKeySettings allowAmpTraffic + * @property {google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType|null} [integrationType] WebKeySettings integrationType + * @property {google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference|null} [challengeSecurityPreference] WebKeySettings challengeSecurityPreference + */ + + /** + * Constructs a new WebKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a WebKeySettings. + * @implements IWebKeySettings + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings=} [properties] Properties to set + */ + function WebKeySettings(properties) { + this.allowedDomains = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebKeySettings allowAllDomains. + * @member {boolean} allowAllDomains + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.allowAllDomains = false; + + /** + * WebKeySettings allowedDomains. + * @member {Array.} allowedDomains + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.allowedDomains = $util.emptyArray; + + /** + * WebKeySettings allowAmpTraffic. + * @member {boolean} allowAmpTraffic + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.allowAmpTraffic = false; + + /** + * WebKeySettings integrationType. + * @member {google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType} integrationType + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.integrationType = 0; + + /** + * WebKeySettings challengeSecurityPreference. + * @member {google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference} challengeSecurityPreference + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.challengeSecurityPreference = 0; + + /** + * Creates a new WebKeySettings instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings instance + */ + WebKeySettings.create = function create(properties) { + return new WebKeySettings(properties); + }; + + /** + * Encodes the specified WebKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WebKeySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings} message WebKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebKeySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedDomains != null && message.allowedDomains.length) + for (var i = 0; i < message.allowedDomains.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedDomains[i]); + if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAmpTraffic); + if (message.allowAllDomains != null && message.hasOwnProperty("allowAllDomains")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowAllDomains); + if (message.integrationType != null && message.hasOwnProperty("integrationType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.integrationType); + if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.challengeSecurityPreference); + return writer; + }; + + /** + * Encodes the specified WebKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WebKeySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings} message WebKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebKeySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebKeySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebKeySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.WebKeySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.allowAllDomains = reader.bool(); + break; + case 1: + if (!(message.allowedDomains && message.allowedDomains.length)) + message.allowedDomains = []; + message.allowedDomains.push(reader.string()); + break; + case 2: + message.allowAmpTraffic = reader.bool(); + break; + case 4: + message.integrationType = reader.int32(); + break; + case 5: + message.challengeSecurityPreference = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebKeySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebKeySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebKeySettings message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebKeySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAllDomains != null && message.hasOwnProperty("allowAllDomains")) + if (typeof message.allowAllDomains !== "boolean") + return "allowAllDomains: boolean expected"; + if (message.allowedDomains != null && message.hasOwnProperty("allowedDomains")) { + if (!Array.isArray(message.allowedDomains)) + return "allowedDomains: array expected"; + for (var i = 0; i < message.allowedDomains.length; ++i) + if (!$util.isString(message.allowedDomains[i])) + return "allowedDomains: string[] expected"; + } + if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) + if (typeof message.allowAmpTraffic !== "boolean") + return "allowAmpTraffic: boolean expected"; + if (message.integrationType != null && message.hasOwnProperty("integrationType")) + switch (message.integrationType) { + default: + return "integrationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) + switch (message.challengeSecurityPreference) { + default: + return "challengeSecurityPreference: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a WebKeySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings + */ + WebKeySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.WebKeySettings) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.WebKeySettings(); + if (object.allowAllDomains != null) + message.allowAllDomains = Boolean(object.allowAllDomains); + if (object.allowedDomains) { + if (!Array.isArray(object.allowedDomains)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.WebKeySettings.allowedDomains: array expected"); + message.allowedDomains = []; + for (var i = 0; i < object.allowedDomains.length; ++i) + message.allowedDomains[i] = String(object.allowedDomains[i]); + } + if (object.allowAmpTraffic != null) + message.allowAmpTraffic = Boolean(object.allowAmpTraffic); + switch (object.integrationType) { + case "INTEGRATION_TYPE_UNSPECIFIED": + case 0: + message.integrationType = 0; + break; + case "SCORE": + case 1: + message.integrationType = 1; + break; + case "CHECKBOX": + case 2: + message.integrationType = 2; + break; + case "INVISIBLE": + case 3: + message.integrationType = 3; + break; + } + switch (object.challengeSecurityPreference) { + case "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED": + case 0: + message.challengeSecurityPreference = 0; + break; + case "USABILITY": + case 1: + message.challengeSecurityPreference = 1; + break; + case "BALANCE": + case 2: + message.challengeSecurityPreference = 2; + break; + case "SECURITY": + case 3: + message.challengeSecurityPreference = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a WebKeySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.WebKeySettings} message WebKeySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebKeySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedDomains = []; + if (options.defaults) { + object.allowAmpTraffic = false; + object.allowAllDomains = false; + object.integrationType = options.enums === String ? "INTEGRATION_TYPE_UNSPECIFIED" : 0; + object.challengeSecurityPreference = options.enums === String ? "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED" : 0; + } + if (message.allowedDomains && message.allowedDomains.length) { + object.allowedDomains = []; + for (var j = 0; j < message.allowedDomains.length; ++j) + object.allowedDomains[j] = message.allowedDomains[j]; + } + if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) + object.allowAmpTraffic = message.allowAmpTraffic; + if (message.allowAllDomains != null && message.hasOwnProperty("allowAllDomains")) + object.allowAllDomains = message.allowAllDomains; + if (message.integrationType != null && message.hasOwnProperty("integrationType")) + object.integrationType = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType[message.integrationType] : message.integrationType; + if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) + object.challengeSecurityPreference = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference[message.challengeSecurityPreference] : message.challengeSecurityPreference; + return object; + }; + + /** + * Converts this WebKeySettings to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + * @returns {Object.} JSON object + */ + WebKeySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * IntegrationType enum. + * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType + * @enum {string} + * @property {number} INTEGRATION_TYPE_UNSPECIFIED=0 INTEGRATION_TYPE_UNSPECIFIED value + * @property {number} SCORE=1 SCORE value + * @property {number} CHECKBOX=2 CHECKBOX value + * @property {number} INVISIBLE=3 INVISIBLE value + */ + WebKeySettings.IntegrationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTEGRATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCORE"] = 1; + values[valuesById[2] = "CHECKBOX"] = 2; + values[valuesById[3] = "INVISIBLE"] = 3; + return values; + })(); + + /** + * ChallengeSecurityPreference enum. + * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference + * @enum {string} + * @property {number} CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED=0 CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED value + * @property {number} USABILITY=1 USABILITY value + * @property {number} BALANCE=2 BALANCE value + * @property {number} SECURITY=3 SECURITY value + */ + WebKeySettings.ChallengeSecurityPreference = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USABILITY"] = 1; + values[valuesById[2] = "BALANCE"] = 2; + values[valuesById[3] = "SECURITY"] = 3; + return values; + })(); + + return WebKeySettings; + })(); + + v1.AndroidKeySettings = (function() { + + /** + * Properties of an AndroidKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IAndroidKeySettings + * @property {Array.|null} [allowedPackageNames] AndroidKeySettings allowedPackageNames + */ + + /** + * Constructs a new AndroidKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents an AndroidKeySettings. + * @implements IAndroidKeySettings + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings=} [properties] Properties to set + */ + function AndroidKeySettings(properties) { + this.allowedPackageNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AndroidKeySettings allowedPackageNames. + * @member {Array.} allowedPackageNames + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @instance + */ + AndroidKeySettings.prototype.allowedPackageNames = $util.emptyArray; + + /** + * Creates a new AndroidKeySettings instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings instance + */ + AndroidKeySettings.create = function create(properties) { + return new AndroidKeySettings(properties); + }; + + /** + * Encodes the specified AndroidKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings} message AndroidKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AndroidKeySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedPackageNames != null && message.allowedPackageNames.length) + for (var i = 0; i < message.allowedPackageNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedPackageNames[i]); + return writer; + }; + + /** + * Encodes the specified AndroidKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings} message AndroidKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AndroidKeySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AndroidKeySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AndroidKeySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.allowedPackageNames && message.allowedPackageNames.length)) + message.allowedPackageNames = []; + message.allowedPackageNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AndroidKeySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AndroidKeySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AndroidKeySettings message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AndroidKeySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedPackageNames != null && message.hasOwnProperty("allowedPackageNames")) { + if (!Array.isArray(message.allowedPackageNames)) + return "allowedPackageNames: array expected"; + for (var i = 0; i < message.allowedPackageNames.length; ++i) + if (!$util.isString(message.allowedPackageNames[i])) + return "allowedPackageNames: string[] expected"; + } + return null; + }; + + /** + * Creates an AndroidKeySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings + */ + AndroidKeySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings(); + if (object.allowedPackageNames) { + if (!Array.isArray(object.allowedPackageNames)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.AndroidKeySettings.allowedPackageNames: array expected"); + message.allowedPackageNames = []; + for (var i = 0; i < object.allowedPackageNames.length; ++i) + message.allowedPackageNames[i] = String(object.allowedPackageNames[i]); + } + return message; + }; + + /** + * Creates a plain object from an AndroidKeySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} message AndroidKeySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AndroidKeySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedPackageNames = []; + if (message.allowedPackageNames && message.allowedPackageNames.length) { + object.allowedPackageNames = []; + for (var j = 0; j < message.allowedPackageNames.length; ++j) + object.allowedPackageNames[j] = message.allowedPackageNames[j]; + } + return object; + }; + + /** + * Converts this AndroidKeySettings to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @instance + * @returns {Object.} JSON object + */ + AndroidKeySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AndroidKeySettings; + })(); + + v1.IOSKeySettings = (function() { + + /** + * Properties of a IOSKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IIOSKeySettings + * @property {Array.|null} [allowedBundleIds] IOSKeySettings allowedBundleIds + */ + + /** + * Constructs a new IOSKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a IOSKeySettings. + * @implements IIOSKeySettings + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings=} [properties] Properties to set + */ + function IOSKeySettings(properties) { + this.allowedBundleIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IOSKeySettings allowedBundleIds. + * @member {Array.} allowedBundleIds + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @instance + */ + IOSKeySettings.prototype.allowedBundleIds = $util.emptyArray; + + /** + * Creates a new IOSKeySettings instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings instance + */ + IOSKeySettings.create = function create(properties) { + return new IOSKeySettings(properties); + }; + + /** + * Encodes the specified IOSKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings} message IOSKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IOSKeySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedBundleIds != null && message.allowedBundleIds.length) + for (var i = 0; i < message.allowedBundleIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedBundleIds[i]); + return writer; + }; + + /** + * Encodes the specified IOSKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings} message IOSKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IOSKeySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a IOSKeySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IOSKeySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.allowedBundleIds && message.allowedBundleIds.length)) + message.allowedBundleIds = []; + message.allowedBundleIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a IOSKeySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IOSKeySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a IOSKeySettings message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IOSKeySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedBundleIds != null && message.hasOwnProperty("allowedBundleIds")) { + if (!Array.isArray(message.allowedBundleIds)) + return "allowedBundleIds: array expected"; + for (var i = 0; i < message.allowedBundleIds.length; ++i) + if (!$util.isString(message.allowedBundleIds[i])) + return "allowedBundleIds: string[] expected"; + } + return null; + }; + + /** + * Creates a IOSKeySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings + */ + IOSKeySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings(); + if (object.allowedBundleIds) { + if (!Array.isArray(object.allowedBundleIds)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.IOSKeySettings.allowedBundleIds: array expected"); + message.allowedBundleIds = []; + for (var i = 0; i < object.allowedBundleIds.length; ++i) + message.allowedBundleIds[i] = String(object.allowedBundleIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a IOSKeySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IOSKeySettings} message IOSKeySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IOSKeySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedBundleIds = []; + if (message.allowedBundleIds && message.allowedBundleIds.length) { + object.allowedBundleIds = []; + for (var j = 0; j < message.allowedBundleIds.length; ++j) + object.allowedBundleIds[j] = message.allowedBundleIds[j]; + } + return object; + }; + + /** + * Converts this IOSKeySettings to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @instance + * @returns {Object.} JSON object + */ + IOSKeySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IOSKeySettings; + })(); + + return v1; + })(); + recaptchaenterprise.v1beta1 = (function() { /** diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index f71a34b50b6..371c77f638a 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -6,6 +6,483 @@ "nested": { "recaptchaenterprise": { "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.RecaptchaEnterprise.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1;recaptchaenterprise", + "java_multiple_files": true, + "java_outer_classname": "RecaptchaEnterpriseProto", + "java_package": "com.google.recaptchaenterprise.v1", + "objc_class_prefix": "GCRE", + "php_namespace": "Google\\Cloud\\RecaptchaEnterprise\\V1" + }, + "nested": { + "RecaptchaEnterpriseService": { + "options": { + "(google.api.default_host)": "recaptchaenterprise.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateAssessment": { + "requestType": "CreateAssessmentRequest", + "responseType": "Assessment", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/assessments", + "(google.api.http).body": "assessment", + "(google.api.method_signature)": "parent,assessment" + } + }, + "AnnotateAssessment": { + "requestType": "AnnotateAssessmentRequest", + "responseType": "AnnotateAssessmentResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/assessments/*}:annotate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,annotation" + } + }, + "CreateKey": { + "requestType": "CreateKeyRequest", + "responseType": "Key", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/keys", + "(google.api.http).body": "key" + } + }, + "ListKeys": { + "requestType": "ListKeysRequest", + "responseType": "ListKeysResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/keys" + } + }, + "GetKey": { + "requestType": "GetKeyRequest", + "responseType": "Key", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/keys/*}" + } + }, + "UpdateKey": { + "requestType": "UpdateKeyRequest", + "responseType": "Key", + "options": { + "(google.api.http).patch": "/v1/{key.name=projects/*/keys/*}", + "(google.api.http).body": "key" + } + }, + "DeleteKey": { + "requestType": "DeleteKeyRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/keys/*}" + } + } + } + }, + "CreateAssessmentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "assessment": { + "type": "Assessment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AnnotateAssessmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/Assessment" + } + }, + "annotation": { + "type": "Annotation", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Annotation": { + "values": { + "ANNOTATION_UNSPECIFIED": 0, + "LEGITIMATE": 1, + "FRAUDULENT": 2, + "PASSWORD_CORRECT": 3, + "PASSWORD_INCORRECT": 4 + } + } + } + }, + "AnnotateAssessmentResponse": { + "fields": {} + }, + "Assessment": { + "options": { + "(google.api.resource).type": "recaptchaenterprise.googleapis.com/Assessment", + "(google.api.resource).pattern": "projects/{project}/assessments/{assessment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "event": { + "type": "Event", + "id": 2 + }, + "riskAnalysis": { + "type": "RiskAnalysis", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tokenProperties": { + "type": "TokenProperties", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Event": { + "fields": { + "token": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "siteKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userAgent": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userIpAddress": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expectedAction": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RiskAnalysis": { + "fields": { + "score": { + "type": "float", + "id": 1 + }, + "reasons": { + "rule": "repeated", + "type": "ClassificationReason", + "id": 2 + } + }, + "nested": { + "ClassificationReason": { + "values": { + "CLASSIFICATION_REASON_UNSPECIFIED": 0, + "AUTOMATION": 1, + "UNEXPECTED_ENVIRONMENT": 2, + "TOO_MUCH_TRAFFIC": 3, + "UNEXPECTED_USAGE_PATTERNS": 4, + "LOW_CONFIDENCE_SCORE": 5 + } + } + } + }, + "TokenProperties": { + "fields": { + "valid": { + "type": "bool", + "id": 1 + }, + "invalidReason": { + "type": "InvalidReason", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "hostname": { + "type": "string", + "id": 4 + }, + "action": { + "type": "string", + "id": 5 + } + }, + "nested": { + "InvalidReason": { + "values": { + "INVALID_REASON_UNSPECIFIED": 0, + "UNKNOWN_INVALID_REASON": 1, + "MALFORMED": 2, + "EXPIRED": 3, + "DUPE": 4, + "MISSING": 5 + } + } + } + }, + "CreateKeyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "key": { + "type": "Key", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListKeysRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListKeysResponse": { + "fields": { + "keys": { + "rule": "repeated", + "type": "Key", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetKeyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/Key" + } + } + } + }, + "UpdateKeyRequest": { + "fields": { + "key": { + "type": "Key", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteKeyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/Key" + } + } + } + }, + "Key": { + "options": { + "(google.api.resource).type": "recaptchaenterprise.googleapis.com/Key", + "(google.api.resource).pattern": "projects/{project}/keys/{key}" + }, + "oneofs": { + "platformSettings": { + "oneof": [ + "webSettings", + "androidSettings", + "iosSettings" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "webSettings": { + "type": "WebKeySettings", + "id": 3 + }, + "androidSettings": { + "type": "AndroidKeySettings", + "id": 4 + }, + "iosSettings": { + "type": "IOSKeySettings", + "id": 5 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + } + } + }, + "WebKeySettings": { + "fields": { + "allowAllDomains": { + "type": "bool", + "id": 3 + }, + "allowedDomains": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "allowAmpTraffic": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "integrationType": { + "type": "IntegrationType", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "challengeSecurityPreference": { + "type": "ChallengeSecurityPreference", + "id": 5 + } + }, + "nested": { + "IntegrationType": { + "values": { + "INTEGRATION_TYPE_UNSPECIFIED": 0, + "SCORE": 1, + "CHECKBOX": 2, + "INVISIBLE": 3 + } + }, + "ChallengeSecurityPreference": { + "values": { + "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED": 0, + "USABILITY": 1, + "BALANCE": 2, + "SECURITY": 3 + } + } + } + }, + "AndroidKeySettings": { + "fields": { + "allowedPackageNames": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "IOSKeySettings": { + "fields": { + "allowedBundleIds": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, "v1beta1": { "options": { "csharp_namespace": "Google.Cloud.RecaptchaEnterprise.V1Beta1", diff --git a/packages/google-cloud-recaptchaenterprise/samples/quickstart.js b/packages/google-cloud-recaptchaenterprise/samples/quickstart.js index 170c97784f6..4785a4ef03a 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/quickstart.js +++ b/packages/google-cloud-recaptchaenterprise/samples/quickstart.js @@ -22,9 +22,9 @@ async function main(projectNumber) { // Create the reCAPTCHA client library. const { - RecaptchaEnterpriseServiceV1Beta1Client, + RecaptchaEnterpriseServiceClient, } = require('@google-cloud/recaptcha-enterprise'); - const client = new RecaptchaEnterpriseServiceV1Beta1Client(); + const client = new RecaptchaEnterpriseServiceClient(); // format the path to the project (it should be prefaced with projects/). const formattedParent = client.projectPath(projectNumber); diff --git a/packages/google-cloud-recaptchaenterprise/src/index.ts b/packages/google-cloud-recaptchaenterprise/src/index.ts index 2370fbef0ec..c250e370615 100644 --- a/packages/google-cloud-recaptchaenterprise/src/index.ts +++ b/packages/google-cloud-recaptchaenterprise/src/index.ts @@ -17,11 +17,23 @@ // ** All changes to this file may be overwritten. ** import * as v1beta1 from './v1beta1'; +import * as v1 from './v1'; const RecaptchaEnterpriseServiceV1Beta1Client = v1beta1.RecaptchaEnterpriseServiceV1Beta1Client; -export {v1beta1, RecaptchaEnterpriseServiceV1Beta1Client}; +const RecaptchaEnterpriseServiceClient = v1.RecaptchaEnterpriseServiceClient; +export { + v1, + v1beta1, + RecaptchaEnterpriseServiceV1Beta1Client, + RecaptchaEnterpriseServiceClient, +}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export -export default {v1beta1, RecaptchaEnterpriseServiceV1Beta1Client}; +export default { + v1, + v1beta1, + RecaptchaEnterpriseServiceV1Beta1Client, + RecaptchaEnterpriseServiceClient, +}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/index.ts b/packages/google-cloud-recaptchaenterprise/src/v1/index.ts new file mode 100644 index 00000000000..3759da4ef99 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/v1/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 {RecaptchaEnterpriseServiceClient} from './recaptcha_enterprise_service_client'; diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts new file mode 100644 index 00000000000..bf61e9dcd58 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -0,0 +1,1080 @@ +// 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 { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './recaptcha_enterprise_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service to determine the likelihood an event is legitimate. + * @class + * @memberof v1 + */ +export class RecaptchaEnterpriseServiceClient { + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + 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; + recaptchaEnterpriseServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RecaptchaEnterpriseServiceClient. + * + * @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 RecaptchaEnterpriseServiceClient; + 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 RecaptchaEnterpriseServiceClient).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 ? 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 = { + assessmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/assessments/{assessment}' + ), + keyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/keys/{key}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + }; + + // 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 = { + listKeys: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'keys' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService', + 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.recaptchaEnterpriseServiceStub) { + return this.recaptchaEnterpriseServiceStub; + } + + // Put together the "service stub" for + // google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService. + this.recaptchaEnterpriseServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService' + ) + : // tslint:disable-next-line no-any + (this._protos as any).google.cloud.recaptchaenterprise.v1 + .RecaptchaEnterpriseService, + 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 recaptchaEnterpriseServiceStubMethods = [ + 'createAssessment', + 'annotateAssessment', + 'createKey', + 'listKeys', + 'getKey', + 'updateKey', + 'deleteKey', + ]; + + for (const methodName of recaptchaEnterpriseServiceStubMethods) { + const innerCallPromise = this.recaptchaEnterpriseServiceStub.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( + innerCallPromise, + this._defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + + return this.recaptchaEnterpriseServiceStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'recaptchaenterprise.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'recaptchaenterprise.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 -- + // ------------------- + createAssessment( + request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1.IAssessment, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | undefined + ), + {} | undefined + ] + >; + createAssessment( + request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IAssessment, + | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates an Assessment of the likelihood an event is legitimate. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the assessment will be created, + * in the format "projects/{project}". + * @param {google.cloud.recaptchaenterprise.v1.Assessment} request.assessment + * Required. The assessment details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1.Assessment}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createAssessment( + request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IAssessment, + | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IAssessment, + | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1.IAssessment, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | 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.createAssessment(request, options, callback); + } + annotateAssessment( + request: protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | undefined + ), + {} | undefined + ] + >; + annotateAssessment( + request: protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + | protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | undefined, + {} | undefined + > + ): void; + /** + * Annotates a previously created Assessment to provide additional information + * on whether the event turned out to be authentic or fradulent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Assessment, in the format + * "projects/{project}/assessments/{assessment}". + * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} request.annotation + * Required. The annotation that will be assigned to the Event. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + annotateAssessment( + request: protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + | protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + | protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | 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.annotateAssessment(request, options, callback); + } + createKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1.IKey, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest + | undefined + ), + {} | undefined + ] + >; + createKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates a new reCAPTCHA Enterprise key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the key will be created, in the + * format "projects/{project}". + * @param {google.cloud.recaptchaenterprise.v1.Key} request.key + * Required. Information to create a reCAPTCHA Enterprise key. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1.IKey, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest + | 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.createKey(request, options, callback); + } + getKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1.IKey, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest + | undefined + ), + {} | undefined + ] + >; + getKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest + | undefined, + {} | undefined + > + ): void; + /** + * Returns the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the requested key, in the format + * "projects/{project}/keys/{key}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1.IKey, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest + | 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.getKey(request, options, callback); + } + updateKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1.IKey, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest + | undefined + ), + {} | undefined + ] + >; + updateKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.recaptchaenterprise.v1.Key} request.key + * Required. The key to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which field of the key get updated. If the mask is not + * present, all fields will be 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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IKey, + | protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1.IKey, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest + | 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({ + 'key.name': request.key!.name || '', + }); + this.initialize(); + return this._innerApiCalls.updateKey(request, options, callback); + } + deleteKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest + | undefined + ), + {} | undefined + ] + >; + deleteKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest + | undefined, + {} | undefined + > + ): void; + /** + * Deletes the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the key to be deleted, in the format + * "projects/{project}/keys/{key}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteKey( + request: protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest + | 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.deleteKey(request, options, callback); + } + + listKeys( + request: protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1.IKey[], + protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, + protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysResponse + ] + >; + listKeys( + request: protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IKey[], + protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, + protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysResponse + > + ): void; + /** + * Returns the list of all keys that belong to a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project that contains the keys that will be + * listed, in the format "projects/{project}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * 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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key} 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 [ListKeysRequest]{@link google.cloud.recaptchaenterprise.v1.ListKeysRequest} + * 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 + * [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1.ListKeysResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listKeys( + request: protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IKey[], + protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, + protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysResponse + >, + callback?: Callback< + protosTypes.google.cloud.recaptchaenterprise.v1.IKey[], + protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, + protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysResponse + > + ): Promise< + [ + protosTypes.google.cloud.recaptchaenterprise.v1.IKey[], + protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, + protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysResponse + ] + > | 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.listKeys(request, options, callback); + } + + /** + * Equivalent to {@link listKeys}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listKeys} 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 name of the project that contains the keys that will be + * listed, in the format "projects/{project}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key} on 'data' event. + */ + listKeysStream( + request?: protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + 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.listKeys.createStream( + this._innerApiCalls.listKeys as gax.GaxCall, + request, + callSettings + ); + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified assessment resource name string. + * + * @param {string} project + * @param {string} assessment + * @returns {string} Resource name string. + */ + assessmentPath(project: string, assessment: string) { + return this._pathTemplates.assessmentPathTemplate.render({ + project, + assessment, + }); + } + + /** + * Parse the project from Assessment resource. + * + * @param {string} assessmentName + * A fully-qualified path representing Assessment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAssessmentName(assessmentName: string) { + return this._pathTemplates.assessmentPathTemplate.match(assessmentName) + .project; + } + + /** + * Parse the assessment from Assessment resource. + * + * @param {string} assessmentName + * A fully-qualified path representing Assessment resource. + * @returns {string} A string representing the assessment. + */ + matchAssessmentFromAssessmentName(assessmentName: string) { + return this._pathTemplates.assessmentPathTemplate.match(assessmentName) + .assessment; + } + + /** + * Return a fully-qualified key resource name string. + * + * @param {string} project + * @param {string} key + * @returns {string} Resource name string. + */ + keyPath(project: string, key: string) { + return this._pathTemplates.keyPathTemplate.render({ + project, + key, + }); + } + + /** + * Parse the project from Key resource. + * + * @param {string} keyName + * A fully-qualified path representing Key resource. + * @returns {string} A string representing the project. + */ + matchProjectFromKeyName(keyName: string) { + return this._pathTemplates.keyPathTemplate.match(keyName).project; + } + + /** + * Parse the key from Key resource. + * + * @param {string} keyName + * A fully-qualified path representing Key resource. + * @returns {string} A string representing the key. + */ + matchKeyFromKeyName(keyName: string) { + return this._pathTemplates.keyPathTemplate.match(keyName).key; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this._pathTemplates.projectPathTemplate.render({ + project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this._pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * 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.recaptchaEnterpriseServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json new file mode 100644 index 00000000000..20e3110145b --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json @@ -0,0 +1,61 @@ +{ + "interfaces": { + "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService": { + "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": { + "CreateAssessment": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AnnotateAssessment": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateKey": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListKeys": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetKey": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateKey": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteKey": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_proto_list.json b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_proto_list.json new file mode 100644 index 00000000000..790fef960af --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto" +] diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/index.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/index.ts index 879b00358d3..1361289df05 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/index.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index b8c39a5f513..ab23a5c9229 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. @@ -40,7 +40,12 @@ const version = require('../../../package.json').version; * @memberof v1beta1 */ export class RecaptchaEnterpriseServiceV1Beta1Client { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; @@ -234,7 +239,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 40ceba48ec7..71b59f3756e 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,24 +1,26 @@ { - "updateTime": "2020-03-05T23:13:05.861046Z", + "updateTime": "2020-03-24T23:50:54.138889Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f0b581b5bdf803e45201ecdb3688b60e381628a8", - "internalRef": "299181282", - "log": "f0b581b5bdf803e45201ecdb3688b60e381628a8\nfix: recommendationengine/v1beta1 update some comments\n\nPiperOrigin-RevId: 299181282\n\n10e9a0a833dc85ff8f05b2c67ebe5ac785fe04ff\nbuild: add generated BUILD file for Routes Preferred API\n\nPiperOrigin-RevId: 299164808\n\n86738c956a8238d7c77f729be78b0ed887a6c913\npublish v1p1beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299152383\n\n73d9f2ad4591de45c2e1f352bc99d70cbd2a6d95\npublish v1: update with absolute address in comments\n\nPiperOrigin-RevId: 299147194\n\nd2158f24cb77b0b0ccfe68af784c6a628705e3c6\npublish v1beta2: update with absolute address in comments\n\nPiperOrigin-RevId: 299147086\n\n7fca61292c11b4cd5b352cee1a50bf88819dd63b\npublish v1p2beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146903\n\n583b7321624736e2c490e328f4b1957335779295\npublish v1p3beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146674\n\n638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\na78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n" - } - }, - { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2020.2.4" + "sha": "1df117114c73299b614dfd3ba3632bf246669336", + "internalRef": "302753982", + "log": "1df117114c73299b614dfd3ba3632bf246669336\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 302753982\n\n" } } ], "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "recaptchaenterprise", + "apiVersion": "v1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } + }, { "client": { "source": "googleapis", diff --git a/packages/google-cloud-recaptchaenterprise/synth.py b/packages/google-cloud-recaptchaenterprise/synth.py index d6e84fe668f..06139a40fd0 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.py +++ b/packages/google-cloud-recaptchaenterprise/synth.py @@ -22,7 +22,7 @@ # run the gapic generator gapic = gcp.GAPICMicrogenerator() -versions = ['v1beta1'] +versions = ['v1', 'v1beta1'] for version in versions: library = gapic.typescript_library( 'recaptchaenterprise', version, diff --git a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js index 3d40ab80e39..d0565cdf3b3 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts index 3f81a948f09..d010410b577 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-recaptchaenterprise/system-test/install.ts b/packages/google-cloud-recaptchaenterprise/system-test/install.ts index c9aa74ec221..c4d80e9c0c8 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/install.ts +++ b/packages/google-cloud-recaptchaenterprise/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service-v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service-v1.ts new file mode 100644 index 00000000000..f247b6b4201 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service-v1.ts @@ -0,0 +1,512 @@ +// 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const recaptchaenterpriseserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +describe('v1.RecaptchaEnterpriseServiceClient', () => { + it('has servicePath', () => { + const servicePath = + recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient + .servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = + recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + it('has initialize method and supports deferred initialization', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.recaptchaEnterpriseServiceStub, undefined); + await client.initialize(); + assert(client.recaptchaEnterpriseServiceStub); + }); + it('has close method', () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + describe('createAssessment', () => { + it('invokes createAssessment without error', done => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createAssessment = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createAssessment(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createAssessment with error', done => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createAssessment = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createAssessment(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('annotateAssessment', () => { + it('invokes annotateAssessment without error', done => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.annotateAssessment = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.annotateAssessment(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes annotateAssessment with error', done => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.annotateAssessment = mockSimpleGrpcMethod( + request, + null, + error + ); + client.annotateAssessment(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createKey', () => { + it('invokes createKey without error', done => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createKey = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createKey(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createKey with error', done => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createKey = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createKey(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getKey', () => { + it('invokes getKey without error', done => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getKey = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getKey(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getKey with error', done => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getKey = mockSimpleGrpcMethod(request, null, error); + client.getKey(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateKey', () => { + it('invokes updateKey without error', done => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest = {}; + request.key = {}; + request.key.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateKey = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateKey(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateKey with error', done => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest = {}; + request.key = {}; + request.key.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateKey = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateKey(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('deleteKey', () => { + it('invokes deleteKey without error', done => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteKey = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteKey(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteKey with error', done => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteKey = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteKey(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('listKeys', () => { + it('invokes listKeys without error', done => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listKeys = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listKeys(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listKeysStream', () => { + it('invokes listKeysStream without error', done => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listKeys = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listKeysStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); +}); diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts index 228bafee487..d11960920f6 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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. diff --git a/packages/google-cloud-recaptchaenterprise/webpack.config.js b/packages/google-cloud-recaptchaenterprise/webpack.config.js index d49627b5ae2..2435e0e2d56 100644 --- a/packages/google-cloud-recaptchaenterprise/webpack.config.js +++ b/packages/google-cloud-recaptchaenterprise/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2019 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. From 7b98a1217b1c741a85b02391af6d859e92aa157f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2020 00:14:07 +0000 Subject: [PATCH 093/253] chore: release 1.8.0 (#142) :robot: I have created a release \*beep\* \*boop\* --- ## [1.8.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.7.0...v1.8.0) (2020-03-25) ### Features * add the v1 API surface ([#141](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/141)) ([bb1bd33](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/bb1bd33c1f51d37ca8db15ce7579259560250530)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 5972875e007..0cf0a50a565 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [1.8.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.7.0...v1.8.0) (2020-03-25) + + +### Features + +* add the v1 API surface ([#141](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/141)) ([bb1bd33](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/bb1bd33c1f51d37ca8db15ce7579259560250530)) + ## [1.7.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.6.0...v1.7.0) (2020-03-10) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 370fff26b72..4aee31aa7b4 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.7.0", + "version": "1.8.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 3ba7793a834..5f04ee99452 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.7.0" + "@google-cloud/recaptcha-enterprise": "^1.8.0" }, "devDependencies": { "chai": "^4.2.0", From ec36b4628a29d203158e6ebe9066ae35bbc18443 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 31 Mar 2020 13:45:19 -0700 Subject: [PATCH 094/253] feat!: drop node8 support, support for async iterators (#145) BREAKING CHANGE: The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. New feature: methods with pagination now support async iteration. --- .../.eslintrc.json | 3 + .../.eslintrc.yml | 15 - .../.prettierrc | 8 - .../.prettierrc.js | 17 + .../package.json | 10 +- .../v1/recaptcha_enterprise_service_client.ts | 496 +++--- ...tcha_enterprise_service_v1_beta1_client.ts | 472 ++++-- .../synth.metadata | 13 +- .../system-test/fixtures/sample/src/index.js | 1 - .../system-test/fixtures/sample/src/index.ts | 2 +- .../gapic-recaptcha_enterprise_service-v1.ts | 512 ------ ...cha_enterprise_service_v1_beta1-v1beta1.ts | 513 ------ .../gapic_recaptcha_enterprise_service_v1.ts | 1389 ++++++++++++++++ ...cha_enterprise_service_v1_beta1_v1beta1.ts | 1392 +++++++++++++++++ .../webpack.config.js | 12 +- 15 files changed, 3421 insertions(+), 1434 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/.eslintrc.json delete mode 100644 packages/google-cloud-recaptchaenterprise/.eslintrc.yml delete mode 100644 packages/google-cloud-recaptchaenterprise/.prettierrc create mode 100644 packages/google-cloud-recaptchaenterprise/.prettierrc.js delete mode 100644 packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service-v1.ts delete mode 100644 packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts create mode 100644 packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts create mode 100644 packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts diff --git a/packages/google-cloud-recaptchaenterprise/.eslintrc.json b/packages/google-cloud-recaptchaenterprise/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-recaptchaenterprise/.eslintrc.yml b/packages/google-cloud-recaptchaenterprise/.eslintrc.yml deleted file mode 100644 index 73eeec27612..00000000000 --- a/packages/google-cloud-recaptchaenterprise/.eslintrc.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -extends: - - 'eslint:recommended' - - 'plugin:node/recommended' - - prettier -plugins: - - node - - prettier -rules: - prettier/prettier: error - block-scoped-var: error - eqeqeq: error - no-warning-comments: warn - no-var: error - prefer-const: error diff --git a/packages/google-cloud-recaptchaenterprise/.prettierrc b/packages/google-cloud-recaptchaenterprise/.prettierrc deleted file mode 100644 index df6eac07446..00000000000 --- a/packages/google-cloud-recaptchaenterprise/.prettierrc +++ /dev/null @@ -1,8 +0,0 @@ ---- -bracketSpacing: false -printWidth: 80 -semi: true -singleQuote: true -tabWidth: 2 -trailingComma: es5 -useTabs: false diff --git a/packages/google-cloud-recaptchaenterprise/.prettierrc.js b/packages/google-cloud-recaptchaenterprise/.prettierrc.js new file mode 100644 index 00000000000..08cba3775be --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/.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-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 4aee31aa7b4..33ceb237633 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -25,17 +25,18 @@ "reCAPTCHA Enterprise API" ], "dependencies": { - "google-gax": "^1.9.0" + "google-gax": "^2.0.1" }, "devDependencies": { "@types/mocha": "^7.0.0", "@types/node": "^12.0.0", + "@types/sinon": "^7.5.2", "c8": "^7.0.0", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", - "gts": "^1.0.0", + "gts": "2.0.0-alpha.9", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", @@ -44,8 +45,9 @@ "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", "prettier": "^1.17.1", + "sinon": "^9.0.1", "ts-loader": "^6.2.1", - "typescript": "^3.7.0", + "typescript": "^3.8.3", "webpack": "^4.41.2", "webpack-cli": "^3.3.10" }, @@ -66,6 +68,6 @@ }, "license": "Apache-2.0", "engines": { - "node": ">=8.10.0" + "node": ">=10" } } diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index bf61e9dcd58..57d53669357 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -18,18 +18,18 @@ import * as gax from 'google-gax'; import { - APICallback, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, - PaginationResponse, + GaxCall, } from 'google-gax'; import * as path from 'path'; import {Transform} from 'stream'; -import * as protosTypes from '../../protos/protos'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './recaptcha_enterprise_service_client_config.json'; const version = require('../../../package.json').version; @@ -40,14 +40,6 @@ const version = require('../../../package.json').version; * @memberof v1 */ export class RecaptchaEnterpriseServiceClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; - private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -55,6 +47,14 @@ export class RecaptchaEnterpriseServiceClient { 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}; recaptchaEnterpriseServiceStub?: Promise<{[name: string]: Function}>; /** @@ -148,13 +148,16 @@ export class RecaptchaEnterpriseServiceClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + 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 = { + this.pathTemplates = { assessmentPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/assessments/{assessment}' ), @@ -169,7 +172,7 @@ export class RecaptchaEnterpriseServiceClient { // 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 = { + this.descriptors.page = { listKeys: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -188,7 +191,7 @@ export class RecaptchaEnterpriseServiceClient { // 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 = {}; + this.innerApiCalls = {}; } /** @@ -215,7 +218,7 @@ export class RecaptchaEnterpriseServiceClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService' ) - : // tslint:disable-next-line no-any + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.recaptchaenterprise.v1 .RecaptchaEnterpriseService, this._opts @@ -232,9 +235,8 @@ export class RecaptchaEnterpriseServiceClient { 'updateKey', 'deleteKey', ]; - for (const methodName of recaptchaEnterpriseServiceStubMethods) { - const innerCallPromise = this.recaptchaEnterpriseServiceStub.then( + const callPromise = this.recaptchaEnterpriseServiceStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -248,20 +250,14 @@ export class RecaptchaEnterpriseServiceClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.recaptchaEnterpriseServiceStub; @@ -318,26 +314,37 @@ export class RecaptchaEnterpriseServiceClient { // -- Service calls -- // ------------------- createAssessment( - request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1.IAssessment, + protos.google.cloud.recaptchaenterprise.v1.IAssessment, ( - | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest | undefined ), {} | undefined ] >; createAssessment( - request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IAssessment, - | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + protos.google.cloud.recaptchaenterprise.v1.IAssessment, + | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + createAssessment( + request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAssessment, + | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -357,26 +364,28 @@ export class RecaptchaEnterpriseServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createAssessment( - request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IAssessment, - | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + protos.google.cloud.recaptchaenterprise.v1.IAssessment, + | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IAssessment, - | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + protos.google.cloud.recaptchaenterprise.v1.IAssessment, + | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1.IAssessment, + protos.google.cloud.recaptchaenterprise.v1.IAssessment, ( - | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest | undefined ), {} | undefined @@ -399,29 +408,40 @@ export class RecaptchaEnterpriseServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createAssessment(request, options, callback); + return this.innerApiCalls.createAssessment(request, options, callback); } annotateAssessment( - request: protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, ( - | protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest | undefined ), {} | undefined ] >; annotateAssessment( - request: protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, - | protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + annotateAssessment( + request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -442,26 +462,28 @@ export class RecaptchaEnterpriseServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ annotateAssessment( - request: protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, - | protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, - | protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, ( - | protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest | undefined ), {} | undefined @@ -484,29 +506,37 @@ export class RecaptchaEnterpriseServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.annotateAssessment(request, options, callback); + return this.innerApiCalls.annotateAssessment(request, options, callback); } createKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1.IKey, - ( - | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest - | undefined - ), + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest | undefined, {} | undefined ] >; createKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + createKey( + request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -526,28 +556,27 @@ export class RecaptchaEnterpriseServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1.IKey, - ( - | protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest - | undefined - ), + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest | undefined, {} | undefined ] > | void { @@ -568,29 +597,37 @@ export class RecaptchaEnterpriseServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createKey(request, options, callback); + return this.innerApiCalls.createKey(request, options, callback); } getKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1.IKey, - ( - | protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest - | undefined - ), + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest | undefined, {} | undefined ] >; getKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + getKey( + request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -608,28 +645,27 @@ export class RecaptchaEnterpriseServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1.IKey, - ( - | protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest - | undefined - ), + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest | undefined, {} | undefined ] > | void { @@ -650,29 +686,37 @@ export class RecaptchaEnterpriseServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getKey(request, options, callback); + return this.innerApiCalls.getKey(request, options, callback); } updateKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1.IKey, - ( - | protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest - | undefined - ), + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest | undefined, {} | undefined ] >; updateKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + updateKey( + request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -692,28 +736,27 @@ export class RecaptchaEnterpriseServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1.IKey, - ( - | protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest - | undefined - ), + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest | undefined, {} | undefined ] > | void { @@ -734,29 +777,37 @@ export class RecaptchaEnterpriseServiceClient { 'key.name': request.key!.name || '', }); this.initialize(); - return this._innerApiCalls.updateKey(request, options, callback); + return this.innerApiCalls.updateKey(request, options, callback); } deleteKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.protobuf.IEmpty, - ( - | protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest - | undefined - ), + protos.google.protobuf.IEmpty, + protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest | undefined, {} | undefined ] >; deleteKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.protobuf.IEmpty, - | protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest + protos.google.protobuf.IEmpty, + | protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + deleteKey( + request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -774,28 +825,27 @@ export class RecaptchaEnterpriseServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ deleteKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.protobuf.IEmpty, - | protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest + protos.google.protobuf.IEmpty, + | protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.protobuf.IEmpty, - | protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest + protos.google.protobuf.IEmpty, + | protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.protobuf.IEmpty, - ( - | protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest - | undefined - ), + protos.google.protobuf.IEmpty, + protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest | undefined, {} | undefined ] > | void { @@ -816,26 +866,38 @@ export class RecaptchaEnterpriseServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.deleteKey(request, options, callback); + return this.innerApiCalls.deleteKey(request, options, callback); } listKeys( - request: protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1.IKey[], - protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, - protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysResponse + protos.google.cloud.recaptchaenterprise.v1.IKey[], + protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, + protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse ] >; listKeys( - request: protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IKey[], - protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, - protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysResponse + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IKey + > + ): void; + listKeys( + request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IKey > ): void; /** @@ -871,24 +933,28 @@ export class RecaptchaEnterpriseServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listKeys( - request: protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IKey[], - protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, - protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysResponse + | PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IKey >, - callback?: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1.IKey[], - protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, - protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysResponse + callback?: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IKey > ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1.IKey[], - protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, - protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysResponse + protos.google.cloud.recaptchaenterprise.v1.IKey[], + protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, + protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse ] > | void { request = request || {}; @@ -908,7 +974,7 @@ export class RecaptchaEnterpriseServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listKeys(request, options, callback); + return this.innerApiCalls.listKeys(request, options, callback); } /** @@ -941,7 +1007,7 @@ export class RecaptchaEnterpriseServiceClient { * An object stream which emits an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key} on 'data' event. */ listKeysStream( - request?: protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -955,12 +1021,56 @@ export class RecaptchaEnterpriseServiceClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.listKeys.createStream( - this._innerApiCalls.listKeys as gax.GaxCall, + return this.descriptors.page.listKeys.createStream( + this.innerApiCalls.listKeys as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link listKeys}, 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 name of the project that contains the keys that will be + * listed, in the format "projects/{project}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @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. + */ + listKeysAsync( + request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + 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.listKeys.asyncIterate( + this.innerApiCalls['listKeys'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- @@ -973,9 +1083,9 @@ export class RecaptchaEnterpriseServiceClient { * @returns {string} Resource name string. */ assessmentPath(project: string, assessment: string) { - return this._pathTemplates.assessmentPathTemplate.render({ - project, - assessment, + return this.pathTemplates.assessmentPathTemplate.render({ + project: project, + assessment: assessment, }); } @@ -987,7 +1097,7 @@ export class RecaptchaEnterpriseServiceClient { * @returns {string} A string representing the project. */ matchProjectFromAssessmentName(assessmentName: string) { - return this._pathTemplates.assessmentPathTemplate.match(assessmentName) + return this.pathTemplates.assessmentPathTemplate.match(assessmentName) .project; } @@ -999,7 +1109,7 @@ export class RecaptchaEnterpriseServiceClient { * @returns {string} A string representing the assessment. */ matchAssessmentFromAssessmentName(assessmentName: string) { - return this._pathTemplates.assessmentPathTemplate.match(assessmentName) + return this.pathTemplates.assessmentPathTemplate.match(assessmentName) .assessment; } @@ -1011,9 +1121,9 @@ export class RecaptchaEnterpriseServiceClient { * @returns {string} Resource name string. */ keyPath(project: string, key: string) { - return this._pathTemplates.keyPathTemplate.render({ - project, - key, + return this.pathTemplates.keyPathTemplate.render({ + project: project, + key: key, }); } @@ -1025,7 +1135,7 @@ export class RecaptchaEnterpriseServiceClient { * @returns {string} A string representing the project. */ matchProjectFromKeyName(keyName: string) { - return this._pathTemplates.keyPathTemplate.match(keyName).project; + return this.pathTemplates.keyPathTemplate.match(keyName).project; } /** @@ -1036,7 +1146,7 @@ export class RecaptchaEnterpriseServiceClient { * @returns {string} A string representing the key. */ matchKeyFromKeyName(keyName: string) { - return this._pathTemplates.keyPathTemplate.match(keyName).key; + return this.pathTemplates.keyPathTemplate.match(keyName).key; } /** @@ -1046,8 +1156,8 @@ export class RecaptchaEnterpriseServiceClient { * @returns {string} Resource name string. */ projectPath(project: string) { - return this._pathTemplates.projectPathTemplate.render({ - project, + return this.pathTemplates.projectPathTemplate.render({ + project: project, }); } @@ -1059,7 +1169,7 @@ export class RecaptchaEnterpriseServiceClient { * @returns {string} A string representing the project. */ matchProjectFromProjectName(projectName: string) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; + return this.pathTemplates.projectPathTemplate.match(projectName).project; } /** diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index ab23a5c9229..fbbfc223310 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -18,18 +18,18 @@ import * as gax from 'google-gax'; import { - APICallback, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, - PaginationResponse, + GaxCall, } from 'google-gax'; import * as path from 'path'; import {Transform} from 'stream'; -import * as protosTypes from '../../protos/protos'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './recaptcha_enterprise_service_v1_beta1_client_config.json'; const version = require('../../../package.json').version; @@ -40,14 +40,6 @@ const version = require('../../../package.json').version; * @memberof v1beta1 */ export class RecaptchaEnterpriseServiceV1Beta1Client { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; - private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -55,6 +47,14 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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}; recaptchaEnterpriseServiceV1Beta1Stub?: Promise<{[name: string]: Function}>; /** @@ -148,13 +148,16 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + 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 = { + this.pathTemplates = { assessmentPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/assessments/{assessment}' ), @@ -169,7 +172,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // 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 = { + this.descriptors.page = { listKeys: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -188,7 +191,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // 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 = {}; + this.innerApiCalls = {}; } /** @@ -215,7 +218,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1' ) - : // tslint:disable-next-line no-any + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.recaptchaenterprise.v1beta1 .RecaptchaEnterpriseServiceV1Beta1, this._opts @@ -232,9 +235,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 'updateKey', 'deleteKey', ]; - for (const methodName of recaptchaEnterpriseServiceV1Beta1StubMethods) { - const innerCallPromise = this.recaptchaEnterpriseServiceV1Beta1Stub.then( + const callPromise = this.recaptchaEnterpriseServiceV1Beta1Stub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -248,20 +250,14 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.recaptchaEnterpriseServiceV1Beta1Stub; @@ -318,26 +314,37 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // -- Service calls -- // ------------------- createAssessment( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, ( - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest | undefined ), {} | undefined ] >; createAssessment( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAssessment, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + createAssessment( + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -357,26 +364,28 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * The promise has a method named "cancel" which cancels the ongoing API call. */ createAssessment( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAssessment, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAssessment, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, ( - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest | undefined ), {} | undefined @@ -399,29 +408,40 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createAssessment(request, options, callback); + return this.innerApiCalls.createAssessment(request, options, callback); } annotateAssessment( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, ( - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest | undefined ), {} | undefined ] >; annotateAssessment( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + annotateAssessment( + request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -442,26 +462,28 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * The promise has a method named "cancel" which cancels the ongoing API call. */ annotateAssessment( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, ( - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest | undefined ), {} | undefined @@ -484,29 +506,40 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.annotateAssessment(request, options, callback); + return this.innerApiCalls.annotateAssessment(request, options, callback); } createKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, ( - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest | undefined ), {} | undefined ] >; createKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + createKey( + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -526,26 +559,28 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * The promise has a method named "cancel" which cancels the ongoing API call. */ createKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, ( - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest | undefined ), {} | undefined @@ -568,29 +603,40 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createKey(request, options, callback); + return this.innerApiCalls.createKey(request, options, callback); } getKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, ( - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest | undefined ), {} | undefined ] >; getKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + getKey( + request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -608,26 +654,28 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * The promise has a method named "cancel" which cancels the ongoing API call. */ getKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, ( - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest | undefined ), {} | undefined @@ -650,29 +698,40 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getKey(request, options, callback); + return this.innerApiCalls.getKey(request, options, callback); } updateKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, ( - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest | undefined ), {} | undefined ] >; updateKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + updateKey( + request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -692,26 +751,28 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, ( - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest | undefined ), {} | undefined @@ -734,29 +795,40 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 'key.name': request.key!.name || '', }); this.initialize(); - return this._innerApiCalls.updateKey(request, options, callback); + return this.innerApiCalls.updateKey(request, options, callback); } deleteKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.protobuf.IEmpty, + protos.google.protobuf.IEmpty, ( - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest | undefined ), {} | undefined ] >; deleteKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.protobuf.IEmpty, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + protos.google.protobuf.IEmpty, + | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + deleteKey( + request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -774,26 +846,28 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * The promise has a method named "cancel" which cancels the ongoing API call. */ deleteKey( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.protobuf.IEmpty, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + protos.google.protobuf.IEmpty, + | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.protobuf.IEmpty, - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + protos.google.protobuf.IEmpty, + | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.protobuf.IEmpty, + protos.google.protobuf.IEmpty, ( - | protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest | undefined ), {} | undefined @@ -816,26 +890,38 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.deleteKey(request, options, callback); + return this.innerApiCalls.deleteKey(request, options, callback); } listKeys( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey[], - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + protos.google.cloud.recaptchaenterprise.v1beta1.IKey[], + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse ] >; listKeys( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey[], - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey + > + ): void; + listKeys( + request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey > ): void; /** @@ -871,24 +957,28 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * The promise has a method named "cancel" which cancels the ongoing API call. */ listKeys( - request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, optionsOrCallback?: | gax.CallOptions - | Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey[], - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + | PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey >, - callback?: Callback< - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey[], - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + callback?: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey > ): Promise< [ - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IKey[], - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, - protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + protos.google.cloud.recaptchaenterprise.v1beta1.IKey[], + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse ] > | void { request = request || {}; @@ -908,7 +998,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listKeys(request, options, callback); + return this.innerApiCalls.listKeys(request, options, callback); } /** @@ -941,7 +1031,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * An object stream which emits an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} on 'data' event. */ listKeysStream( - request?: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, options?: gax.CallOptions ): Transform { request = request || {}; @@ -955,12 +1045,56 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { }); const callSettings = new gax.CallSettings(options); this.initialize(); - return this._descriptors.page.listKeys.createStream( - this._innerApiCalls.listKeys as gax.GaxCall, + return this.descriptors.page.listKeys.createStream( + this.innerApiCalls.listKeys as gax.GaxCall, request, callSettings ); } + + /** + * Equivalent to {@link listKeys}, 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 name of the project that contains the keys that will be + * listed, in the format "projects/{project_number}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @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. + */ + listKeysAsync( + request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + 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.listKeys.asyncIterate( + this.innerApiCalls['listKeys'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- @@ -973,9 +1107,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @returns {string} Resource name string. */ assessmentPath(project: string, assessment: string) { - return this._pathTemplates.assessmentPathTemplate.render({ - project, - assessment, + return this.pathTemplates.assessmentPathTemplate.render({ + project: project, + assessment: assessment, }); } @@ -987,7 +1121,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @returns {string} A string representing the project. */ matchProjectFromAssessmentName(assessmentName: string) { - return this._pathTemplates.assessmentPathTemplate.match(assessmentName) + return this.pathTemplates.assessmentPathTemplate.match(assessmentName) .project; } @@ -999,7 +1133,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @returns {string} A string representing the assessment. */ matchAssessmentFromAssessmentName(assessmentName: string) { - return this._pathTemplates.assessmentPathTemplate.match(assessmentName) + return this.pathTemplates.assessmentPathTemplate.match(assessmentName) .assessment; } @@ -1011,9 +1145,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @returns {string} Resource name string. */ keyPath(project: string, key: string) { - return this._pathTemplates.keyPathTemplate.render({ - project, - key, + return this.pathTemplates.keyPathTemplate.render({ + project: project, + key: key, }); } @@ -1025,7 +1159,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @returns {string} A string representing the project. */ matchProjectFromKeyName(keyName: string) { - return this._pathTemplates.keyPathTemplate.match(keyName).project; + return this.pathTemplates.keyPathTemplate.match(keyName).project; } /** @@ -1036,7 +1170,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @returns {string} A string representing the key. */ matchKeyFromKeyName(keyName: string) { - return this._pathTemplates.keyPathTemplate.match(keyName).key; + return this.pathTemplates.keyPathTemplate.match(keyName).key; } /** @@ -1046,8 +1180,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @returns {string} Resource name string. */ projectPath(project: string) { - return this._pathTemplates.projectPathTemplate.render({ - project, + return this.pathTemplates.projectPathTemplate.render({ + project: project, }); } @@ -1059,7 +1193,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @returns {string} A string representing the project. */ matchProjectFromProjectName(projectName: string) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; + return this.pathTemplates.projectPathTemplate.match(projectName).project; } /** diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 71b59f3756e..e2f2c500a6c 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,16 +1,5 @@ { - "updateTime": "2020-03-24T23:50:54.138889Z", - "sources": [ - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "1df117114c73299b614dfd3ba3632bf246669336", - "internalRef": "302753982", - "log": "1df117114c73299b614dfd3ba3632bf246669336\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 302753982\n\n" - } - } - ], + "updateTime": "2020-03-31T19:56:03.113784Z", "destinations": [ { "client": { diff --git a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js index d0565cdf3b3..cb2d9ca7462 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js @@ -16,7 +16,6 @@ // ** 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 recaptchaenterprise = require('@google-cloud/recaptcha-enterprise'); diff --git a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts index d010410b577..c457bf5c5cd 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts @@ -19,7 +19,7 @@ import {RecaptchaEnterpriseServiceV1Beta1Client} from '@google-cloud/recaptcha-enterprise'; function main() { - const recaptchaEnterpriseServiceV1Beta1Client = new RecaptchaEnterpriseServiceV1Beta1Client(); + new RecaptchaEnterpriseServiceV1Beta1Client(); } main(); diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service-v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service-v1.ts deleted file mode 100644 index f247b6b4201..00000000000 --- a/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service-v1.ts +++ /dev/null @@ -1,512 +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 -// -// 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 protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -const recaptchaenterpriseserviceModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - constructor() {} - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -describe('v1.RecaptchaEnterpriseServiceClient', () => { - it('has servicePath', () => { - const servicePath = - recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient - .servicePath; - assert(servicePath); - }); - it('has apiEndpoint', () => { - const apiEndpoint = - recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient - .apiEndpoint; - assert(apiEndpoint); - }); - it('has port', () => { - const port = - recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - it('should create a client with no option', () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(); - assert(client); - }); - it('should create a client with gRPC fallback', () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - fallback: true, - } - ); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.recaptchaEnterpriseServiceStub, undefined); - await client.initialize(); - assert(client.recaptchaEnterpriseServiceStub); - }); - it('has close method', () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.close(); - }); - describe('createAssessment', () => { - it('invokes createAssessment without error', done => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createAssessment = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.createAssessment(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createAssessment with error', done => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createAssessment = mockSimpleGrpcMethod( - request, - null, - error - ); - client.createAssessment(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('annotateAssessment', () => { - it('invokes annotateAssessment without error', done => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.annotateAssessment = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.annotateAssessment(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes annotateAssessment with error', done => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.annotateAssessment = mockSimpleGrpcMethod( - request, - null, - error - ); - client.annotateAssessment(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('createKey', () => { - it('invokes createKey without error', done => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createKey = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.createKey(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createKey with error', done => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createKey = mockSimpleGrpcMethod( - request, - null, - error - ); - client.createKey(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getKey', () => { - it('invokes getKey without error', done => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getKey = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getKey(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getKey with error', done => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1.IGetKeyRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getKey = mockSimpleGrpcMethod(request, null, error); - client.getKey(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('updateKey', () => { - it('invokes updateKey without error', done => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest = {}; - request.key = {}; - request.key.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateKey = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateKey(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateKey with error', done => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest = {}; - request.key = {}; - request.key.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateKey = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateKey(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('deleteKey', () => { - it('invokes deleteKey without error', done => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteKey = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.deleteKey(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes deleteKey with error', done => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteKey = mockSimpleGrpcMethod( - request, - null, - error - ); - client.deleteKey(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('listKeys', () => { - it('invokes listKeys without error', done => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.listKeys = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.listKeys(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('listKeysStream', () => { - it('invokes listKeysStream without error', done => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1.IListKeysRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.listKeys = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .listKeysStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); -}); diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts deleted file mode 100644 index d11960920f6..00000000000 --- a/packages/google-cloud-recaptchaenterprise/test/gapic-recaptcha_enterprise_service_v1_beta1-v1beta1.ts +++ /dev/null @@ -1,513 +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 -// -// 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 protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -const recaptchaenterpriseservicev1beta1Module = require('../src'); - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - constructor() {} - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { - it('has servicePath', () => { - const servicePath = - recaptchaenterpriseservicev1beta1Module.v1beta1 - .RecaptchaEnterpriseServiceV1Beta1Client.servicePath; - assert(servicePath); - }); - it('has apiEndpoint', () => { - const apiEndpoint = - recaptchaenterpriseservicev1beta1Module.v1beta1 - .RecaptchaEnterpriseServiceV1Beta1Client.apiEndpoint; - assert(apiEndpoint); - }); - it('has port', () => { - const port = - recaptchaenterpriseservicev1beta1Module.v1beta1 - .RecaptchaEnterpriseServiceV1Beta1Client.port; - assert(port); - assert(typeof port === 'number'); - }); - it('should create a client with no option', () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); - assert(client); - }); - it('should create a client with gRPC fallback', () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - fallback: true, - } - ); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.recaptchaEnterpriseServiceV1Beta1Stub, undefined); - await client.initialize(); - assert(client.recaptchaEnterpriseServiceV1Beta1Stub); - }); - it('has close method', () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.close(); - }); - describe('createAssessment', () => { - it('invokes createAssessment without error', done => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createAssessment = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.createAssessment(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createAssessment with error', done => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createAssessment = mockSimpleGrpcMethod( - request, - null, - error - ); - client.createAssessment(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('annotateAssessment', () => { - it('invokes annotateAssessment without error', done => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.annotateAssessment = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.annotateAssessment(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes annotateAssessment with error', done => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.annotateAssessment = mockSimpleGrpcMethod( - request, - null, - error - ); - client.annotateAssessment(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('createKey', () => { - it('invokes createKey without error', done => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createKey = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.createKey(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createKey with error', done => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createKey = mockSimpleGrpcMethod( - request, - null, - error - ); - client.createKey(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getKey', () => { - it('invokes getKey without error', done => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getKey = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getKey(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getKey with error', done => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getKey = mockSimpleGrpcMethod(request, null, error); - client.getKey(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('updateKey', () => { - it('invokes updateKey without error', done => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest = {}; - request.key = {}; - request.key.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateKey = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.updateKey(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateKey with error', done => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest = {}; - request.key = {}; - request.key.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateKey = mockSimpleGrpcMethod( - request, - null, - error - ); - client.updateKey(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('deleteKey', () => { - it('invokes deleteKey without error', done => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteKey = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.deleteKey(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes deleteKey with error', done => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteKey = mockSimpleGrpcMethod( - request, - null, - error - ); - client.deleteKey(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('listKeys', () => { - it('invokes listKeys without error', done => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.listKeys = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.listKeys(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('listKeysStream', () => { - it('invokes listKeysStream without error', done => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.listKeys = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .listKeysStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); -}); diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts new file mode 100644 index 00000000000..b9a1a049012 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -0,0 +1,1389 @@ +// 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 recaptchaenterpriseserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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 stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.RecaptchaEnterpriseServiceClient', () => { + it('has servicePath', () => { + const servicePath = + recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.recaptchaEnterpriseServiceStub, undefined); + await client.initialize(); + assert(client.recaptchaEnterpriseServiceStub); + }); + + it('has close method', () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + 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 recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + 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('createAssessment', () => { + it('invokes createAssessment without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Assessment() + ); + client.innerApiCalls.createAssessment = stubSimpleCall(expectedResponse); + const [response] = await client.createAssessment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createAssessment without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Assessment() + ); + client.innerApiCalls.createAssessment = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createAssessment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1.IAssessment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createAssessment with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createAssessment = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createAssessment(request); + }, expectedError); + assert( + (client.innerApiCalls.createAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('annotateAssessment', () => { + it('invokes annotateAssessment without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse() + ); + client.innerApiCalls.annotateAssessment = stubSimpleCall( + expectedResponse + ); + const [response] = await client.annotateAssessment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes annotateAssessment without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse() + ); + client.innerApiCalls.annotateAssessment = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.annotateAssessment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes annotateAssessment with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.annotateAssessment = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.annotateAssessment(request); + }, expectedError); + assert( + (client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createKey', () => { + it('invokes createKey without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ); + client.innerApiCalls.createKey = stubSimpleCall(expectedResponse); + const [response] = await client.createKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createKey without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ); + client.innerApiCalls.createKey = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1.IKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createKey with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createKey = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.createKey(request); + }, expectedError); + assert( + (client.innerApiCalls.createKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getKey', () => { + it('invokes getKey without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ); + client.innerApiCalls.getKey = stubSimpleCall(expectedResponse); + const [response] = await client.getKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getKey without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ); + client.innerApiCalls.getKey = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1.IKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getKey with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.getKey(request); + }, expectedError); + assert( + (client.innerApiCalls.getKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateKey', () => { + it('invokes updateKey without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() + ); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = 'key.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ); + client.innerApiCalls.updateKey = stubSimpleCall(expectedResponse); + const [response] = await client.updateKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateKey without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() + ); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = 'key.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ); + client.innerApiCalls.updateKey = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1.IKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateKey with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() + ); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = 'key.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateKey = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.updateKey(request); + }, expectedError); + assert( + (client.innerApiCalls.updateKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteKey', () => { + it('invokes deleteKey without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteKey = stubSimpleCall(expectedResponse); + const [response] = await client.deleteKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteKey without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteKey = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteKey( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteKey with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteKey = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.deleteKey(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listKeys', () => { + it('invokes listKeys without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + ]; + client.innerApiCalls.listKeys = stubSimpleCall(expectedResponse); + const [response] = await client.listKeys(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listKeys as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listKeys without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + ]; + client.innerApiCalls.listKeys = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listKeys( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1.IKey[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listKeys as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listKeys with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.listKeys(request); + }, expectedError); + assert( + (client.innerApiCalls.listKeys as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listKeysStream without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + ]; + client.descriptors.page.listKeys.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1.Key[] = []; + stream.on( + 'data', + (response: protos.google.cloud.recaptchaenterprise.v1.Key) => { + 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.listKeys.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listKeys, request) + ); + assert.strictEqual( + (client.descriptors.page.listKeys.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listKeysStream with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listKeys.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1.Key[] = []; + stream.on( + 'data', + (response: protos.google.cloud.recaptchaenterprise.v1.Key) => { + 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.listKeys.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listKeys, request) + ); + assert.strictEqual( + (client.descriptors.page.listKeys.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listKeys without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + ]; + client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.recaptchaenterprise.v1.IKey[] = []; + const iterable = client.listKeysAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listKeys with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listKeysAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.recaptchaenterprise.v1.IKey[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('assessment', () => { + const fakePath = '/rendered/path/assessment'; + const expectedParameters = { + project: 'projectValue', + assessment: 'assessmentValue', + }; + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.assessmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assessmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('assessmentPath', () => { + const result = client.assessmentPath('projectValue', 'assessmentValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assessmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAssessmentName', () => { + const result = client.matchProjectFromAssessmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.assessmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssessmentFromAssessmentName', () => { + const result = client.matchAssessmentFromAssessmentName(fakePath); + assert.strictEqual(result, 'assessmentValue'); + assert( + (client.pathTemplates.assessmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('key', () => { + const fakePath = '/rendered/path/key'; + const expectedParameters = { + project: 'projectValue', + key: 'keyValue', + }; + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.keyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.keyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('keyPath', () => { + const result = client.keyPath('projectValue', 'keyValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.keyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromKeyName', () => { + const result = client.matchProjectFromKeyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.keyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKeyFromKeyName', () => { + const result = client.matchKeyFromKeyName(fakePath); + assert.strictEqual(result, 'keyValue'); + assert( + (client.pathTemplates.keyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts new file mode 100644 index 00000000000..239c5d3c63f --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts @@ -0,0 +1,1392 @@ +// 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 recaptchaenterpriseservicev1beta1Module from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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 stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { + it('has servicePath', () => { + const servicePath = + recaptchaenterpriseservicev1beta1Module.v1beta1 + .RecaptchaEnterpriseServiceV1Beta1Client.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + recaptchaenterpriseservicev1beta1Module.v1beta1 + .RecaptchaEnterpriseServiceV1Beta1Client.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + recaptchaenterpriseservicev1beta1Module.v1beta1 + .RecaptchaEnterpriseServiceV1Beta1Client.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.recaptchaEnterpriseServiceV1Beta1Stub, undefined); + await client.initialize(); + assert(client.recaptchaEnterpriseServiceV1Beta1Stub); + }); + + it('has close method', () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + 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 recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + 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('createAssessment', () => { + it('invokes createAssessment without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Assessment() + ); + client.innerApiCalls.createAssessment = stubSimpleCall(expectedResponse); + const [response] = await client.createAssessment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createAssessment without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Assessment() + ); + client.innerApiCalls.createAssessment = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createAssessment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createAssessment with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createAssessment = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createAssessment(request); + }, expectedError); + assert( + (client.innerApiCalls.createAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('annotateAssessment', () => { + it('invokes annotateAssessment without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse() + ); + client.innerApiCalls.annotateAssessment = stubSimpleCall( + expectedResponse + ); + const [response] = await client.annotateAssessment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes annotateAssessment without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse() + ); + client.innerApiCalls.annotateAssessment = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.annotateAssessment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes annotateAssessment with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.annotateAssessment = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.annotateAssessment(request); + }, expectedError); + assert( + (client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createKey', () => { + it('invokes createKey without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ); + client.innerApiCalls.createKey = stubSimpleCall(expectedResponse); + const [response] = await client.createKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createKey without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ); + client.innerApiCalls.createKey = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createKey with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createKey = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.createKey(request); + }, expectedError); + assert( + (client.innerApiCalls.createKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getKey', () => { + it('invokes getKey without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ); + client.innerApiCalls.getKey = stubSimpleCall(expectedResponse); + const [response] = await client.getKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getKey without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ); + client.innerApiCalls.getKey = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getKey with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.getKey(request); + }, expectedError); + assert( + (client.innerApiCalls.getKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateKey', () => { + it('invokes updateKey without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() + ); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = 'key.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ); + client.innerApiCalls.updateKey = stubSimpleCall(expectedResponse); + const [response] = await client.updateKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateKey without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() + ); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = 'key.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ); + client.innerApiCalls.updateKey = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateKey with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() + ); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = 'key.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateKey = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.updateKey(request); + }, expectedError); + assert( + (client.innerApiCalls.updateKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteKey', () => { + it('invokes deleteKey without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteKey = stubSimpleCall(expectedResponse); + const [response] = await client.deleteKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteKey without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteKey = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteKey( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteKey with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteKey = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.deleteKey(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listKeys', () => { + it('invokes listKeys without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + ]; + client.innerApiCalls.listKeys = stubSimpleCall(expectedResponse); + const [response] = await client.listKeys(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listKeys as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listKeys without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + ]; + client.innerApiCalls.listKeys = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listKeys( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listKeys as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listKeys with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.listKeys(request); + }, expectedError); + assert( + (client.innerApiCalls.listKeys as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listKeysStream without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + ]; + client.descriptors.page.listKeys.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = []; + stream.on( + 'data', + (response: protos.google.cloud.recaptchaenterprise.v1beta1.Key) => { + 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.listKeys.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listKeys, request) + ); + assert.strictEqual( + (client.descriptors.page.listKeys.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listKeysStream with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listKeys.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = []; + stream.on( + 'data', + (response: protos.google.cloud.recaptchaenterprise.v1beta1.Key) => { + 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.listKeys.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listKeys, request) + ); + assert.strictEqual( + (client.descriptors.page.listKeys.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listKeys without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + ]; + client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = []; + const iterable = client.listKeysAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listKeys with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listKeysAsync(request); + assert.rejects(async () => { + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('assessment', () => { + const fakePath = '/rendered/path/assessment'; + const expectedParameters = { + project: 'projectValue', + assessment: 'assessmentValue', + }; + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.assessmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assessmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('assessmentPath', () => { + const result = client.assessmentPath('projectValue', 'assessmentValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assessmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAssessmentName', () => { + const result = client.matchProjectFromAssessmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.assessmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssessmentFromAssessmentName', () => { + const result = client.matchAssessmentFromAssessmentName(fakePath); + assert.strictEqual(result, 'assessmentValue'); + assert( + (client.pathTemplates.assessmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('key', () => { + const fakePath = '/rendered/path/key'; + const expectedParameters = { + project: 'projectValue', + key: 'keyValue', + }; + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.keyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.keyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('keyPath', () => { + const result = client.keyPath('projectValue', 'keyValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.keyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromKeyName', () => { + const result = client.matchProjectFromKeyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.keyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKeyFromKeyName', () => { + const result = client.matchKeyFromKeyName(fakePath); + assert.strictEqual(result, 'keyValue'); + assert( + (client.pathTemplates.keyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-recaptchaenterprise/webpack.config.js b/packages/google-cloud-recaptchaenterprise/webpack.config.js index 2435e0e2d56..04831b77a4d 100644 --- a/packages/google-cloud-recaptchaenterprise/webpack.config.js +++ b/packages/google-cloud-recaptchaenterprise/webpack.config.js @@ -36,27 +36,27 @@ module.exports = { { test: /\.tsx?$/, use: 'ts-loader', - exclude: /node_modules/ + exclude: /node_modules/, }, { test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]grpc/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]retry-request/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]gtoken/, - use: 'null-loader' + use: 'null-loader', }, ], }, From dca114185c799851c0f00fe333f308644b9c82cf Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 31 Mar 2020 18:38:44 -0700 Subject: [PATCH 095/253] build: set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#147) --- packages/google-cloud-recaptchaenterprise/synth.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/google-cloud-recaptchaenterprise/synth.py b/packages/google-cloud-recaptchaenterprise/synth.py index 06139a40fd0..7e3226740e7 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.py +++ b/packages/google-cloud-recaptchaenterprise/synth.py @@ -20,6 +20,9 @@ logging.basicConfig(level=logging.DEBUG) +AUTOSYNTH_MULTIPLE_COMMITS = True + + # run the gapic generator gapic = gcp.GAPICMicrogenerator() versions = ['v1', 'v1beta1'] From cc117c8d9b393c1e4efbf36531dc9fb3812e3727 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 1 Apr 2020 23:36:35 +0200 Subject: [PATCH 096/253] chore(deps): update dependency @types/sinon to v9 (#148) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/sinon](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | devDependencies | major | [`^7.5.2` -> `^9.0.0`](https://renovatebot.com/diffs/npm/@types%2fsinon/7.5.2/9.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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 33ceb237633..77fd55e0274 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -30,7 +30,7 @@ "devDependencies": { "@types/mocha": "^7.0.0", "@types/node": "^12.0.0", - "@types/sinon": "^7.5.2", + "@types/sinon": "^9.0.0", "c8": "^7.0.0", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", From 22c8e977e456eb925e69a9fb734841335a77edb1 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sun, 5 Apr 2020 12:51:14 -0700 Subject: [PATCH 097/253] chore: remove duplicate mocha config (#151) --- packages/google-cloud-recaptchaenterprise/.mocharc.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 packages/google-cloud-recaptchaenterprise/.mocharc.json diff --git a/packages/google-cloud-recaptchaenterprise/.mocharc.json b/packages/google-cloud-recaptchaenterprise/.mocharc.json deleted file mode 100644 index 670c5e2c24b..00000000000 --- a/packages/google-cloud-recaptchaenterprise/.mocharc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} From a4b16303d44a0778b0f7207b0aef9ce3b2b2cc24 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 7 Apr 2020 00:10:27 -0700 Subject: [PATCH 098/253] fix: export explicit version from protos.js (#150) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/1630485f-7526-4afd-9c13-b5660664d6a2/targets --- .../protos/protos.js | 2 +- .../synth.metadata | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 9db953e4d87..95df1028294 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + var $root = $protobuf.roots._google_cloud_recaptcha_enterprise_1_8_0_protos || ($protobuf.roots._google_cloud_recaptcha_enterprise_1_8_0_protos = {}); $root.google = (function() { diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index e2f2c500a6c..5fbd9d25b7d 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,5 +1,22 @@ { - "updateTime": "2020-03-31T19:56:03.113784Z", + "updateTime": "2020-04-03T12:01:49.096475Z", + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "3d5d228a58bdf875e6147b228db3159010c735ee", + "internalRef": "304500143" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "99820243d348191bc9c634f2b48ddf65096285ed" + } + } + ], "destinations": [ { "client": { From 45010c09c23706bcc3e53311a443b8bed45239fe Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Apr 2020 20:58:06 +0200 Subject: [PATCH 099/253] chore(deps): update dependency gts to v2.0.0 (#154) 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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 77fd55e0274..77324250ae2 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -36,7 +36,7 @@ "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", - "gts": "2.0.0-alpha.9", + "gts": "2.0.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", From d287832d7ca89142dd98dcb5df93fe362588efad Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 10 Apr 2020 18:48:57 -0700 Subject: [PATCH 100/253] fix: remove eslint, update gax, fix generated protos, run the generator (#155) Run the latest version of the generator, update google-gax, update gts, and remove direct dependencies on eslint. --- .../google-cloud-recaptchaenterprise/.jsdoc.js | 2 +- .../.prettierrc.js | 2 +- .../package.json | 12 ++++-------- .../synth.metadata | 13 +++---------- .../google-cloud-recaptchaenterprise/synth.py | 2 +- .../gapic_recaptcha_enterprise_service_v1.ts | 18 +++++++++--------- ...tcha_enterprise_service_v1_beta1_v1beta1.ts | 18 +++++++++--------- 7 files changed, 28 insertions(+), 39 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.jsdoc.js b/packages/google-cloud-recaptchaenterprise/.jsdoc.js index 367a9d8883e..9299cd63492 100644 --- a/packages/google-cloud-recaptchaenterprise/.jsdoc.js +++ b/packages/google-cloud-recaptchaenterprise/.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/recaptcha-enterprise', diff --git a/packages/google-cloud-recaptchaenterprise/.prettierrc.js b/packages/google-cloud-recaptchaenterprise/.prettierrc.js index 08cba3775be..d1b95106f4c 100644 --- a/packages/google-cloud-recaptchaenterprise/.prettierrc.js +++ b/packages/google-cloud-recaptchaenterprise/.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-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 77324250ae2..b723abec3d7 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -25,18 +25,14 @@ "reCAPTCHA Enterprise API" ], "dependencies": { - "google-gax": "^2.0.1" + "google-gax": "^2.1.0" }, "devDependencies": { "@types/mocha": "^7.0.0", "@types/node": "^12.0.0", "@types/sinon": "^9.0.0", "c8": "^7.0.0", - "eslint": "^6.0.0", - "eslint-config-prettier": "^6.0.0", - "eslint-plugin-node": "^11.0.0", - "eslint-plugin-prettier": "^3.0.0", - "gts": "2.0.0", + "gts": "^2.0.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", @@ -52,7 +48,7 @@ "webpack-cli": "^3.3.10" }, "scripts": { - "lint": "gts fix && eslint --fix samples/*.js", + "lint": "gts fix", "fix": "gts fix", "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", "system-test": "mocha build/system-test", @@ -64,7 +60,7 @@ "compile-protos": "compileProtos src", "predocs-test": "npm run docs", "prepare": "npm run compile", - "prelint": "cd samples; npm link ../; npm i" + "prelint": "cd samples; npm link ../; npm install" }, "license": "Apache-2.0", "engines": { diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 5fbd9d25b7d..7991fb7edb7 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,19 +1,12 @@ { - "updateTime": "2020-04-03T12:01:49.096475Z", + "updateTime": "2020-04-11T00:42:58.646069Z", "sources": [ - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3d5d228a58bdf875e6147b228db3159010c735ee", - "internalRef": "304500143" - } - }, { "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-recaptchaenterprise/synth.py b/packages/google-cloud-recaptchaenterprise/synth.py index 7e3226740e7..1169e2171de 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.py +++ b/packages/google-cloud-recaptchaenterprise/synth.py @@ -45,5 +45,5 @@ # Node.js specific cleanup subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'fix']) +subprocess.run(['npm', 'run', 'lint']) subprocess.run(['npx', 'compileProtos', 'src']) diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index b9a1a049012..6a28b288ab3 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -318,7 +318,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createAssessment(request); }, expectedError); assert( @@ -440,7 +440,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.annotateAssessment(request); }, expectedError); assert( @@ -557,7 +557,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createKey = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createKey(request); }, expectedError); assert( @@ -674,7 +674,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getKey(request); }, expectedError); assert( @@ -794,7 +794,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateKey = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateKey(request); }, expectedError); assert( @@ -911,7 +911,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteKey = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.deleteKey(request); }, expectedError); assert( @@ -1044,7 +1044,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listKeys(request); }, expectedError); assert( @@ -1145,7 +1145,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -1224,7 +1224,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { expectedError ); const iterable = client.listKeysAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.recaptchaenterprise.v1.IKey[] = []; for await (const resource of iterable) { responses.push(resource!); diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts index 239c5d3c63f..da6ed0287f8 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts @@ -319,7 +319,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createAssessment(request); }, expectedError); assert( @@ -441,7 +441,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.annotateAssessment(request); }, expectedError); assert( @@ -558,7 +558,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createKey = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createKey(request); }, expectedError); assert( @@ -675,7 +675,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getKey(request); }, expectedError); assert( @@ -795,7 +795,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateKey = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateKey(request); }, expectedError); assert( @@ -912,7 +912,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteKey = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.deleteKey(request); }, expectedError); assert( @@ -1047,7 +1047,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listKeys(request); }, expectedError); assert( @@ -1148,7 +1148,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( @@ -1227,7 +1227,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { expectedError ); const iterable = client.listKeysAsync(request); - assert.rejects(async () => { + await assert.rejects(async () => { const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = []; for await (const resource of iterable) { responses.push(resource!); From fdcd2399bd729c81f5cb3bc048fa0b68d1809c02 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sat, 11 Apr 2020 19:20:41 -0700 Subject: [PATCH 101/253] build: remove unused codecov config (#156) --- packages/google-cloud-recaptchaenterprise/codecov.yaml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 packages/google-cloud-recaptchaenterprise/codecov.yaml diff --git a/packages/google-cloud-recaptchaenterprise/codecov.yaml b/packages/google-cloud-recaptchaenterprise/codecov.yaml deleted file mode 100644 index 5724ea9478d..00000000000 --- a/packages/google-cloud-recaptchaenterprise/codecov.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -codecov: - ci: - - source.cloud.google.com From 831efa43ce1bfd02a4c4453a14c14e6921e519ee Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 13 Apr 2020 10:02:41 -0700 Subject: [PATCH 102/253] chore: update proto namespaces (#157) --- .../v1/recaptchaenterprise.proto | 1 + .../v1beta1/recaptchaenterprise.proto | 1 + .../protos/protos.json | 6 ++++-- .../synth.metadata | 19 ++++++++++++++++--- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index 68c331b2b0e..9b60fcef7ca 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -31,6 +31,7 @@ option java_outer_classname = "RecaptchaEnterpriseProto"; option java_package = "com.google.recaptchaenterprise.v1"; option objc_class_prefix = "GCRE"; option php_namespace = "Google\\Cloud\\RecaptchaEnterprise\\V1"; +option ruby_package = "Google::Cloud::RecaptchaEnterprise::V1"; // Service to determine the likelihood an event is legitimate. service RecaptchaEnterpriseService { diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto index 12e99b488f9..099d3041ffe 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto @@ -32,6 +32,7 @@ option java_outer_classname = "RecaptchaEnterpriseProto"; option java_package = "com.google.recaptchaenterprise.v1beta1"; option objc_class_prefix = "GCRE"; option php_namespace = "Google\\Cloud\\RecaptchaEnterprise\\V1beta1"; +option ruby_package = "Google::Cloud::RecaptchaEnterprise::V1beta1"; // Service to determine the likelihood an event is legitimate. service RecaptchaEnterpriseServiceV1Beta1 { diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index 371c77f638a..3700f43e38b 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -14,7 +14,8 @@ "java_outer_classname": "RecaptchaEnterpriseProto", "java_package": "com.google.recaptchaenterprise.v1", "objc_class_prefix": "GCRE", - "php_namespace": "Google\\Cloud\\RecaptchaEnterprise\\V1" + "php_namespace": "Google\\Cloud\\RecaptchaEnterprise\\V1", + "ruby_package": "Google::Cloud::RecaptchaEnterprise::V1" }, "nested": { "RecaptchaEnterpriseService": { @@ -491,7 +492,8 @@ "java_outer_classname": "RecaptchaEnterpriseProto", "java_package": "com.google.recaptchaenterprise.v1beta1", "objc_class_prefix": "GCRE", - "php_namespace": "Google\\Cloud\\RecaptchaEnterprise\\V1beta1" + "php_namespace": "Google\\Cloud\\RecaptchaEnterprise\\V1beta1", + "ruby_package": "Google::Cloud::RecaptchaEnterprise::V1beta1" }, "nested": { "RecaptchaEnterpriseServiceV1Beta1": { diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 7991fb7edb7..22ee1c34457 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -1,12 +1,25 @@ { - "updateTime": "2020-04-11T00:42:58.646069Z", "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", + "sha": "21b09f555632c6f36d1a487ccac3567064077a49" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "1bd77e8ce6f953ac641af7966d0c52646afc16a8", + "internalRef": "305974465" + } + }, { "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": "6f32150677c9784f3c3a7e1949472bd29c9d72c5" } } ], From 78b238dcc39593d747220deb1856434a074d8513 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 14:56:39 -0700 Subject: [PATCH 103/253] chore: update lint ignore files (#158) --- packages/google-cloud-recaptchaenterprise/.eslintignore | 3 ++- .../google-cloud-recaptchaenterprise/.prettierignore | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.eslintignore b/packages/google-cloud-recaptchaenterprise/.eslintignore index 09b31fe735a..9340ad9b86d 100644 --- a/packages/google-cloud-recaptchaenterprise/.eslintignore +++ b/packages/google-cloud-recaptchaenterprise/.eslintignore @@ -1,5 +1,6 @@ **/node_modules -src/**/doc/* +**/coverage +test/fixtures build/ docs/ protos/ diff --git a/packages/google-cloud-recaptchaenterprise/.prettierignore b/packages/google-cloud-recaptchaenterprise/.prettierignore index f6fac98b0a8..9340ad9b86d 100644 --- a/packages/google-cloud-recaptchaenterprise/.prettierignore +++ b/packages/google-cloud-recaptchaenterprise/.prettierignore @@ -1,3 +1,6 @@ -node_modules/* -samples/node_modules/* -src/**/doc/* +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ From 18ed6370893f2d840f77689d2a65a508e6fc4d32 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 19:32:22 -0700 Subject: [PATCH 104/253] chore: remove tslint.json (#159) --- packages/google-cloud-recaptchaenterprise/tslint.json | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 packages/google-cloud-recaptchaenterprise/tslint.json diff --git a/packages/google-cloud-recaptchaenterprise/tslint.json b/packages/google-cloud-recaptchaenterprise/tslint.json deleted file mode 100644 index 617dc975bae..00000000000 --- a/packages/google-cloud-recaptchaenterprise/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "gts/tslint.json" -} From 6d55242e9cbf14cb260f81d2b9ebfdbadae4ad1b Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 14 Apr 2020 09:56:26 -0700 Subject: [PATCH 105/253] chore: remove unused dev packages (#160) --- packages/google-cloud-recaptchaenterprise/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index b723abec3d7..4dfbb5637e6 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -40,7 +40,6 @@ "mocha": "^7.0.0", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", - "prettier": "^1.17.1", "sinon": "^9.0.1", "ts-loader": "^6.2.1", "typescript": "^3.8.3", From 52c8c61ee5c8b7357fd7ef24bff406ea2a6cc4e0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 15 Apr 2020 17:31:37 +0200 Subject: [PATCH 106/253] chore(deps): update dependency ts-loader to v7 (#161) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | devDependencies | major | [`^6.2.1` -> `^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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 4dfbb5637e6..b2c0e6706ec 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -41,7 +41,7 @@ "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", - "ts-loader": "^6.2.1", + "ts-loader": "^7.0.0", "typescript": "^3.8.3", "webpack": "^4.41.2", "webpack-cli": "^3.3.10" From c047af3182605ff947cf098ad0b3b7b05e4c2b3b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 15 Apr 2020 18:31:18 +0200 Subject: [PATCH 107/253] chore(deps): update dependency null-loader to v4 (#162) 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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index b2c0e6706ec..fbf61c6c451 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -38,7 +38,7 @@ "jsdoc-region-tag": "^1.0.2", "linkinator": "^2.0.0", "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 1cb0dc2cd31b7efce469cc42a34e3c1db1ecc48e Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 15 Apr 2020 10:30:45 -0700 Subject: [PATCH 108/253] chore: run fix instead of lint in synthfile (#164) --- packages/google-cloud-recaptchaenterprise/synth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.py b/packages/google-cloud-recaptchaenterprise/synth.py index 1169e2171de..7e3226740e7 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.py +++ b/packages/google-cloud-recaptchaenterprise/synth.py @@ -45,5 +45,5 @@ # Node.js specific cleanup subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'lint']) +subprocess.run(['npm', 'run', 'fix']) subprocess.run(['npx', 'compileProtos', 'src']) From 59044c59eeb7dcf7e04e17d5ab8bd48d3b9c2f3b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 20 Apr 2020 16:02:14 -0700 Subject: [PATCH 109/253] chore: remove unused dev packages (#160) (#165) --- .../v1/recaptcha_enterprise_service_client.ts | 1107 ++++----- ...tcha_enterprise_service_v1_beta1_client.ts | 1131 ++++----- .../synth.metadata | 8 +- .../system-test/fixtures/sample/src/index.js | 1 + .../system-test/install.ts | 28 +- .../gapic_recaptcha_enterprise_service_v1.ts | 2200 +++++++--------- ...cha_enterprise_service_v1_beta1_v1beta1.ts | 2203 +++++++---------- .../webpack.config.js | 12 +- 8 files changed, 2752 insertions(+), 3938 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index 57d53669357..e4f4b087195 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -17,18 +17,11 @@ // ** All changes to this file may be overwritten. ** import * as gax from 'google-gax'; -import { - Callback, - CallOptions, - Descriptors, - ClientOptions, - PaginationCallback, - GaxCall, -} from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; import * as path from 'path'; -import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './recaptcha_enterprise_service_client_config.json'; @@ -47,12 +40,7 @@ export class RecaptchaEnterpriseServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; + descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}, batching: {}}; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; recaptchaEnterpriseServiceStub?: Promise<{[name: string]: Function}>; @@ -85,14 +73,11 @@ export class RecaptchaEnterpriseServiceClient { constructor(opts?: ClientOptions) { // Ensure that options include the service address and port. - const staticMembers = this - .constructor as typeof RecaptchaEnterpriseServiceClient; - const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; + const staticMembers = this.constructor as typeof RecaptchaEnterpriseServiceClient; + 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) { @@ -102,8 +87,8 @@ export class RecaptchaEnterpriseServiceClient { opts.port = opts.port || port; opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { + const isBrowser = (typeof window !== 'undefined'); + if (isBrowser){ opts.fallback = true; } // If we are in browser, we are already using fallback because of the @@ -113,18 +98,20 @@ export class RecaptchaEnterpriseServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. - opts.scopes = (this - .constructor as typeof RecaptchaEnterpriseServiceClient).scopes; + opts.scopes = (this.constructor as typeof RecaptchaEnterpriseServiceClient).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; + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); // Determine the client header string. - const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -140,18 +127,12 @@ export class RecaptchaEnterpriseServiceClient { // For Node.js, pass the path to JSON proto file. // For browsers, pass the JSON content. - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); + 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 + opts.fallback ? + // eslint-disable-next-line @typescript-eslint/no-var-requires + require("../../protos/protos.json") : + nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated @@ -173,20 +154,14 @@ export class RecaptchaEnterpriseServiceClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { - listKeys: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'keys' - ), + listKeys: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'keys') }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService', - gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, - {'x-goog-api-client': clientHeader.join(' ')} - ); + 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService', 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 @@ -214,27 +189,16 @@ export class RecaptchaEnterpriseServiceClient { // Put together the "service stub" for // google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService. this.recaptchaEnterpriseServiceStub = this._gaxGrpc.createStub( - this._opts.fallback - ? (this._protos as protobuf.Root).lookupService( - 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService' - ) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.recaptchaenterprise.v1 - .RecaptchaEnterpriseService, - this._opts - ) as Promise<{[method: string]: Function}>; + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService, + 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 recaptchaEnterpriseServiceStubMethods = [ - 'createAssessment', - 'annotateAssessment', - 'createKey', - 'listKeys', - 'getKey', - 'updateKey', - 'deleteKey', - ]; + const recaptchaEnterpriseServiceStubMethods = + ['createAssessment', 'annotateAssessment', 'createKey', 'listKeys', 'getKey', 'updateKey', 'deleteKey']; for (const methodName of recaptchaEnterpriseServiceStubMethods) { const callPromise = this.recaptchaEnterpriseServiceStub.then( stub => (...args: Array<{}>) => { @@ -244,17 +208,16 @@ export class RecaptchaEnterpriseServiceClient { const func = stub[methodName]; return func.apply(stub, args); }, - (err: Error | null | undefined) => () => { + (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.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); this.innerApiCalls[methodName] = apiCall; @@ -290,7 +253,9 @@ export class RecaptchaEnterpriseServiceClient { * in this service. */ static get scopes() { - return ['https://www.googleapis.com/auth/cloud-platform']; + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; } getProjectId(): Promise; @@ -300,9 +265,8 @@ export class RecaptchaEnterpriseServiceClient { * @param {function(Error, string)} callback - the callback to * be called with the current project Id. */ - getProjectId( - callback?: Callback - ): Promise | void { + getProjectId(callback?: Callback): + Promise|void { if (callback) { this.auth.getProjectId(callback); return; @@ -314,89 +278,62 @@ export class RecaptchaEnterpriseServiceClient { // -- Service calls -- // ------------------- createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1.IAssessment, - ( - | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest - | undefined - ), - {} | undefined - ] - >; + request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1.IAssessment, + protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest|undefined, {}|undefined + ]>; createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IAssessment, - | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAssessment, + protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest|null|undefined, + {}|null|undefined>): void; createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IAssessment, - | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Creates an Assessment of the likelihood an event is legitimate. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which the assessment will be created, - * in the format "projects/{project}". - * @param {google.cloud.recaptchaenterprise.v1.Assessment} request.assessment - * Required. The assessment details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1.Assessment}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAssessment, + protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest|null|undefined, + {}|null|undefined>): void; +/** + * Creates an Assessment of the likelihood an event is legitimate. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the assessment will be created, + * in the format "projects/{project}". + * @param {google.cloud.recaptchaenterprise.v1.Assessment} request.assessment + * Required. The assessment details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1.Assessment}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + optionsOrCallback?: gax.CallOptions|Callback< protos.google.cloud.recaptchaenterprise.v1.IAssessment, - | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.recaptchaenterprise.v1.IAssessment, - | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1.IAssessment, - ( - | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest - | undefined - ), - {} | undefined - ] - > | void { + protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAssessment, + protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1.IAssessment, + protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -405,96 +342,69 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.createAssessment(request, options, callback); } annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, - ( - | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest - | undefined - ), - {} | undefined - ] - >; + request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest|undefined, {}|undefined + ]>; annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, - | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest|null|undefined, + {}|null|undefined>): void; annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, - | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Annotates a previously created Assessment to provide additional information - * on whether the event turned out to be authentic or fradulent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Assessment, in the format - * "projects/{project}/assessments/{assessment}". - * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} request.annotation - * Required. The annotation that will be assigned to the Event. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest|null|undefined, + {}|null|undefined>): void; +/** + * Annotates a previously created Assessment to provide additional information + * on whether the event turned out to be authentic or fradulent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Assessment, in the format + * "projects/{project}/assessments/{assessment}". + * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} request.annotation + * Required. The annotation that will be assigned to the Event. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + optionsOrCallback?: gax.CallOptions|Callback< protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, - | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, - | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, - ( - | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest - | undefined - ), - {} | undefined - ] - > | void { + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -503,89 +413,68 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - name: request.name || '', + 'name': request.name || '', }); this.initialize(); return this.innerApiCalls.annotateAssessment(request, options, callback); } createKey( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest | undefined, - {} | undefined - ] - >; + request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest|undefined, {}|undefined + ]>; createKey( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - | protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest|null|undefined, + {}|null|undefined>): void; createKey( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - | protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Creates a new reCAPTCHA Enterprise key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which the key will be created, in the - * format "projects/{project}". - * @param {google.cloud.recaptchaenterprise.v1.Key} request.key - * Required. Information to create a reCAPTCHA Enterprise key. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest|null|undefined, + {}|null|undefined>): void; +/** + * Creates a new reCAPTCHA Enterprise key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the key will be created, in the + * format "projects/{project}". + * @param {google.cloud.recaptchaenterprise.v1.Key} request.key + * Required. Information to create a reCAPTCHA Enterprise key. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ createKey( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + optionsOrCallback?: gax.CallOptions|Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< protos.google.cloud.recaptchaenterprise.v1.IKey, - | protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - | protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest | undefined, - {} | undefined - ] - > | void { + protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -594,87 +483,66 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.createKey(request, options, callback); } getKey( - request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest | undefined, - {} | undefined - ] - >; + request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest|undefined, {}|undefined + ]>; getKey( - request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - | protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest|null|undefined, + {}|null|undefined>): void; getKey( - request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - | protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Returns the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the requested key, in the format - * "projects/{project}/keys/{key}". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest|null|undefined, + {}|null|undefined>): void; +/** + * Returns the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the requested key, in the format + * "projects/{project}/keys/{key}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ getKey( - request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + optionsOrCallback?: gax.CallOptions|Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< protos.google.cloud.recaptchaenterprise.v1.IKey, - | protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - | protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest | undefined, - {} | undefined - ] - > | void { + protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -683,89 +551,68 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - name: request.name || '', + 'name': request.name || '', }); this.initialize(); return this.innerApiCalls.getKey(request, options, callback); } updateKey( - request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest | undefined, - {} | undefined - ] - >; + request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest|undefined, {}|undefined + ]>; updateKey( - request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - | protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest|null|undefined, + {}|null|undefined>): void; updateKey( - request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - | protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Updates the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.recaptchaenterprise.v1.Key} request.key - * Required. The key to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The mask to control which field of the key get updated. If the mask is not - * present, all fields will be 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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest|null|undefined, + {}|null|undefined>): void; +/** + * Updates the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.recaptchaenterprise.v1.Key} request.key + * Required. The key to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which field of the key get updated. If the mask is not + * present, all fields will be 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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ updateKey( - request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + optionsOrCallback?: gax.CallOptions|Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< protos.google.cloud.recaptchaenterprise.v1.IKey, - | protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - | protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest | undefined, - {} | undefined - ] - > | void { + protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -780,81 +627,60 @@ export class RecaptchaEnterpriseServiceClient { return this.innerApiCalls.updateKey(request, options, callback); } deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest | undefined, - {} | undefined - ] - >; + request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest|undefined, {}|undefined + ]>; deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest|null|undefined, + {}|null|undefined>): void; deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Deletes the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the key to be deleted, in the format - * "projects/{project}/keys/{key}". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest|null|undefined, + {}|null|undefined>): void; +/** + * Deletes the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the key to be deleted, in the format + * "projects/{project}/keys/{key}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + optionsOrCallback?: gax.CallOptions|Callback< protos.google.protobuf.IEmpty, - | protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest | undefined, - {} | undefined - ] - > | void { + protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -863,106 +689,87 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - name: request.name || '', + 'name': request.name || '', }); this.initialize(); return this.innerApiCalls.deleteKey(request, options, callback); } listKeys( - request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1.IKey[], - protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, - protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse - ] - >; + request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1.IKey[], + protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest|null, + protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse + ]>; listKeys( - request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - options: gax.CallOptions, - callback: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - | protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1.IKey - > - ): void; + request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse|null|undefined, + protos.google.cloud.recaptchaenterprise.v1.IKey>): void; listKeys( - request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - callback: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - | protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1.IKey - > - ): void; - /** - * Returns the list of all keys that belong to a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project that contains the keys that will be - * listed, in the format "projects/{project}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * 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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key} 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 [ListKeysRequest]{@link google.cloud.recaptchaenterprise.v1.ListKeysRequest} - * 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 - * [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1.ListKeysResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse|null|undefined, + protos.google.cloud.recaptchaenterprise.v1.IKey>): void; +/** + * Returns the list of all keys that belong to a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project that contains the keys that will be + * listed, in the format "projects/{project}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * 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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key} 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 [ListKeysRequest]{@link google.cloud.recaptchaenterprise.v1.ListKeysRequest} + * 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 + * [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1.ListKeysResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ listKeys( - request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - optionsOrCallback?: - | gax.CallOptions - | PaginationCallback< + request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + optionsOrCallback?: gax.CallOptions|PaginationCallback< protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - | protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1.IKey - >, - callback?: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - | protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1.IKey - > - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1.IKey[], - protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, - protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse - ] - > | void { + protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse|null|undefined, + protos.google.cloud.recaptchaenterprise.v1.IKey>, + callback?: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse|null|undefined, + protos.google.cloud.recaptchaenterprise.v1.IKey>): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1.IKey[], + protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest|null, + protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -971,45 +778,45 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.listKeys(request, options, callback); } - /** - * Equivalent to {@link listKeys}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listKeys} 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 name of the project that contains the keys that will be - * listed, in the format "projects/{project}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key} on 'data' event. - */ +/** + * Equivalent to {@link listKeys}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listKeys} 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 name of the project that contains the keys that will be + * listed, in the format "projects/{project}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key} on 'data' event. + */ listKeysStream( - request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - options?: gax.CallOptions - ): Transform { + request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + options?: gax.CallOptions): + Transform{ request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1017,7 +824,7 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); const callSettings = new gax.CallSettings(options); this.initialize(); @@ -1028,31 +835,31 @@ export class RecaptchaEnterpriseServiceClient { ); } - /** - * Equivalent to {@link listKeys}, 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 name of the project that contains the keys that will be - * listed, in the format "projects/{project}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @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. - */ +/** + * Equivalent to {@link listKeys}, 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 name of the project that contains the keys that will be + * listed, in the format "projects/{project}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @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. + */ listKeysAsync( - request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - options?: gax.CallOptions - ): AsyncIterable { + request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + options?: gax.CallOptions): + AsyncIterable{ request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1060,14 +867,14 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listKeys.asyncIterate( this.innerApiCalls['listKeys'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1082,7 +889,7 @@ export class RecaptchaEnterpriseServiceClient { * @param {string} assessment * @returns {string} Resource name string. */ - assessmentPath(project: string, assessment: string) { + assessmentPath(project:string,assessment:string) { return this.pathTemplates.assessmentPathTemplate.render({ project: project, assessment: assessment, @@ -1097,8 +904,7 @@ export class RecaptchaEnterpriseServiceClient { * @returns {string} A string representing the project. */ matchProjectFromAssessmentName(assessmentName: string) { - return this.pathTemplates.assessmentPathTemplate.match(assessmentName) - .project; + return this.pathTemplates.assessmentPathTemplate.match(assessmentName).project; } /** @@ -1109,8 +915,7 @@ export class RecaptchaEnterpriseServiceClient { * @returns {string} A string representing the assessment. */ matchAssessmentFromAssessmentName(assessmentName: string) { - return this.pathTemplates.assessmentPathTemplate.match(assessmentName) - .assessment; + return this.pathTemplates.assessmentPathTemplate.match(assessmentName).assessment; } /** @@ -1120,7 +925,7 @@ export class RecaptchaEnterpriseServiceClient { * @param {string} key * @returns {string} Resource name string. */ - keyPath(project: string, key: string) { + keyPath(project:string,key:string) { return this.pathTemplates.keyPathTemplate.render({ project: project, key: key, @@ -1155,7 +960,7 @@ export class RecaptchaEnterpriseServiceClient { * @param {string} project * @returns {string} Resource name string. */ - projectPath(project: string) { + projectPath(project:string) { return this.pathTemplates.projectPathTemplate.render({ project: project, }); diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index fbbfc223310..97f274233d3 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -17,18 +17,11 @@ // ** All changes to this file may be overwritten. ** import * as gax from 'google-gax'; -import { - Callback, - CallOptions, - Descriptors, - ClientOptions, - PaginationCallback, - GaxCall, -} from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; import * as path from 'path'; -import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './recaptcha_enterprise_service_v1_beta1_client_config.json'; @@ -47,12 +40,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; + descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}, batching: {}}; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; recaptchaEnterpriseServiceV1Beta1Stub?: Promise<{[name: string]: Function}>; @@ -85,14 +73,11 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { constructor(opts?: ClientOptions) { // Ensure that options include the service address and port. - const staticMembers = this - .constructor as typeof RecaptchaEnterpriseServiceV1Beta1Client; - const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; + const staticMembers = this.constructor as typeof RecaptchaEnterpriseServiceV1Beta1Client; + 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) { @@ -102,8 +87,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { opts.port = opts.port || port; opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { + const isBrowser = (typeof window !== 'undefined'); + if (isBrowser){ opts.fallback = true; } // If we are in browser, we are already using fallback because of the @@ -113,18 +98,20 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. - opts.scopes = (this - .constructor as typeof RecaptchaEnterpriseServiceV1Beta1Client).scopes; + opts.scopes = (this.constructor as typeof RecaptchaEnterpriseServiceV1Beta1Client).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; + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); // Determine the client header string. - const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -140,18 +127,12 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // For Node.js, pass the path to JSON proto file. // For browsers, pass the JSON content. - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); + 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 + opts.fallback ? + // eslint-disable-next-line @typescript-eslint/no-var-requires + require("../../protos/protos.json") : + nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated @@ -173,20 +154,14 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { - listKeys: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'keys' - ), + listKeys: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'keys') }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1', - gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, - {'x-goog-api-client': clientHeader.join(' ')} - ); + 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1', 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 @@ -214,27 +189,16 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // Put together the "service stub" for // google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1. this.recaptchaEnterpriseServiceV1Beta1Stub = this._gaxGrpc.createStub( - this._opts.fallback - ? (this._protos as protobuf.Root).lookupService( - 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1' - ) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.recaptchaenterprise.v1beta1 - .RecaptchaEnterpriseServiceV1Beta1, - this._opts - ) as Promise<{[method: string]: Function}>; + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1, + 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 recaptchaEnterpriseServiceV1Beta1StubMethods = [ - 'createAssessment', - 'annotateAssessment', - 'createKey', - 'listKeys', - 'getKey', - 'updateKey', - 'deleteKey', - ]; + const recaptchaEnterpriseServiceV1Beta1StubMethods = + ['createAssessment', 'annotateAssessment', 'createKey', 'listKeys', 'getKey', 'updateKey', 'deleteKey']; for (const methodName of recaptchaEnterpriseServiceV1Beta1StubMethods) { const callPromise = this.recaptchaEnterpriseServiceV1Beta1Stub.then( stub => (...args: Array<{}>) => { @@ -244,17 +208,16 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { const func = stub[methodName]; return func.apply(stub, args); }, - (err: Error | null | undefined) => () => { + (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.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); this.innerApiCalls[methodName] = apiCall; @@ -290,7 +253,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * in this service. */ static get scopes() { - return ['https://www.googleapis.com/auth/cloud-platform']; + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; } getProjectId(): Promise; @@ -300,9 +265,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @param {function(Error, string)} callback - the callback to * be called with the current project Id. */ - getProjectId( - callback?: Callback - ): Promise | void { + getProjectId(callback?: Callback): + Promise|void { if (callback) { this.auth.getProjectId(callback); return; @@ -314,89 +278,62 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // -- Service calls -- // ------------------- createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest - | undefined - ), - {} | undefined - ] - >; + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest|undefined, {}|undefined + ]>; createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest|null|undefined, + {}|null|undefined>): void; createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Creates an Assessment of the likelihood an event is legitimate. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which the assessment will be created, - * in the format "projects/{project_number}". - * @param {google.cloud.recaptchaenterprise.v1beta1.Assessment} request.assessment - * Required. The assessment details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest|null|undefined, + {}|null|undefined>): void; +/** + * Creates an Assessment of the likelihood an event is legitimate. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the assessment will be created, + * in the format "projects/{project_number}". + * @param {google.cloud.recaptchaenterprise.v1beta1.Assessment} request.assessment + * Required. The assessment details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + optionsOrCallback?: gax.CallOptions|Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest - | undefined - ), - {} | undefined - ] - > | void { + protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -405,96 +342,69 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.createAssessment(request, options, callback); } annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest - | undefined - ), - {} | undefined - ] - >; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest|undefined, {}|undefined + ]>; annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, - | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest|null|undefined, + {}|null|undefined>): void; annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, - | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Annotates a previously created Assessment to provide additional information - * on whether the event turned out to be authentic or fradulent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Assessment, in the format - * "projects/{project_number}/assessments/{assessment_id}". - * @param {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation} request.annotation - * Required. The annotation that will be assigned to the Event. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest|null|undefined, + {}|null|undefined>): void; +/** + * Annotates a previously created Assessment to provide additional information + * on whether the event turned out to be authentic or fradulent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Assessment, in the format + * "projects/{project_number}/assessments/{assessment_id}". + * @param {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation} request.annotation + * Required. The annotation that will be assigned to the Event. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + optionsOrCallback?: gax.CallOptions|Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, - | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, - | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest - | undefined - ), - {} | undefined - ] - > | void { + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -503,95 +413,68 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - name: request.name || '', + 'name': request.name || '', }); this.initialize(); return this.innerApiCalls.annotateAssessment(request, options, callback); } createKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest - | undefined - ), - {} | undefined - ] - >; + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest|undefined, {}|undefined + ]>; createKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest|null|undefined, + {}|null|undefined>): void; createKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Creates a new reCAPTCHA Enterprise key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which the key will be created, in the - * format "projects/{project_number}". - * @param {google.cloud.recaptchaenterprise.v1beta1.Key} request.key - * Required. Information to create a reCAPTCHA Enterprise key. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest|null|undefined, + {}|null|undefined>): void; +/** + * Creates a new reCAPTCHA Enterprise key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the key will be created, in the + * format "projects/{project_number}". + * @param {google.cloud.recaptchaenterprise.v1beta1.Key} request.key + * Required. Information to create a reCAPTCHA Enterprise key. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ createKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + optionsOrCallback?: gax.CallOptions|Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest - | undefined - ), - {} | undefined - ] - > | void { + protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -600,93 +483,66 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.createKey(request, options, callback); } getKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest - | undefined - ), - {} | undefined - ] - >; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest|undefined, {}|undefined + ]>; getKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest|null|undefined, + {}|null|undefined>): void; getKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Returns the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the requested key, in the format - * "projects/{project_number}/keys/{key_id}". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest|null|undefined, + {}|null|undefined>): void; +/** + * Returns the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the requested key, in the format + * "projects/{project_number}/keys/{key_id}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ getKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + optionsOrCallback?: gax.CallOptions|Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest - | undefined - ), - {} | undefined - ] - > | void { + protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -695,95 +551,68 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - name: request.name || '', + 'name': request.name || '', }); this.initialize(); return this.innerApiCalls.getKey(request, options, callback); } updateKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest - | undefined - ), - {} | undefined - ] - >; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest|undefined, {}|undefined + ]>; updateKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest|null|undefined, + {}|null|undefined>): void; updateKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Updates the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.recaptchaenterprise.v1beta1.Key} request.key - * Required. The key to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The mask to control which field of the key get updated. If the mask is not - * present, all fields will be 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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest|null|undefined, + {}|null|undefined>): void; +/** + * Updates the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.recaptchaenterprise.v1beta1.Key} request.key + * Required. The key to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which field of the key get updated. If the mask is not + * present, all fields will be 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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ updateKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + optionsOrCallback?: gax.CallOptions|Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest - | undefined - ), - {} | undefined - ] - > | void { + protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -798,87 +627,60 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { return this.innerApiCalls.updateKey(request, options, callback); } deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest - | undefined - ), - {} | undefined - ] - >; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest|undefined, {}|undefined + ]>; deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest|null|undefined, + {}|null|undefined>): void; deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Deletes the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the key to be deleted, in the format - * "projects/{project_number}/keys/{key_id}". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest|null|undefined, + {}|null|undefined>): void; +/** + * Deletes the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the key to be deleted, in the format + * "projects/{project_number}/keys/{key_id}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< + request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + optionsOrCallback?: gax.CallOptions|Callback< protos.google.protobuf.IEmpty, - | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.protobuf.IEmpty, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest - | undefined - ), - {} | undefined - ] - > | void { + protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -887,106 +689,87 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - name: request.name || '', + 'name': request.name || '', }); this.initialize(); return this.innerApiCalls.deleteKey(request, options, callback); } listKeys( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey[], - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse - ] - >; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + options?: gax.CallOptions): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1beta1.IKey[], + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest|null, + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + ]>; listKeys( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - options: gax.CallOptions, - callback: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1beta1.IKey - > - ): void; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse|null|undefined, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey>): void; listKeys( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - callback: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1beta1.IKey - > - ): void; - /** - * Returns the list of all keys that belong to a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project that contains the keys that will be - * listed, in the format "projects/{project_number}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * 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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} 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 [ListKeysRequest]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} - * 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 - * [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse|null|undefined, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey>): void; +/** + * Returns the list of all keys that belong to a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project that contains the keys that will be + * listed, in the format "projects/{project_number}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * 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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} 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 [ListKeysRequest]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} + * 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 + * [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ listKeys( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - optionsOrCallback?: - | gax.CallOptions - | PaginationCallback< + request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + optionsOrCallback?: gax.CallOptions|PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse|null|undefined, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey>, + callback?: PaginationCallback< protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1beta1.IKey - >, - callback?: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1beta1.IKey - > - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey[], - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse - ] - > | void { + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse|null|undefined, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey>): + Promise<[ + protos.google.cloud.recaptchaenterprise.v1beta1.IKey[], + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest|null, + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + ]>|void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -995,45 +778,45 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); this.initialize(); return this.innerApiCalls.listKeys(request, options, callback); } - /** - * Equivalent to {@link listKeys}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listKeys} 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 name of the project that contains the keys that will be - * listed, in the format "projects/{project_number}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} on 'data' event. - */ +/** + * Equivalent to {@link listKeys}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listKeys} 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 name of the project that contains the keys that will be + * listed, in the format "projects/{project_number}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} on 'data' event. + */ listKeysStream( - request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - options?: gax.CallOptions - ): Transform { + request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + options?: gax.CallOptions): + Transform{ request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1041,7 +824,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); const callSettings = new gax.CallSettings(options); this.initialize(); @@ -1052,31 +835,31 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ); } - /** - * Equivalent to {@link listKeys}, 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 name of the project that contains the keys that will be - * listed, in the format "projects/{project_number}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @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. - */ +/** + * Equivalent to {@link listKeys}, 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 name of the project that contains the keys that will be + * listed, in the format "projects/{project_number}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @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. + */ listKeysAsync( - request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - options?: gax.CallOptions - ): AsyncIterable { + request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + options?: gax.CallOptions): + AsyncIterable{ request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1084,14 +867,14 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - parent: request.parent || '', + 'parent': request.parent || '', }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listKeys.asyncIterate( this.innerApiCalls['listKeys'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1106,7 +889,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @param {string} assessment * @returns {string} Resource name string. */ - assessmentPath(project: string, assessment: string) { + assessmentPath(project:string,assessment:string) { return this.pathTemplates.assessmentPathTemplate.render({ project: project, assessment: assessment, @@ -1121,8 +904,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @returns {string} A string representing the project. */ matchProjectFromAssessmentName(assessmentName: string) { - return this.pathTemplates.assessmentPathTemplate.match(assessmentName) - .project; + return this.pathTemplates.assessmentPathTemplate.match(assessmentName).project; } /** @@ -1133,8 +915,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @returns {string} A string representing the assessment. */ matchAssessmentFromAssessmentName(assessmentName: string) { - return this.pathTemplates.assessmentPathTemplate.match(assessmentName) - .assessment; + return this.pathTemplates.assessmentPathTemplate.match(assessmentName).assessment; } /** @@ -1144,7 +925,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @param {string} key * @returns {string} Resource name string. */ - keyPath(project: string, key: string) { + keyPath(project:string,key:string) { return this.pathTemplates.keyPathTemplate.render({ project: project, key: key, @@ -1179,7 +960,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @param {string} project * @returns {string} Resource name string. */ - projectPath(project: string) { + projectPath(project:string) { return this.pathTemplates.projectPathTemplate.render({ project: project, }); diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 22ee1c34457..ed8e6e86ccf 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "21b09f555632c6f36d1a487ccac3567064077a49" + "sha": "fa5b1c493666627a49ac1793fb830f0b9e6bdbf1" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "1bd77e8ce6f953ac641af7966d0c52646afc16a8", - "internalRef": "305974465" + "sha": "3028060618e8024af9a32b3ab3456c160091ecb7", + "internalRef": "306450502" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5" + "sha": "52638600f387deb98efb5f9c85fec39e82aa9052" } } ], diff --git a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js index cb2d9ca7462..d0565cdf3b3 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js @@ -16,6 +16,7 @@ // ** 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 recaptchaenterprise = require('@google-cloud/recaptcha-enterprise'); diff --git a/packages/google-cloud-recaptchaenterprise/system-test/install.ts b/packages/google-cloud-recaptchaenterprise/system-test/install.ts index c4d80e9c0c8..5e4ed636481 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/install.ts +++ b/packages/google-cloud-recaptchaenterprise/system-test/install.ts @@ -16,36 +16,34 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; +import { packNTest } from 'pack-n-play'; +import { readFileSync } from 'fs'; +import { describe, it } from 'mocha'; describe('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. + 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(), - }, + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } }; - await packNTest(options); // will throw upon error. + 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. + 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(), - }, + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } }; - await packNTest(options); // will throw upon error. + await packNTest(options); // will throw upon error. }); + }); diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index 6a28b288ab3..ba427e14fe0 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -20,7 +20,7 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; +import { describe, it } from 'mocha'; import * as recaptchaenterpriseserviceModule from '../src'; import {PassThrough} from 'stream'; @@ -28,1362 +28,978 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); - return (instance.constructor as typeof protobuf.Message).fromObject( - filledObject - ) as T; + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; } function stubSimpleCall(response?: ResponseType, error?: Error) { - return error - ? sinon.stub().rejects(error) - : sinon.stub().resolves([response]); + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); } -function stubSimpleCallWithCallback( - response?: ResponseType, - error?: Error -) { - return error - ? sinon.stub().callsArgWith(2, error) - : sinon.stub().callsArgWith(2, null, response); +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); } -function stubPageStreamingCall( - responses?: ResponseType[], - error?: Error -) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } } - } - const transformStub = error - ? sinon.stub().callsArgWith(2, error) - : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { - mockStream.write({}); - }); + 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(); }); } - setImmediate(() => { - mockStream.end(); - }); - } else { - setImmediate(() => { - mockStream.write({}); - }); - setImmediate(() => { - mockStream.end(); - }); - } - return sinon.stub().returns(mockStream); + return sinon.stub().returns(mockStream); } -function stubAsyncIterationCall( - responses?: ResponseType[], - error?: Error -) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - }, - }; - }, - }; - return sinon.stub().returns(asyncIterable); +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); } describe('v1.RecaptchaEnterpriseServiceClient', () => { - it('has servicePath', () => { - const servicePath = - recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient - .servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient - .apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = - recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - fallback: true, - } - ); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.recaptchaEnterpriseServiceStub, undefined); - await client.initialize(); - assert(client.recaptchaEnterpriseServiceStub); - }); - - it('has close method', () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.close(); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - 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 recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - 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('createAssessment', () => { - it('invokes createAssessment without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Assessment() - ); - client.innerApiCalls.createAssessment = stubSimpleCall(expectedResponse); - const [response] = await client.createAssessment(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has servicePath', () => { + const servicePath = recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient.servicePath; + assert(servicePath); }); - it('invokes createAssessment without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Assessment() - ); - client.innerApiCalls.createAssessment = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.createAssessment( - request, - ( - err?: Error | null, - result?: protos.google.cloud.recaptchaenterprise.v1.IAssessment | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('has apiEndpoint', () => { + const apiEndpoint = recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient.apiEndpoint; + assert(apiEndpoint); }); - it('invokes createAssessment with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createAssessment = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.createAssessment(request); - }, expectedError); - assert( - (client.innerApiCalls.createAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has port', () => { + const port = recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient.port; + assert(port); + assert(typeof port === 'number'); }); - }); - describe('annotateAssessment', () => { - it('invokes annotateAssessment without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse() - ); - client.innerApiCalls.annotateAssessment = stubSimpleCall( - expectedResponse - ); - const [response] = await client.annotateAssessment(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('should create a client with no option', () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(); + assert(client); }); - it('invokes annotateAssessment without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse() - ); - client.innerApiCalls.annotateAssessment = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.annotateAssessment( - request, - ( - err?: Error | null, - result?: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('should create a client with gRPC fallback', () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + fallback: true, + }); + assert(client); }); - it('invokes annotateAssessment with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.annotateAssessment = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.annotateAssessment(request); - }, expectedError); - assert( - (client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has initialize method and supports deferred initialization', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.recaptchaEnterpriseServiceStub, undefined); + await client.initialize(); + assert(client.recaptchaEnterpriseServiceStub); }); - }); - describe('createKey', () => { - it('invokes createKey without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ); - client.innerApiCalls.createKey = stubSimpleCall(expectedResponse); - const [response] = await client.createKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has close method', () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.close(); }); - it('invokes createKey without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ); - client.innerApiCalls.createKey = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.createKey( - request, - ( - err?: Error | null, - result?: protos.google.cloud.recaptchaenterprise.v1.IKey | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - it('invokes createKey with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.createKey(request); - }, expectedError); - assert( - (client.innerApiCalls.createKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + 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('createAssessment', () => { + it('invokes createAssessment without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Assessment()); + client.innerApiCalls.createAssessment = stubSimpleCall(expectedResponse); + const [response] = await client.createAssessment(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createAssessment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - describe('getKey', () => { - it('invokes getKey without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ); - client.innerApiCalls.getKey = stubSimpleCall(expectedResponse); - const [response] = await client.getKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes createAssessment without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Assessment()); + client.innerApiCalls.createAssessment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAssessment( + request, + (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1.IAssessment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createAssessment as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes getKey without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ); - client.innerApiCalls.getKey = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.getKey( - request, - ( - err?: Error | null, - result?: protos.google.cloud.recaptchaenterprise.v1.IKey | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('invokes createAssessment with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createAssessment = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.createAssessment(request); }, expectedError); + assert((client.innerApiCalls.createAssessment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - it('invokes getKey with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.getKey(request); - }, expectedError); - assert( - (client.innerApiCalls.getKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); + describe('annotateAssessment', () => { + it('invokes annotateAssessment without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse()); + client.innerApiCalls.annotateAssessment = stubSimpleCall(expectedResponse); + const [response] = await client.annotateAssessment(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - describe('updateKey', () => { - it('invokes updateKey without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() - ); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = 'key.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ); - client.innerApiCalls.updateKey = stubSimpleCall(expectedResponse); - const [response] = await client.updateKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes annotateAssessment without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse()); + client.innerApiCalls.annotateAssessment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.annotateAssessment( + request, + (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes updateKey without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() - ); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = 'key.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ); - client.innerApiCalls.updateKey = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.updateKey( - request, - ( - err?: Error | null, - result?: protos.google.cloud.recaptchaenterprise.v1.IKey | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('invokes annotateAssessment with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.annotateAssessment = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.annotateAssessment(request); }, expectedError); + assert((client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - it('invokes updateKey with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() - ); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = 'key.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.updateKey(request); - }, expectedError); - assert( - (client.innerApiCalls.updateKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); + describe('createKey', () => { + it('invokes createKey without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()); + client.innerApiCalls.createKey = stubSimpleCall(expectedResponse); + const [response] = await client.createKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - describe('deleteKey', () => { - it('invokes deleteKey without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteKey = stubSimpleCall(expectedResponse); - const [response] = await client.deleteKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes createKey without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()); + client.innerApiCalls.createKey = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createKey( + request, + (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1.IKey|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes deleteKey without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteKey = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.deleteKey( - request, - ( - err?: Error | null, - result?: protos.google.protobuf.IEmpty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('invokes createKey with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.createKey(request); }, expectedError); + assert((client.innerApiCalls.createKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - it('invokes deleteKey with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.deleteKey(request); - }, expectedError); - assert( - (client.innerApiCalls.deleteKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); + describe('getKey', () => { + it('invokes getKey without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()); + client.innerApiCalls.getKey = stubSimpleCall(expectedResponse); + const [response] = await client.getKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - describe('listKeys', () => { - it('invokes listKeys without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ), - ]; - client.innerApiCalls.listKeys = stubSimpleCall(expectedResponse); - const [response] = await client.listKeys(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listKeys as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes getKey without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()); + client.innerApiCalls.getKey = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getKey( + request, + (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1.IKey|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes listKeys without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ), - ]; - client.innerApiCalls.listKeys = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.listKeys( - request, - ( - err?: Error | null, - result?: protos.google.cloud.recaptchaenterprise.v1.IKey[] | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listKeys as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('invokes getKey with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.getKey(request); }, expectedError); + assert((client.innerApiCalls.getKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - it('invokes listKeys with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.listKeys(request); - }, expectedError); - assert( - (client.innerApiCalls.listKeys as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + describe('updateKey', () => { + it('invokes updateKey without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest()); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = "key.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()); + client.innerApiCalls.updateKey = stubSimpleCall(expectedResponse); + const [response] = await client.updateKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes listKeysStream without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ), - ]; - client.descriptors.page.listKeys.createStream = stubPageStreamingCall( - expectedResponse - ); - const stream = client.listKeysStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.recaptchaenterprise.v1.Key[] = []; - stream.on( - 'data', - (response: protos.google.cloud.recaptchaenterprise.v1.Key) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); + it('invokes updateKey without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest()); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = "key.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()); + client.innerApiCalls.updateKey = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateKey( + request, + (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1.IKey|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); }); - stream.on('error', (err: Error) => { - reject(err); + + it('invokes updateKey with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest()); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = "key.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.updateKey(request); }, expectedError); + assert((client.innerApiCalls.updateKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert( - (client.descriptors.page.listKeys.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listKeys, request) - ); - assert.strictEqual( - (client.descriptors.page.listKeys.createStream as SinonStub).getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); }); - it('invokes listKeysStream with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedError = new Error('expected'); - client.descriptors.page.listKeys.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listKeysStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.recaptchaenterprise.v1.Key[] = []; - stream.on( - 'data', - (response: protos.google.cloud.recaptchaenterprise.v1.Key) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); + describe('deleteKey', () => { + it('invokes deleteKey without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteKey = stubSimpleCall(expectedResponse); + const [response] = await client.deleteKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); }); - }); - await assert.rejects(async () => { - await promise; - }, expectedError); - assert( - (client.descriptors.page.listKeys.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listKeys, request) - ); - assert.strictEqual( - (client.descriptors.page.listKeys.createStream as SinonStub).getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - it('uses async iteration with listKeys without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.Key() - ), - ]; - client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.recaptchaenterprise.v1.IKey[] = []; - const iterable = client.listKeysAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) - .args[1], - request - ); - assert.strictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('invokes deleteKey without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteKey = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteKey( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('uses async iteration with listKeys with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedError = new Error('expected'); - client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listKeysAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.recaptchaenterprise.v1.IKey[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) - .args[1], - request - ); - assert.strictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); + it('invokes deleteKey with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.deleteKey(request); }, expectedError); + assert((client.innerApiCalls.deleteKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - }); - - describe('Path templates', () => { - describe('assessment', () => { - const fakePath = '/rendered/path/assessment'; - const expectedParameters = { - project: 'projectValue', - assessment: 'assessmentValue', - }; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - client.pathTemplates.assessmentPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.assessmentPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - it('assessmentPath', () => { - const result = client.assessmentPath('projectValue', 'assessmentValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.assessmentPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); + describe('listKeys', () => { + it('invokes listKeys without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), + ]; + client.innerApiCalls.listKeys = stubSimpleCall(expectedResponse); + const [response] = await client.listKeys(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listKeys as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('matchProjectFromAssessmentName', () => { - const result = client.matchProjectFromAssessmentName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.assessmentPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + it('invokes listKeys without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), + ]; + client.innerApiCalls.listKeys = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listKeys( + request, + (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1.IKey[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listKeys as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('matchAssessmentFromAssessmentName', () => { - const result = client.matchAssessmentFromAssessmentName(fakePath); - assert.strictEqual(result, 'assessmentValue'); - assert( - (client.pathTemplates.assessmentPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); + it('invokes listKeys with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.listKeys(request); }, expectedError); + assert((client.innerApiCalls.listKeys as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - describe('key', () => { - const fakePath = '/rendered/path/key'; - const expectedParameters = { - project: 'projectValue', - key: 'keyValue', - }; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - client.pathTemplates.keyPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.keyPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + it('invokes listKeysStream without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), + ]; + client.descriptors.page.listKeys.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1.Key[] = []; + stream.on('data', (response: protos.google.cloud.recaptchaenterprise.v1.Key) => { + 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.listKeys.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listKeys, request)); + assert.strictEqual( + (client.descriptors.page.listKeys.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('keyPath', () => { - const result = client.keyPath('projectValue', 'keyValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.keyPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); + it('invokes listKeysStream with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listKeys.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1.Key[] = []; + stream.on('data', (response: protos.google.cloud.recaptchaenterprise.v1.Key) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(async () => { await promise; }, expectedError); + assert((client.descriptors.page.listKeys.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listKeys, request)); + assert.strictEqual( + (client.descriptors.page.listKeys.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('matchProjectFromKeyName', () => { - const result = client.matchProjectFromKeyName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.keyPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + it('uses async iteration with listKeys without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), + ]; + client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.recaptchaenterprise.v1.IKey[] = []; + const iterable = client.listKeysAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('matchKeyFromKeyName', () => { - const result = client.matchKeyFromKeyName(fakePath); - assert.strictEqual(result, 'keyValue'); - assert( - (client.pathTemplates.keyPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + it('uses async iteration with listKeys with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listKeysAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.recaptchaenterprise.v1.IKey[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); }); - describe('project', () => { - const fakePath = '/rendered/path/project'; - const expectedParameters = { - project: 'projectValue', - }; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.projectPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + describe('Path templates', () => { + + describe('assessment', () => { + const fakePath = "/rendered/path/assessment"; + const expectedParameters = { + project: "projectValue", + assessment: "assessmentValue", + }; + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.assessmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.assessmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('assessmentPath', () => { + const result = client.assessmentPath("projectValue", "assessmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.assessmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAssessmentName', () => { + const result = client.matchProjectFromAssessmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.assessmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAssessmentFromAssessmentName', () => { + const result = client.matchAssessmentFromAssessmentName(fakePath); + assert.strictEqual(result, "assessmentValue"); + assert((client.pathTemplates.assessmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); - it('projectPath', () => { - const result = client.projectPath('projectValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); + describe('key', () => { + const fakePath = "/rendered/path/key"; + const expectedParameters = { + project: "projectValue", + key: "keyValue", + }; + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.keyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.keyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('keyPath', () => { + const result = client.keyPath("projectValue", "keyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.keyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromKeyName', () => { + const result = client.matchProjectFromKeyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.keyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchKeyFromKeyName', () => { + const result = client.matchKeyFromKeyName(fakePath); + assert.strictEqual(result, "keyValue"); + assert((client.pathTemplates.keyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); }); - }); }); diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts index da6ed0287f8..a90909e64af 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts @@ -20,7 +20,7 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; +import { describe, it } from 'mocha'; import * as recaptchaenterpriseservicev1beta1Module from '../src'; import {PassThrough} from 'stream'; @@ -28,1365 +28,978 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); - return (instance.constructor as typeof protobuf.Message).fromObject( - filledObject - ) as T; + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; } function stubSimpleCall(response?: ResponseType, error?: Error) { - return error - ? sinon.stub().rejects(error) - : sinon.stub().resolves([response]); + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); } -function stubSimpleCallWithCallback( - response?: ResponseType, - error?: Error -) { - return error - ? sinon.stub().callsArgWith(2, error) - : sinon.stub().callsArgWith(2, null, response); +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); } -function stubPageStreamingCall( - responses?: ResponseType[], - error?: Error -) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } } - } - const transformStub = error - ? sinon.stub().callsArgWith(2, error) - : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { - mockStream.write({}); - }); + 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(); }); } - setImmediate(() => { - mockStream.end(); - }); - } else { - setImmediate(() => { - mockStream.write({}); - }); - setImmediate(() => { - mockStream.end(); - }); - } - return sinon.stub().returns(mockStream); + return sinon.stub().returns(mockStream); } -function stubAsyncIterationCall( - responses?: ResponseType[], - error?: Error -) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - }, - }; - }, - }; - return sinon.stub().returns(asyncIterable); +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); } describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { - it('has servicePath', () => { - const servicePath = - recaptchaenterpriseservicev1beta1Module.v1beta1 - .RecaptchaEnterpriseServiceV1Beta1Client.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - recaptchaenterpriseservicev1beta1Module.v1beta1 - .RecaptchaEnterpriseServiceV1Beta1Client.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = - recaptchaenterpriseservicev1beta1Module.v1beta1 - .RecaptchaEnterpriseServiceV1Beta1Client.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - fallback: true, - } - ); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.recaptchaEnterpriseServiceV1Beta1Stub, undefined); - await client.initialize(); - assert(client.recaptchaEnterpriseServiceV1Beta1Stub); - }); - - it('has close method', () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.close(); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - 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 recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - 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('createAssessment', () => { - it('invokes createAssessment without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Assessment() - ); - client.innerApiCalls.createAssessment = stubSimpleCall(expectedResponse); - const [response] = await client.createAssessment(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has servicePath', () => { + const servicePath = recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client.servicePath; + assert(servicePath); }); - it('invokes createAssessment without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Assessment() - ); - client.innerApiCalls.createAssessment = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.createAssessment( - request, - ( - err?: Error | null, - result?: protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('has apiEndpoint', () => { + const apiEndpoint = recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client.apiEndpoint; + assert(apiEndpoint); }); - it('invokes createAssessment with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createAssessment = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.createAssessment(request); - }, expectedError); - assert( - (client.innerApiCalls.createAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has port', () => { + const port = recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client.port; + assert(port); + assert(typeof port === 'number'); }); - }); - describe('annotateAssessment', () => { - it('invokes annotateAssessment without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse() - ); - client.innerApiCalls.annotateAssessment = stubSimpleCall( - expectedResponse - ); - const [response] = await client.annotateAssessment(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('should create a client with no option', () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); + assert(client); }); - it('invokes annotateAssessment without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse() - ); - client.innerApiCalls.annotateAssessment = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.annotateAssessment( - request, - ( - err?: Error | null, - result?: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('should create a client with gRPC fallback', () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + fallback: true, + }); + assert(client); }); - it('invokes annotateAssessment with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.annotateAssessment = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.annotateAssessment(request); - }, expectedError); - assert( - (client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has initialize method and supports deferred initialization', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.recaptchaEnterpriseServiceV1Beta1Stub, undefined); + await client.initialize(); + assert(client.recaptchaEnterpriseServiceV1Beta1Stub); }); - }); - describe('createKey', () => { - it('invokes createKey without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ); - client.innerApiCalls.createKey = stubSimpleCall(expectedResponse); - const [response] = await client.createKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has close method', () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.close(); }); - it('invokes createKey without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ); - client.innerApiCalls.createKey = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.createKey( - request, - ( - err?: Error | null, - result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - it('invokes createKey with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.createKey(request); - }, expectedError); - assert( - (client.innerApiCalls.createKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + 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('createAssessment', () => { + it('invokes createAssessment without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Assessment()); + client.innerApiCalls.createAssessment = stubSimpleCall(expectedResponse); + const [response] = await client.createAssessment(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createAssessment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - describe('getKey', () => { - it('invokes getKey without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ); - client.innerApiCalls.getKey = stubSimpleCall(expectedResponse); - const [response] = await client.getKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes createAssessment without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Assessment()); + client.innerApiCalls.createAssessment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAssessment( + request, + (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createAssessment as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes getKey without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ); - client.innerApiCalls.getKey = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.getKey( - request, - ( - err?: Error | null, - result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('invokes createAssessment with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createAssessment = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.createAssessment(request); }, expectedError); + assert((client.innerApiCalls.createAssessment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - it('invokes getKey with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.getKey(request); - }, expectedError); - assert( - (client.innerApiCalls.getKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); + describe('annotateAssessment', () => { + it('invokes annotateAssessment without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse()); + client.innerApiCalls.annotateAssessment = stubSimpleCall(expectedResponse); + const [response] = await client.annotateAssessment(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - describe('updateKey', () => { - it('invokes updateKey without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() - ); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = 'key.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ); - client.innerApiCalls.updateKey = stubSimpleCall(expectedResponse); - const [response] = await client.updateKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes annotateAssessment without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse()); + client.innerApiCalls.annotateAssessment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.annotateAssessment( + request, + (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes updateKey without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() - ); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = 'key.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ); - client.innerApiCalls.updateKey = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.updateKey( - request, - ( - err?: Error | null, - result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('invokes annotateAssessment with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.annotateAssessment = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.annotateAssessment(request); }, expectedError); + assert((client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - it('invokes updateKey with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() - ); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = 'key.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.updateKey(request); - }, expectedError); - assert( - (client.innerApiCalls.updateKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); + describe('createKey', () => { + it('invokes createKey without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()); + client.innerApiCalls.createKey = stubSimpleCall(expectedResponse); + const [response] = await client.createKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - describe('deleteKey', () => { - it('invokes deleteKey without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteKey = stubSimpleCall(expectedResponse); - const [response] = await client.deleteKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes createKey without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()); + client.innerApiCalls.createKey = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createKey( + request, + (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes deleteKey without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteKey = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.deleteKey( - request, - ( - err?: Error | null, - result?: protos.google.protobuf.IEmpty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('invokes createKey with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.createKey(request); }, expectedError); + assert((client.innerApiCalls.createKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - it('invokes deleteKey with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.deleteKey(request); - }, expectedError); - assert( - (client.innerApiCalls.deleteKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); + describe('getKey', () => { + it('invokes getKey without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()); + client.innerApiCalls.getKey = stubSimpleCall(expectedResponse); + const [response] = await client.getKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - describe('listKeys', () => { - it('invokes listKeys without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - ]; - client.innerApiCalls.listKeys = stubSimpleCall(expectedResponse); - const [response] = await client.listKeys(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listKeys as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes getKey without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()); + client.innerApiCalls.getKey = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getKey( + request, + (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes listKeys without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - ]; - client.innerApiCalls.listKeys = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.listKeys( - request, - ( - err?: Error | null, - result?: - | protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] - | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listKeys as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('invokes getKey with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.getKey(request); }, expectedError); + assert((client.innerApiCalls.getKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - it('invokes listKeys with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.listKeys(request); - }, expectedError); - assert( - (client.innerApiCalls.listKeys as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + describe('updateKey', () => { + it('invokes updateKey without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest()); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = "key.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()); + client.innerApiCalls.updateKey = stubSimpleCall(expectedResponse); + const [response] = await client.updateKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes listKeysStream without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - ]; - client.descriptors.page.listKeys.createStream = stubPageStreamingCall( - expectedResponse - ); - const stream = client.listKeysStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = []; - stream.on( - 'data', - (response: protos.google.cloud.recaptchaenterprise.v1beta1.Key) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); + it('invokes updateKey without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest()); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = "key.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()); + client.innerApiCalls.updateKey = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateKey( + request, + (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); }); - stream.on('error', (err: Error) => { - reject(err); + + it('invokes updateKey with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest()); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = "key.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.updateKey(request); }, expectedError); + assert((client.innerApiCalls.updateKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert( - (client.descriptors.page.listKeys.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listKeys, request) - ); - assert.strictEqual( - (client.descriptors.page.listKeys.createStream as SinonStub).getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); }); - it('invokes listKeysStream with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedError = new Error('expected'); - client.descriptors.page.listKeys.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listKeysStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = []; - stream.on( - 'data', - (response: protos.google.cloud.recaptchaenterprise.v1beta1.Key) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); + describe('deleteKey', () => { + it('invokes deleteKey without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteKey = stubSimpleCall(expectedResponse); + const [response] = await client.deleteKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); }); - }); - await assert.rejects(async () => { - await promise; - }, expectedError); - assert( - (client.descriptors.page.listKeys.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listKeys, request) - ); - assert.strictEqual( - (client.descriptors.page.listKeys.createStream as SinonStub).getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - it('uses async iteration with listKeys without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - ]; - client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = []; - const iterable = client.listKeysAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) - .args[1], - request - ); - assert.strictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('invokes deleteKey without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteKey = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteKey( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('uses async iteration with listKeys with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedError = new Error('expected'); - client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listKeysAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) - .args[1], - request - ); - assert.strictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); + it('invokes deleteKey with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.deleteKey(request); }, expectedError); + assert((client.innerApiCalls.deleteKey as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); }); - }); - - describe('Path templates', () => { - describe('assessment', () => { - const fakePath = '/rendered/path/assessment'; - const expectedParameters = { - project: 'projectValue', - assessment: 'assessmentValue', - }; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - client.pathTemplates.assessmentPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.assessmentPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - it('assessmentPath', () => { - const result = client.assessmentPath('projectValue', 'assessmentValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.assessmentPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); + describe('listKeys', () => { + it('invokes listKeys without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), + ]; + client.innerApiCalls.listKeys = stubSimpleCall(expectedResponse); + const [response] = await client.listKeys(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listKeys as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('matchProjectFromAssessmentName', () => { - const result = client.matchProjectFromAssessmentName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.assessmentPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + it('invokes listKeys without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), + ]; + client.innerApiCalls.listKeys = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listKeys( + request, + (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listKeys as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('matchAssessmentFromAssessmentName', () => { - const result = client.matchAssessmentFromAssessmentName(fakePath); - assert.strictEqual(result, 'assessmentValue'); - assert( - (client.pathTemplates.assessmentPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); + it('invokes listKeys with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { await client.listKeys(request); }, expectedError); + assert((client.innerApiCalls.listKeys as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - describe('key', () => { - const fakePath = '/rendered/path/key'; - const expectedParameters = { - project: 'projectValue', - key: 'keyValue', - }; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - client.pathTemplates.keyPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.keyPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + it('invokes listKeysStream without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), + ]; + client.descriptors.page.listKeys.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = []; + stream.on('data', (response: protos.google.cloud.recaptchaenterprise.v1beta1.Key) => { + 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.listKeys.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listKeys, request)); + assert.strictEqual( + (client.descriptors.page.listKeys.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('keyPath', () => { - const result = client.keyPath('projectValue', 'keyValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.keyPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); + it('invokes listKeysStream with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listKeys.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = []; + stream.on('data', (response: protos.google.cloud.recaptchaenterprise.v1beta1.Key) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(async () => { await promise; }, expectedError); + assert((client.descriptors.page.listKeys.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listKeys, request)); + assert.strictEqual( + (client.descriptors.page.listKeys.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('matchProjectFromKeyName', () => { - const result = client.matchProjectFromKeyName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.keyPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + it('uses async iteration with listKeys without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), + generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), + ]; + client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = []; + const iterable = client.listKeysAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('matchKeyFromKeyName', () => { - const result = client.matchKeyFromKeyName(fakePath); - assert.strictEqual(result, 'keyValue'); - assert( - (client.pathTemplates.keyPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + it('uses async iteration with listKeys with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listKeysAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); }); - describe('project', () => { - const fakePath = '/rendered/path/project'; - const expectedParameters = { - project: 'projectValue', - }; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.projectPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + describe('Path templates', () => { + + describe('assessment', () => { + const fakePath = "/rendered/path/assessment"; + const expectedParameters = { + project: "projectValue", + assessment: "assessmentValue", + }; + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.assessmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.assessmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('assessmentPath', () => { + const result = client.assessmentPath("projectValue", "assessmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.assessmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAssessmentName', () => { + const result = client.matchProjectFromAssessmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.assessmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAssessmentFromAssessmentName', () => { + const result = client.matchAssessmentFromAssessmentName(fakePath); + assert.strictEqual(result, "assessmentValue"); + assert((client.pathTemplates.assessmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); - it('projectPath', () => { - const result = client.projectPath('projectValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); + describe('key', () => { + const fakePath = "/rendered/path/key"; + const expectedParameters = { + project: "projectValue", + key: "keyValue", + }; + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.keyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.keyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('keyPath', () => { + const result = client.keyPath("projectValue", "keyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.keyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromKeyName', () => { + const result = client.matchProjectFromKeyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.keyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchKeyFromKeyName', () => { + const result = client.matchKeyFromKeyName(fakePath); + assert.strictEqual(result, "keyValue"); + assert((client.pathTemplates.keyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); }); - }); }); diff --git a/packages/google-cloud-recaptchaenterprise/webpack.config.js b/packages/google-cloud-recaptchaenterprise/webpack.config.js index 04831b77a4d..2435e0e2d56 100644 --- a/packages/google-cloud-recaptchaenterprise/webpack.config.js +++ b/packages/google-cloud-recaptchaenterprise/webpack.config.js @@ -36,27 +36,27 @@ module.exports = { { test: /\.tsx?$/, use: 'ts-loader', - exclude: /node_modules/, + exclude: /node_modules/ }, { test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader', + use: 'null-loader' }, { test: /node_modules[\\/]grpc/, - use: 'null-loader', + use: 'null-loader' }, { test: /node_modules[\\/]retry-request/, - use: 'null-loader', + use: 'null-loader' }, { test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader', + use: 'null-loader' }, { test: /node_modules[\\/]gtoken/, - use: 'null-loader', + use: 'null-loader' }, ], }, From 9beac7c5b5e745346d3ec31b8353243eed1aea84 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 21 Apr 2020 20:31:17 -0700 Subject: [PATCH 110/253] build: adopt changes to generator formatting (#166) --- .../protos/protos.js | 414 ++-- .../v1/recaptcha_enterprise_service_client.ts | 1107 +++++---- ...tcha_enterprise_service_v1_beta1_client.ts | 1131 +++++---- .../synth.metadata | 8 +- .../system-test/fixtures/sample/src/index.js | 1 - .../system-test/install.ts | 32 +- .../gapic_recaptcha_enterprise_service_v1.ts | 2200 +++++++++------- ...cha_enterprise_service_v1_beta1_v1beta1.ts | 2203 ++++++++++------- .../webpack.config.js | 12 +- 9 files changed, 4147 insertions(+), 2961 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 95df1028294..6ab2d1c40c7 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -397,9 +397,9 @@ CreateAssessmentRequest.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.assessment != null && message.hasOwnProperty("assessment")) + if (message.assessment != null && Object.hasOwnProperty.call(message, "assessment")) $root.google.cloud.recaptchaenterprise.v1.Assessment.encode(message.assessment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -612,9 +612,9 @@ AnnotateAssessmentRequest.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.annotation != null && message.hasOwnProperty("annotation")) + if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.annotation); return writer; }; @@ -785,7 +785,7 @@ /** * Annotation enum. * @name google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation - * @enum {string} + * @enum {number} * @property {number} ANNOTATION_UNSPECIFIED=0 ANNOTATION_UNSPECIFIED value * @property {number} LEGITIMATE=1 LEGITIMATE value * @property {number} FRAUDULENT=2 FRAUDULENT value @@ -1048,13 +1048,13 @@ Assessment.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.event != null && message.hasOwnProperty("event")) + if (message.event != null && Object.hasOwnProperty.call(message, "event")) $root.google.cloud.recaptchaenterprise.v1.Event.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.riskAnalysis != null && message.hasOwnProperty("riskAnalysis")) + if (message.riskAnalysis != null && Object.hasOwnProperty.call(message, "riskAnalysis")) $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.encode(message.riskAnalysis, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) + if (message.tokenProperties != null && Object.hasOwnProperty.call(message, "tokenProperties")) $root.google.cloud.recaptchaenterprise.v1.TokenProperties.encode(message.tokenProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -1326,15 +1326,15 @@ Event.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.token != null && message.hasOwnProperty("token")) + if (message.token != null && Object.hasOwnProperty.call(message, "token")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); - if (message.siteKey != null && message.hasOwnProperty("siteKey")) + if (message.siteKey != null && Object.hasOwnProperty.call(message, "siteKey")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.siteKey); - if (message.userAgent != null && message.hasOwnProperty("userAgent")) + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.userAgent); - if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) + if (message.userIpAddress != null && Object.hasOwnProperty.call(message, "userIpAddress")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.userIpAddress); - if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) + if (message.expectedAction != null && Object.hasOwnProperty.call(message, "expectedAction")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.expectedAction); return writer; }; @@ -1576,7 +1576,7 @@ RiskAnalysis.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.score != null && message.hasOwnProperty("score")) + if (message.score != null && Object.hasOwnProperty.call(message, "score")) writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); if (message.reasons != null && message.reasons.length) { writer.uint32(/* id 2, wireType 2 =*/18).fork(); @@ -1779,7 +1779,7 @@ /** * ClassificationReason enum. * @name google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason - * @enum {string} + * @enum {number} * @property {number} CLASSIFICATION_REASON_UNSPECIFIED=0 CLASSIFICATION_REASON_UNSPECIFIED value * @property {number} AUTOMATION=1 AUTOMATION value * @property {number} UNEXPECTED_ENVIRONMENT=2 UNEXPECTED_ENVIRONMENT value @@ -1893,15 +1893,15 @@ TokenProperties.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.valid != null && message.hasOwnProperty("valid")) + if (message.valid != null && Object.hasOwnProperty.call(message, "valid")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid); - if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) + if (message.invalidReason != null && Object.hasOwnProperty.call(message, "invalidReason")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.invalidReason); - 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 3, wireType 2 =*/26).fork()).ldelim(); - if (message.hostname != null && message.hasOwnProperty("hostname")) + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.hostname); - if (message.action != null && message.hasOwnProperty("action")) + if (message.action != null && Object.hasOwnProperty.call(message, "action")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.action); return writer; }; @@ -2115,7 +2115,7 @@ /** * InvalidReason enum. * @name google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason - * @enum {string} + * @enum {number} * @property {number} INVALID_REASON_UNSPECIFIED=0 INVALID_REASON_UNSPECIFIED value * @property {number} UNKNOWN_INVALID_REASON=1 UNKNOWN_INVALID_REASON value * @property {number} MALFORMED=2 MALFORMED value @@ -2202,9 +2202,9 @@ CreateKeyRequest.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.key != null && message.hasOwnProperty("key")) + if (message.key != null && Object.hasOwnProperty.call(message, "key")) $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -2426,11 +2426,11 @@ ListKeysRequest.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); return writer; }; @@ -2653,7 +2653,7 @@ if (message.keys != null && message.keys.length) for (var i = 0; i < message.keys.length; ++i) $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.keys[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; }; @@ -2871,7 +2871,7 @@ GetKeyRequest.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; }; @@ -3067,9 +3067,9 @@ UpdateKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && message.hasOwnProperty("key")) + if (message.key != null && Object.hasOwnProperty.call(message, "key")) $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - 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(); return writer; }; @@ -3278,7 +3278,7 @@ DeleteKeyRequest.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; }; @@ -3534,20 +3534,20 @@ Key.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.webSettings != null && message.hasOwnProperty("webSettings")) + if (message.webSettings != null && Object.hasOwnProperty.call(message, "webSettings")) $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.encode(message.webSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) + if (message.androidSettings != null && Object.hasOwnProperty.call(message, "androidSettings")) $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.encode(message.androidSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) + if (message.iosSettings != null && Object.hasOwnProperty.call(message, "iosSettings")) $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.encode(message.iosSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - 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 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).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 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -3901,13 +3901,13 @@ if (message.allowedDomains != null && message.allowedDomains.length) for (var i = 0; i < message.allowedDomains.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedDomains[i]); - if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) + if (message.allowAmpTraffic != null && Object.hasOwnProperty.call(message, "allowAmpTraffic")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAmpTraffic); - if (message.allowAllDomains != null && message.hasOwnProperty("allowAllDomains")) + if (message.allowAllDomains != null && Object.hasOwnProperty.call(message, "allowAllDomains")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowAllDomains); - if (message.integrationType != null && message.hasOwnProperty("integrationType")) + if (message.integrationType != null && Object.hasOwnProperty.call(message, "integrationType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.integrationType); - if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) + if (message.challengeSecurityPreference != null && Object.hasOwnProperty.call(message, "challengeSecurityPreference")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.challengeSecurityPreference); return writer; }; @@ -4144,7 +4144,7 @@ /** * IntegrationType enum. * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType - * @enum {string} + * @enum {number} * @property {number} INTEGRATION_TYPE_UNSPECIFIED=0 INTEGRATION_TYPE_UNSPECIFIED value * @property {number} SCORE=1 SCORE value * @property {number} CHECKBOX=2 CHECKBOX value @@ -4162,7 +4162,7 @@ /** * ChallengeSecurityPreference enum. * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference - * @enum {string} + * @enum {number} * @property {number} CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED=0 CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED value * @property {number} USABILITY=1 USABILITY value * @property {number} BALANCE=2 BALANCE value @@ -4929,9 +4929,9 @@ CreateAssessmentRequest.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.assessment != null && message.hasOwnProperty("assessment")) + if (message.assessment != null && Object.hasOwnProperty.call(message, "assessment")) $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.encode(message.assessment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -5144,9 +5144,9 @@ AnnotateAssessmentRequest.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.annotation != null && message.hasOwnProperty("annotation")) + if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.annotation); return writer; }; @@ -5307,7 +5307,7 @@ /** * Annotation enum. * @name google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation - * @enum {string} + * @enum {number} * @property {number} ANNOTATION_UNSPECIFIED=0 ANNOTATION_UNSPECIFIED value * @property {number} LEGITIMATE=1 LEGITIMATE value * @property {number} FRAUDULENT=2 FRAUDULENT value @@ -5576,13 +5576,13 @@ Assessment.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.event != null && message.hasOwnProperty("event")) + if (message.event != null && Object.hasOwnProperty.call(message, "event")) $root.google.cloud.recaptchaenterprise.v1beta1.Event.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.score != null && message.hasOwnProperty("score")) + if (message.score != null && Object.hasOwnProperty.call(message, "score")) writer.uint32(/* id 3, wireType 5 =*/29).float(message.score); - if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) + if (message.tokenProperties != null && Object.hasOwnProperty.call(message, "tokenProperties")) $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.encode(message.tokenProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.reasons != null && message.reasons.length) { writer.uint32(/* id 5, wireType 2 =*/42).fork(); @@ -5829,7 +5829,7 @@ /** * ClassificationReason enum. * @name google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason - * @enum {string} + * @enum {number} * @property {number} CLASSIFICATION_REASON_UNSPECIFIED=0 CLASSIFICATION_REASON_UNSPECIFIED value * @property {number} AUTOMATION=1 AUTOMATION value * @property {number} UNEXPECTED_ENVIRONMENT=2 UNEXPECTED_ENVIRONMENT value @@ -5943,15 +5943,15 @@ Event.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.token != null && message.hasOwnProperty("token")) + if (message.token != null && Object.hasOwnProperty.call(message, "token")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); - if (message.siteKey != null && message.hasOwnProperty("siteKey")) + if (message.siteKey != null && Object.hasOwnProperty.call(message, "siteKey")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.siteKey); - if (message.userAgent != null && message.hasOwnProperty("userAgent")) + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.userAgent); - if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) + if (message.userIpAddress != null && Object.hasOwnProperty.call(message, "userIpAddress")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.userIpAddress); - if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) + if (message.expectedAction != null && Object.hasOwnProperty.call(message, "expectedAction")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.expectedAction); return writer; }; @@ -6219,15 +6219,15 @@ TokenProperties.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.valid != null && message.hasOwnProperty("valid")) + if (message.valid != null && Object.hasOwnProperty.call(message, "valid")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid); - if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) + if (message.invalidReason != null && Object.hasOwnProperty.call(message, "invalidReason")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.invalidReason); - 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 3, wireType 2 =*/26).fork()).ldelim(); - if (message.hostname != null && message.hasOwnProperty("hostname")) + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.hostname); - if (message.action != null && message.hasOwnProperty("action")) + if (message.action != null && Object.hasOwnProperty.call(message, "action")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.action); return writer; }; @@ -6446,7 +6446,7 @@ /** * InvalidReason enum. * @name google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason - * @enum {string} + * @enum {number} * @property {number} INVALID_REASON_UNSPECIFIED=0 INVALID_REASON_UNSPECIFIED value * @property {number} UNKNOWN_INVALID_REASON=1 UNKNOWN_INVALID_REASON value * @property {number} MALFORMED=2 MALFORMED value @@ -6535,9 +6535,9 @@ CreateKeyRequest.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.key != null && message.hasOwnProperty("key")) + if (message.key != null && Object.hasOwnProperty.call(message, "key")) $root.google.cloud.recaptchaenterprise.v1beta1.Key.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -6759,11 +6759,11 @@ ListKeysRequest.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); return writer; }; @@ -6986,7 +6986,7 @@ if (message.keys != null && message.keys.length) for (var i = 0; i < message.keys.length; ++i) $root.google.cloud.recaptchaenterprise.v1beta1.Key.encode(message.keys[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; }; @@ -7204,7 +7204,7 @@ GetKeyRequest.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; }; @@ -7400,9 +7400,9 @@ UpdateKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && message.hasOwnProperty("key")) + if (message.key != null && Object.hasOwnProperty.call(message, "key")) $root.google.cloud.recaptchaenterprise.v1beta1.Key.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - 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(); return writer; }; @@ -7611,7 +7611,7 @@ DeleteKeyRequest.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; }; @@ -7848,15 +7848,15 @@ Key.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.webSettings != null && message.hasOwnProperty("webSettings")) + if (message.webSettings != null && Object.hasOwnProperty.call(message, "webSettings")) $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.encode(message.webSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) + if (message.androidSettings != null && Object.hasOwnProperty.call(message, "androidSettings")) $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.encode(message.androidSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) + if (message.iosSettings != null && Object.hasOwnProperty.call(message, "iosSettings")) $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.encode(message.iosSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -8163,13 +8163,13 @@ if (message.allowedDomains != null && message.allowedDomains.length) for (var i = 0; i < message.allowedDomains.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedDomains[i]); - if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) + if (message.allowAmpTraffic != null && Object.hasOwnProperty.call(message, "allowAmpTraffic")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAmpTraffic); - if (message.enforceAllowedDomains != null && message.hasOwnProperty("enforceAllowedDomains")) + if (message.enforceAllowedDomains != null && Object.hasOwnProperty.call(message, "enforceAllowedDomains")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enforceAllowedDomains); - if (message.integrationType != null && message.hasOwnProperty("integrationType")) + if (message.integrationType != null && Object.hasOwnProperty.call(message, "integrationType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.integrationType); - if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) + if (message.challengeSecurityPreference != null && Object.hasOwnProperty.call(message, "challengeSecurityPreference")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.challengeSecurityPreference); return writer; }; @@ -8406,7 +8406,7 @@ /** * IntegrationType enum. * @name google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType - * @enum {string} + * @enum {number} * @property {number} INTEGRATION_TYPE_UNSPECIFIED=0 INTEGRATION_TYPE_UNSPECIFIED value * @property {number} SCORE_ONLY=1 SCORE_ONLY value * @property {number} CHECKBOX_CHALLENGE=2 CHECKBOX_CHALLENGE value @@ -8424,7 +8424,7 @@ /** * ChallengeSecurityPreference enum. * @name google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference - * @enum {string} + * @enum {number} * @property {number} CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED=0 CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED value * @property {number} USABILITY=1 USABILITY value * @property {number} BALANCED=2 BALANCED value @@ -8935,7 +8935,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; }; @@ -9249,26 +9249,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; }; @@ -9625,9 +9625,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; }; @@ -9773,7 +9773,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 @@ -9894,18 +9894,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; }; @@ -10125,7 +10125,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 @@ -10206,9 +10206,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; }; @@ -10733,9 +10733,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) @@ -10752,9 +10752,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) @@ -10762,7 +10762,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; }; @@ -11300,7 +11300,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) @@ -11317,7 +11317,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) @@ -11782,11 +11782,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; }; @@ -12010,9 +12010,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; }; @@ -12503,25 +12503,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; }; @@ -12868,7 +12868,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 @@ -12914,7 +12914,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 @@ -12995,9 +12995,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; }; @@ -13240,12 +13240,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) @@ -13548,9 +13548,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; }; @@ -13770,11 +13770,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; }; @@ -14008,12 +14008,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; }; @@ -14293,17 +14293,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; }; @@ -14742,45 +14742,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) @@ -15207,7 +15207,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 @@ -15325,18 +15325,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; }; @@ -15678,17 +15678,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) @@ -15699,7 +15699,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; }; @@ -16035,7 +16035,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 @@ -16051,7 +16051,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 @@ -16350,9 +16350,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) @@ -16595,7 +16595,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) @@ -16844,14 +16844,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; }; @@ -17130,9 +17130,9 @@ 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) @@ -17140,7 +17140,7 @@ 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; }; @@ -17374,7 +17374,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 @@ -17504,17 +17504,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; }; @@ -18291,9 +18291,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) @@ -18824,11 +18824,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; }; @@ -19444,9 +19444,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; }; diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index e4f4b087195..57d53669357 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -17,11 +17,18 @@ // ** All changes to this file may be overwritten. ** import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; import * as path from 'path'; -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './recaptcha_enterprise_service_client_config.json'; @@ -40,7 +47,12 @@ export class RecaptchaEnterpriseServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; - descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}, batching: {}}; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; recaptchaEnterpriseServiceStub?: Promise<{[name: string]: Function}>; @@ -73,11 +85,14 @@ export class RecaptchaEnterpriseServiceClient { constructor(opts?: ClientOptions) { // Ensure that options include the service address and port. - const staticMembers = this.constructor as typeof RecaptchaEnterpriseServiceClient; - const servicePath = opts && opts.servicePath ? - opts.servicePath : - ((opts && opts.apiEndpoint) ? opts.apiEndpoint : - staticMembers.servicePath); + const staticMembers = this + .constructor as typeof RecaptchaEnterpriseServiceClient; + 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) { @@ -87,8 +102,8 @@ export class RecaptchaEnterpriseServiceClient { opts.port = opts.port || port; opts.clientConfig = opts.clientConfig || {}; - const isBrowser = (typeof window !== 'undefined'); - if (isBrowser){ + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { opts.fallback = true; } // If we are in browser, we are already using fallback because of the @@ -98,20 +113,18 @@ export class RecaptchaEnterpriseServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. - opts.scopes = (this.constructor as typeof RecaptchaEnterpriseServiceClient).scopes; + opts.scopes = (this + .constructor as typeof RecaptchaEnterpriseServiceClient).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); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -127,12 +140,18 @@ export class RecaptchaEnterpriseServiceClient { // For Node.js, pass the path to JSON proto file. // For browsers, pass the JSON content. - const nodejsProtoPath = path.join(__dirname, '..', '..', 'protos', 'protos.json'); + 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 + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated @@ -154,14 +173,20 @@ export class RecaptchaEnterpriseServiceClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { - listKeys: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'keys') + listKeys: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'keys' + ), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService', + 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 @@ -189,16 +214,27 @@ export class RecaptchaEnterpriseServiceClient { // Put together the "service stub" for // google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService. this.recaptchaEnterpriseServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService, - this._opts) as Promise<{[method: string]: Function}>; + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.recaptchaenterprise.v1 + .RecaptchaEnterpriseService, + 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 recaptchaEnterpriseServiceStubMethods = - ['createAssessment', 'annotateAssessment', 'createKey', 'listKeys', 'getKey', 'updateKey', 'deleteKey']; + const recaptchaEnterpriseServiceStubMethods = [ + 'createAssessment', + 'annotateAssessment', + 'createKey', + 'listKeys', + 'getKey', + 'updateKey', + 'deleteKey', + ]; for (const methodName of recaptchaEnterpriseServiceStubMethods) { const callPromise = this.recaptchaEnterpriseServiceStub.then( stub => (...args: Array<{}>) => { @@ -208,16 +244,17 @@ export class RecaptchaEnterpriseServiceClient { const func = stub[methodName]; return func.apply(stub, args); }, - (err: Error|null|undefined) => () => { + (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.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); this.innerApiCalls[methodName] = apiCall; @@ -253,9 +290,7 @@ export class RecaptchaEnterpriseServiceClient { * in this service. */ static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; + return ['https://www.googleapis.com/auth/cloud-platform']; } getProjectId(): Promise; @@ -265,8 +300,9 @@ export class RecaptchaEnterpriseServiceClient { * @param {function(Error, string)} callback - the callback to * be called with the current project Id. */ - getProjectId(callback?: Callback): - Promise|void { + getProjectId( + callback?: Callback + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -278,62 +314,89 @@ export class RecaptchaEnterpriseServiceClient { // -- Service calls -- // ------------------- createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1.IAssessment, - protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IAssessment, + ( + | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | undefined + ), + {} | undefined + ] + >; createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IAssessment, - protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAssessment, + | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IAssessment, - protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest|null|undefined, - {}|null|undefined>): void; -/** - * Creates an Assessment of the likelihood an event is legitimate. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which the assessment will be created, - * in the format "projects/{project}". - * @param {google.cloud.recaptchaenterprise.v1.Assessment} request.assessment - * Required. The assessment details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1.Assessment}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAssessment, + | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates an Assessment of the likelihood an event is legitimate. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the assessment will be created, + * in the format "projects/{project}". + * @param {google.cloud.recaptchaenterprise.v1.Assessment} request.assessment + * Required. The assessment details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1.Assessment}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, - optionsOrCallback?: gax.CallOptions|Callback< - protos.google.cloud.recaptchaenterprise.v1.IAssessment, - protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.recaptchaenterprise.v1.IAssessment, - protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1.IAssessment, - protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAssessment, + | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IAssessment, + ( + | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest + | undefined + ), + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -342,69 +405,96 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.createAssessment(request, options, callback); } annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, - protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + ( + | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | undefined + ), + {} | undefined + ] + >; annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, - protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, - protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest|null|undefined, - {}|null|undefined>): void; -/** - * Annotates a previously created Assessment to provide additional information - * on whether the event turned out to be authentic or fradulent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Assessment, in the format - * "projects/{project}/assessments/{assessment}". - * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} request.annotation - * Required. The annotation that will be assigned to the Event. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Annotates a previously created Assessment to provide additional information + * on whether the event turned out to be authentic or fradulent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Assessment, in the format + * "projects/{project}/assessments/{assessment}". + * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} request.annotation + * Required. The annotation that will be assigned to the Event. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, - optionsOrCallback?: gax.CallOptions|Callback< - protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, - protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, - protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, - protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, + ( + | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest + | undefined + ), + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -413,68 +503,89 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'name': request.name || '', + name: request.name || '', }); this.initialize(); return this.innerApiCalls.annotateAssessment(request, options, callback); } createKey( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest | undefined, + {} | undefined + ] + >; createKey( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; createKey( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest|null|undefined, - {}|null|undefined>): void; -/** - * Creates a new reCAPTCHA Enterprise key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which the key will be created, in the - * format "projects/{project}". - * @param {google.cloud.recaptchaenterprise.v1.Key} request.key - * Required. Information to create a reCAPTCHA Enterprise key. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new reCAPTCHA Enterprise key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the key will be created, in the + * format "projects/{project}". + * @param {google.cloud.recaptchaenterprise.v1.Key} request.key + * Required. Information to create a reCAPTCHA Enterprise key. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ createKey( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, - optionsOrCallback?: gax.CallOptions|Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -483,66 +594,87 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.createKey(request, options, callback); } getKey( - request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest | undefined, + {} | undefined + ] + >; getKey( - request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; getKey( - request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest|null|undefined, - {}|null|undefined>): void; -/** - * Returns the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the requested key, in the format - * "projects/{project}/keys/{key}". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the requested key, in the format + * "projects/{project}/keys/{key}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ getKey( - request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, - optionsOrCallback?: gax.CallOptions|Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -551,68 +683,89 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'name': request.name || '', + name: request.name || '', }); this.initialize(); return this.innerApiCalls.getKey(request, options, callback); } updateKey( - request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest | undefined, + {} | undefined + ] + >; updateKey( - request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; updateKey( - request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest|null|undefined, - {}|null|undefined>): void; -/** - * Updates the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.recaptchaenterprise.v1.Key} request.key - * Required. The key to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The mask to control which field of the key get updated. If the mask is not - * present, all fields will be 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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.recaptchaenterprise.v1.Key} request.key + * Required. The key to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which field of the key get updated. If the mask is not + * present, all fields will be 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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ updateKey( - request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, - optionsOrCallback?: gax.CallOptions|Callback< - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1.IKey, - protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -627,60 +780,81 @@ export class RecaptchaEnterpriseServiceClient { return this.innerApiCalls.updateKey(request, options, callback); } deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest | undefined, + {} | undefined + ] + >; deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest|null|undefined, - {}|null|undefined>): void; -/** - * Deletes the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the key to be deleted, in the format - * "projects/{project}/keys/{key}". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the key to be deleted, in the format + * "projects/{project}/keys/{key}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, - optionsOrCallback?: gax.CallOptions|Callback< + request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.protobuf.IEmpty, - protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -689,87 +863,106 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'name': request.name || '', + name: request.name || '', }); this.initialize(); return this.innerApiCalls.deleteKey(request, options, callback); } listKeys( - request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1.IKey[], - protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest|null, - protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse - ]>; + request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IKey[], + protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, + protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse + ] + >; listKeys( - request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - options: gax.CallOptions, - callback: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse|null|undefined, - protos.google.cloud.recaptchaenterprise.v1.IKey>): void; + request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IKey + > + ): void; listKeys( - request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - callback: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse|null|undefined, - protos.google.cloud.recaptchaenterprise.v1.IKey>): void; -/** - * Returns the list of all keys that belong to a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project that contains the keys that will be - * listed, in the format "projects/{project}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * 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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key} 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 [ListKeysRequest]{@link google.cloud.recaptchaenterprise.v1.ListKeysRequest} - * 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 - * [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1.ListKeysResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IKey + > + ): void; + /** + * Returns the list of all keys that belong to a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project that contains the keys that will be + * listed, in the format "projects/{project}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * 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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key} 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 [ListKeysRequest]{@link google.cloud.recaptchaenterprise.v1.ListKeysRequest} + * 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 + * [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1.ListKeysResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ listKeys( - request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - optionsOrCallback?: gax.CallOptions|PaginationCallback< + request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse|null|undefined, - protos.google.cloud.recaptchaenterprise.v1.IKey>, - callback?: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse|null|undefined, - protos.google.cloud.recaptchaenterprise.v1.IKey>): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1.IKey[], - protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest|null, - protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse - ]>|void { + | protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IKey + >, + callback?: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IKey + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IKey[], + protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest | null, + protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -778,45 +971,45 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.listKeys(request, options, callback); } -/** - * Equivalent to {@link listKeys}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listKeys} 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 name of the project that contains the keys that will be - * listed, in the format "projects/{project}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key} on 'data' event. - */ + /** + * Equivalent to {@link listKeys}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listKeys} 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 name of the project that contains the keys that will be + * listed, in the format "projects/{project}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key} on 'data' event. + */ listKeysStream( - request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - options?: gax.CallOptions): - Transform{ + request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + options?: gax.CallOptions + ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -824,7 +1017,7 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); this.initialize(); @@ -835,31 +1028,31 @@ export class RecaptchaEnterpriseServiceClient { ); } -/** - * Equivalent to {@link listKeys}, 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 name of the project that contains the keys that will be - * listed, in the format "projects/{project}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @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. - */ + /** + * Equivalent to {@link listKeys}, 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 name of the project that contains the keys that will be + * listed, in the format "projects/{project}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @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. + */ listKeysAsync( - request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - options?: gax.CallOptions): - AsyncIterable{ + request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + options?: gax.CallOptions + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -867,14 +1060,14 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listKeys.asyncIterate( this.innerApiCalls['listKeys'] as GaxCall, - request as unknown as RequestType, + (request as unknown) as RequestType, callSettings ) as AsyncIterable; } @@ -889,7 +1082,7 @@ export class RecaptchaEnterpriseServiceClient { * @param {string} assessment * @returns {string} Resource name string. */ - assessmentPath(project:string,assessment:string) { + assessmentPath(project: string, assessment: string) { return this.pathTemplates.assessmentPathTemplate.render({ project: project, assessment: assessment, @@ -904,7 +1097,8 @@ export class RecaptchaEnterpriseServiceClient { * @returns {string} A string representing the project. */ matchProjectFromAssessmentName(assessmentName: string) { - return this.pathTemplates.assessmentPathTemplate.match(assessmentName).project; + return this.pathTemplates.assessmentPathTemplate.match(assessmentName) + .project; } /** @@ -915,7 +1109,8 @@ export class RecaptchaEnterpriseServiceClient { * @returns {string} A string representing the assessment. */ matchAssessmentFromAssessmentName(assessmentName: string) { - return this.pathTemplates.assessmentPathTemplate.match(assessmentName).assessment; + return this.pathTemplates.assessmentPathTemplate.match(assessmentName) + .assessment; } /** @@ -925,7 +1120,7 @@ export class RecaptchaEnterpriseServiceClient { * @param {string} key * @returns {string} Resource name string. */ - keyPath(project:string,key:string) { + keyPath(project: string, key: string) { return this.pathTemplates.keyPathTemplate.render({ project: project, key: key, @@ -960,7 +1155,7 @@ export class RecaptchaEnterpriseServiceClient { * @param {string} project * @returns {string} Resource name string. */ - projectPath(project:string) { + projectPath(project: string) { return this.pathTemplates.projectPathTemplate.render({ project: project, }); diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 97f274233d3..fbbfc223310 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -17,11 +17,18 @@ // ** All changes to this file may be overwritten. ** import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; import * as path from 'path'; -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './recaptcha_enterprise_service_v1_beta1_client_config.json'; @@ -40,7 +47,12 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; - descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}, batching: {}}; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; recaptchaEnterpriseServiceV1Beta1Stub?: Promise<{[name: string]: Function}>; @@ -73,11 +85,14 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { constructor(opts?: ClientOptions) { // Ensure that options include the service address and port. - const staticMembers = this.constructor as typeof RecaptchaEnterpriseServiceV1Beta1Client; - const servicePath = opts && opts.servicePath ? - opts.servicePath : - ((opts && opts.apiEndpoint) ? opts.apiEndpoint : - staticMembers.servicePath); + const staticMembers = this + .constructor as typeof RecaptchaEnterpriseServiceV1Beta1Client; + 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) { @@ -87,8 +102,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { opts.port = opts.port || port; opts.clientConfig = opts.clientConfig || {}; - const isBrowser = (typeof window !== 'undefined'); - if (isBrowser){ + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { opts.fallback = true; } // If we are in browser, we are already using fallback because of the @@ -98,20 +113,18 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. - opts.scopes = (this.constructor as typeof RecaptchaEnterpriseServiceV1Beta1Client).scopes; + opts.scopes = (this + .constructor as typeof RecaptchaEnterpriseServiceV1Beta1Client).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); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -127,12 +140,18 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // For Node.js, pass the path to JSON proto file. // For browsers, pass the JSON content. - const nodejsProtoPath = path.join(__dirname, '..', '..', 'protos', 'protos.json'); + 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 + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated @@ -154,14 +173,20 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { - listKeys: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'keys') + listKeys: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'keys' + ), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1', + 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 @@ -189,16 +214,27 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // Put together the "service stub" for // google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1. this.recaptchaEnterpriseServiceV1Beta1Stub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1, - this._opts) as Promise<{[method: string]: Function}>; + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.recaptchaenterprise.v1beta1 + .RecaptchaEnterpriseServiceV1Beta1, + 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 recaptchaEnterpriseServiceV1Beta1StubMethods = - ['createAssessment', 'annotateAssessment', 'createKey', 'listKeys', 'getKey', 'updateKey', 'deleteKey']; + const recaptchaEnterpriseServiceV1Beta1StubMethods = [ + 'createAssessment', + 'annotateAssessment', + 'createKey', + 'listKeys', + 'getKey', + 'updateKey', + 'deleteKey', + ]; for (const methodName of recaptchaEnterpriseServiceV1Beta1StubMethods) { const callPromise = this.recaptchaEnterpriseServiceV1Beta1Stub.then( stub => (...args: Array<{}>) => { @@ -208,16 +244,17 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { const func = stub[methodName]; return func.apply(stub, args); }, - (err: Error|null|undefined) => () => { + (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.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); this.innerApiCalls[methodName] = apiCall; @@ -253,9 +290,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * in this service. */ static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; + return ['https://www.googleapis.com/auth/cloud-platform']; } getProjectId(): Promise; @@ -265,8 +300,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @param {function(Error, string)} callback - the callback to * be called with the current project Id. */ - getProjectId(callback?: Callback): - Promise|void { + getProjectId( + callback?: Callback + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -278,62 +314,89 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // -- Service calls -- // ------------------- createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, - protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + ( + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | undefined + ), + {} | undefined + ] + >; createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, - protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, - protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest|null|undefined, - {}|null|undefined>): void; -/** - * Creates an Assessment of the likelihood an event is legitimate. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which the assessment will be created, - * in the format "projects/{project_number}". - * @param {google.cloud.recaptchaenterprise.v1beta1.Assessment} request.assessment - * Required. The assessment details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates an Assessment of the likelihood an event is legitimate. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the assessment will be created, + * in the format "projects/{project_number}". + * @param {google.cloud.recaptchaenterprise.v1beta1.Assessment} request.assessment + * Required. The assessment details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, - optionsOrCallback?: gax.CallOptions|Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, - protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, - protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, - protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, + ( + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest + | undefined + ), + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -342,69 +405,96 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.createAssessment(request, options, callback); } annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, - protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + ( + | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | undefined + ), + {} | undefined + ] + >; annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, - protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, - protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest|null|undefined, - {}|null|undefined>): void; -/** - * Annotates a previously created Assessment to provide additional information - * on whether the event turned out to be authentic or fradulent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Assessment, in the format - * "projects/{project_number}/assessments/{assessment_id}". - * @param {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation} request.annotation - * Required. The annotation that will be assigned to the Event. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Annotates a previously created Assessment to provide additional information + * on whether the event turned out to be authentic or fradulent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Assessment, in the format + * "projects/{project_number}/assessments/{assessment_id}". + * @param {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation} request.annotation + * Required. The annotation that will be assigned to the Event. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, - optionsOrCallback?: gax.CallOptions|Callback< + request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, - protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, - protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, - protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, + ( + | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest + | undefined + ), + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -413,68 +503,95 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'name': request.name || '', + name: request.name || '', }); this.initialize(); return this.innerApiCalls.annotateAssessment(request, options, callback); } createKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + ( + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | undefined + ), + {} | undefined + ] + >; createKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; createKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest|null|undefined, - {}|null|undefined>): void; -/** - * Creates a new reCAPTCHA Enterprise key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which the key will be created, in the - * format "projects/{project_number}". - * @param {google.cloud.recaptchaenterprise.v1beta1.Key} request.key - * Required. Information to create a reCAPTCHA Enterprise key. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new reCAPTCHA Enterprise key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the key will be created, in the + * format "projects/{project_number}". + * @param {google.cloud.recaptchaenterprise.v1beta1.Key} request.key + * Required. Information to create a reCAPTCHA Enterprise key. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ createKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, - optionsOrCallback?: gax.CallOptions|Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + ( + | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest + | undefined + ), + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -483,66 +600,93 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.createKey(request, options, callback); } getKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + ( + | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | undefined + ), + {} | undefined + ] + >; getKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; getKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest|null|undefined, - {}|null|undefined>): void; -/** - * Returns the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the requested key, in the format - * "projects/{project_number}/keys/{key_id}". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the requested key, in the format + * "projects/{project_number}/keys/{key_id}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ getKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, - optionsOrCallback?: gax.CallOptions|Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + ( + | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest + | undefined + ), + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -551,68 +695,95 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'name': request.name || '', + name: request.name || '', }); this.initialize(); return this.innerApiCalls.getKey(request, options, callback); } updateKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + ( + | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | undefined + ), + {} | undefined + ] + >; updateKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; updateKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest|null|undefined, - {}|null|undefined>): void; -/** - * Updates the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.recaptchaenterprise.v1beta1.Key} request.key - * Required. The key to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The mask to control which field of the key get updated. If the mask is not - * present, all fields will be 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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.recaptchaenterprise.v1beta1.Key} request.key + * Required. The key to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which field of the key get updated. If the mask is not + * present, all fields will be 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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ updateKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, - optionsOrCallback?: gax.CallOptions|Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1beta1.IKey, + ( + | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest + | undefined + ), + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -627,60 +798,87 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { return this.innerApiCalls.updateKey(request, options, callback); } deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest|undefined, {}|undefined - ]>; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | undefined + ), + {} | undefined + ] + >; deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest|null|undefined, - {}|null|undefined>): void; -/** - * Deletes the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the key to be deleted, in the format - * "projects/{project_number}/keys/{key_id}". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the key to be deleted, in the format + * "projects/{project_number}/keys/{key_id}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, - optionsOrCallback?: gax.CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< protos.google.protobuf.IEmpty, - protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest + | undefined + ), + {} | undefined + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -689,87 +887,106 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'name': request.name || '', + name: request.name || '', }); this.initialize(); return this.innerApiCalls.deleteKey(request, options, callback); } listKeys( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - options?: gax.CallOptions): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey[], - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest|null, - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse - ]>; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1beta1.IKey[], + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + ] + >; listKeys( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - options: gax.CallOptions, - callback: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse|null|undefined, - protos.google.cloud.recaptchaenterprise.v1beta1.IKey>): void; + request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey + > + ): void; listKeys( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - callback: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse|null|undefined, - protos.google.cloud.recaptchaenterprise.v1beta1.IKey>): void; -/** - * Returns the list of all keys that belong to a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project that contains the keys that will be - * listed, in the format "projects/{project_number}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * 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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} 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 [ListKeysRequest]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} - * 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 - * [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - */ + request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey + > + ): void; + /** + * Returns the list of all keys that belong to a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project that contains the keys that will be + * listed, in the format "projects/{project_number}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * 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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} 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 [ListKeysRequest]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} + * 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 + * [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ listKeys( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - optionsOrCallback?: gax.CallOptions|PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse|null|undefined, - protos.google.cloud.recaptchaenterprise.v1beta1.IKey>, - callback?: PaginationCallback< + request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse|null|undefined, - protos.google.cloud.recaptchaenterprise.v1beta1.IKey>): - Promise<[ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey[], - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest|null, - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse - ]>|void { + | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey + >, + callback?: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1beta1.IKey + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1beta1.IKey[], + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, + protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse + ] + > | void { request = request || {}; let options: gax.CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as gax.CallOptions; } options = options || {}; @@ -778,45 +995,45 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.listKeys(request, options, callback); } -/** - * Equivalent to {@link listKeys}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listKeys} 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 name of the project that contains the keys that will be - * listed, in the format "projects/{project_number}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} on 'data' event. - */ + /** + * Equivalent to {@link listKeys}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listKeys} 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 name of the project that contains the keys that will be + * listed, in the format "projects/{project_number}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} on 'data' event. + */ listKeysStream( - request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - options?: gax.CallOptions): - Transform{ + request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + options?: gax.CallOptions + ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -824,7 +1041,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); const callSettings = new gax.CallSettings(options); this.initialize(); @@ -835,31 +1052,31 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ); } -/** - * Equivalent to {@link listKeys}, 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 name of the project that contains the keys that will be - * listed, in the format "projects/{project_number}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @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. - */ + /** + * Equivalent to {@link listKeys}, 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 name of the project that contains the keys that will be + * listed, in the format "projects/{project_number}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @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. + */ listKeysAsync( - request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - options?: gax.CallOptions): - AsyncIterable{ + request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + options?: gax.CallOptions + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -867,14 +1084,14 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', + parent: request.parent || '', }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listKeys.asyncIterate( this.innerApiCalls['listKeys'] as GaxCall, - request as unknown as RequestType, + (request as unknown) as RequestType, callSettings ) as AsyncIterable; } @@ -889,7 +1106,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @param {string} assessment * @returns {string} Resource name string. */ - assessmentPath(project:string,assessment:string) { + assessmentPath(project: string, assessment: string) { return this.pathTemplates.assessmentPathTemplate.render({ project: project, assessment: assessment, @@ -904,7 +1121,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @returns {string} A string representing the project. */ matchProjectFromAssessmentName(assessmentName: string) { - return this.pathTemplates.assessmentPathTemplate.match(assessmentName).project; + return this.pathTemplates.assessmentPathTemplate.match(assessmentName) + .project; } /** @@ -915,7 +1133,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @returns {string} A string representing the assessment. */ matchAssessmentFromAssessmentName(assessmentName: string) { - return this.pathTemplates.assessmentPathTemplate.match(assessmentName).assessment; + return this.pathTemplates.assessmentPathTemplate.match(assessmentName) + .assessment; } /** @@ -925,7 +1144,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @param {string} key * @returns {string} Resource name string. */ - keyPath(project:string,key:string) { + keyPath(project: string, key: string) { return this.pathTemplates.keyPathTemplate.render({ project: project, key: key, @@ -960,7 +1179,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @param {string} project * @returns {string} Resource name string. */ - projectPath(project:string) { + projectPath(project: string) { return this.pathTemplates.projectPathTemplate.render({ project: project, }); diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index ed8e6e86ccf..584e9cdb322 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "fa5b1c493666627a49ac1793fb830f0b9e6bdbf1" + "sha": "e05cfb84b4f46841a19b2b6dfb81ef3ac9668451" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3028060618e8024af9a32b3ab3456c160091ecb7", - "internalRef": "306450502" + "sha": "42ee97c1b93a0e3759bbba3013da309f670a90ab", + "internalRef": "307114445" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "52638600f387deb98efb5f9c85fec39e82aa9052" + "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" } } ], diff --git a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js index d0565cdf3b3..cb2d9ca7462 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js @@ -16,7 +16,6 @@ // ** 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 recaptchaenterprise = require('@google-cloud/recaptcha-enterprise'); diff --git a/packages/google-cloud-recaptchaenterprise/system-test/install.ts b/packages/google-cloud-recaptchaenterprise/system-test/install.ts index 5e4ed636481..4c1ba3eb79a 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/install.ts +++ b/packages/google-cloud-recaptchaenterprise/system-test/install.ts @@ -16,34 +16,36 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import { packNTest } from 'pack-n-play'; -import { readFileSync } from 'fs'; -import { describe, it } from 'mocha'; +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; describe('typescript consumer tests', () => { - - it('should have correct type signature for typescript users', async function() { + it('should have correct type signature for typescript users', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + 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() - } + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); // will throw upon error. }); - it('should have correct type signature for javascript users', async function() { + it('should have correct type signature for javascript users', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + 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() - } + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); // will throw upon error. }); - }); diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index ba427e14fe0..6a28b288ab3 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -20,7 +20,7 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; +import {describe, it} from 'mocha'; import * as recaptchaenterpriseserviceModule from '../src'; import {PassThrough} from 'stream'; @@ -28,978 +28,1362 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; } function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); } -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); } -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); } - return sinon.stub().returns(mockStream); + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); } -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); } describe('v1.RecaptchaEnterpriseServiceClient', () => { - it('has servicePath', () => { - const servicePath = recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient.servicePath; - assert(servicePath); + it('has servicePath', () => { + const servicePath = + recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.recaptchaEnterpriseServiceStub, undefined); + await client.initialize(); + assert(client.recaptchaEnterpriseServiceStub); + }); + + it('has close method', () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + 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 recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); - it('has apiEndpoint', () => { - const apiEndpoint = recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient.apiEndpoint; - assert(apiEndpoint); + describe('createAssessment', () => { + it('invokes createAssessment without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Assessment() + ); + client.innerApiCalls.createAssessment = stubSimpleCall(expectedResponse); + const [response] = await client.createAssessment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - it('has port', () => { - const port = recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient.port; - assert(port); - assert(typeof port === 'number'); + it('invokes createAssessment without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Assessment() + ); + client.innerApiCalls.createAssessment = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createAssessment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1.IAssessment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - it('should create a client with no option', () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(); - assert(client); + it('invokes createAssessment with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createAssessment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.createAssessment(request); + }, expectedError); + assert( + (client.innerApiCalls.createAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); + }); - it('should create a client with gRPC fallback', () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - fallback: true, - }); - assert(client); + describe('annotateAssessment', () => { + it('invokes annotateAssessment without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse() + ); + client.innerApiCalls.annotateAssessment = stubSimpleCall( + expectedResponse + ); + const [response] = await client.annotateAssessment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - it('has initialize method and supports deferred initialization', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - assert.strictEqual(client.recaptchaEnterpriseServiceStub, undefined); - await client.initialize(); - assert(client.recaptchaEnterpriseServiceStub); + it('invokes annotateAssessment without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse() + ); + client.innerApiCalls.annotateAssessment = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.annotateAssessment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - it('has close method', () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - client.close(); + it('invokes annotateAssessment with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.annotateAssessment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.annotateAssessment(request); + }, expectedError); + assert( + (client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); + }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - 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()); + describe('createKey', () => { + it('invokes createKey without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ); + client.innerApiCalls.createKey = stubSimpleCall(expectedResponse); + const [response] = await client.createKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - 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('createAssessment', () => { - it('invokes createAssessment without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Assessment()); - client.innerApiCalls.createAssessment = stubSimpleCall(expectedResponse); - const [response] = await client.createAssessment(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createAssessment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes createKey without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ); + client.innerApiCalls.createKey = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1.IKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes createAssessment without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Assessment()); - client.innerApiCalls.createAssessment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createAssessment( - request, - (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1.IAssessment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createAssessment as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes createKey with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { + await client.createKey(request); + }, expectedError); + assert( + (client.innerApiCalls.createKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes createAssessment with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createAssessment = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.createAssessment(request); }, expectedError); - assert((client.innerApiCalls.createAssessment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('getKey', () => { + it('invokes getKey without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ); + client.innerApiCalls.getKey = stubSimpleCall(expectedResponse); + const [response] = await client.getKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('annotateAssessment', () => { - it('invokes annotateAssessment without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse()); - client.innerApiCalls.annotateAssessment = stubSimpleCall(expectedResponse); - const [response] = await client.annotateAssessment(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes getKey without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ); + client.innerApiCalls.getKey = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1.IKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes annotateAssessment without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse()); - client.innerApiCalls.annotateAssessment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.annotateAssessment( - request, - (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes getKey with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { + await client.getKey(request); + }, expectedError); + assert( + (client.innerApiCalls.getKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes annotateAssessment with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.annotateAssessment = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.annotateAssessment(request); }, expectedError); - assert((client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('updateKey', () => { + it('invokes updateKey without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() + ); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = 'key.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ); + client.innerApiCalls.updateKey = stubSimpleCall(expectedResponse); + const [response] = await client.updateKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('createKey', () => { - it('invokes createKey without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()); - client.innerApiCalls.createKey = stubSimpleCall(expectedResponse); - const [response] = await client.createKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes updateKey without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() + ); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = 'key.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ); + client.innerApiCalls.updateKey = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1.IKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes createKey without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()); - client.innerApiCalls.createKey = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createKey( - request, - (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1.IKey|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes updateKey with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() + ); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = 'key.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { + await client.updateKey(request); + }, expectedError); + assert( + (client.innerApiCalls.updateKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes createKey with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.createKey(request); }, expectedError); - assert((client.innerApiCalls.createKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('deleteKey', () => { + it('invokes deleteKey without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteKey = stubSimpleCall(expectedResponse); + const [response] = await client.deleteKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('getKey', () => { - it('invokes getKey without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()); - client.innerApiCalls.getKey = stubSimpleCall(expectedResponse); - const [response] = await client.getKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes deleteKey without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteKey = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteKey( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes getKey without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()); - client.innerApiCalls.getKey = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getKey( - request, - (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1.IKey|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes deleteKey with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { + await client.deleteKey(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes getKey with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.getKey(request); }, expectedError); - assert((client.innerApiCalls.getKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('listKeys', () => { + it('invokes listKeys without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + ]; + client.innerApiCalls.listKeys = stubSimpleCall(expectedResponse); + const [response] = await client.listKeys(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listKeys as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('updateKey', () => { - it('invokes updateKey without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest()); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = "key.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()); - client.innerApiCalls.updateKey = stubSimpleCall(expectedResponse); - const [response] = await client.updateKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes listKeys without error using callback', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + ]; + client.innerApiCalls.listKeys = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listKeys( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1.IKey[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listKeys as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes updateKey without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest()); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = "key.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()); - client.innerApiCalls.updateKey = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateKey( - request, - (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1.IKey|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes listKeys with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { + await client.listKeys(request); + }, expectedError); + assert( + (client.innerApiCalls.listKeys as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes updateKey with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest()); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = "key.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.updateKey(request); }, expectedError); - assert((client.innerApiCalls.updateKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); + it('invokes listKeysStream without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + ]; + client.descriptors.page.listKeys.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1.Key[] = []; + stream.on( + 'data', + (response: protos.google.cloud.recaptchaenterprise.v1.Key) => { + 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.listKeys.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listKeys, request) + ); + assert.strictEqual( + (client.descriptors.page.listKeys.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); }); - describe('deleteKey', () => { - it('invokes deleteKey without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteKey = stubSimpleCall(expectedResponse); - const [response] = await client.deleteKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); + it('invokes listKeysStream with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listKeys.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1.Key[] = []; + stream.on( + 'data', + (response: protos.google.cloud.recaptchaenterprise.v1.Key) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); }); - - it('invokes deleteKey without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteKey = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteKey( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + stream.on('error', (err: Error) => { + reject(err); }); + }); + await assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listKeys.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listKeys, request) + ); + assert.strictEqual( + (client.descriptors.page.listKeys.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('invokes deleteKey with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.deleteKey(request); }, expectedError); - assert((client.innerApiCalls.deleteKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('uses async iteration with listKeys without error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ), + ]; + client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.recaptchaenterprise.v1.IKey[] = []; + const iterable = client.listKeysAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); }); - describe('listKeys', () => { - it('invokes listKeys without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), - ]; - client.innerApiCalls.listKeys = stubSimpleCall(expectedResponse); - const [response] = await client.listKeys(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listKeys as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('uses async iteration with listKeys with error', async () => { + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listKeysAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.recaptchaenterprise.v1.IKey[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); - it('invokes listKeys without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), - ]; - client.innerApiCalls.listKeys = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listKeys( - request, - (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1.IKey[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listKeys as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + describe('Path templates', () => { + describe('assessment', () => { + const fakePath = '/rendered/path/assessment'; + const expectedParameters = { + project: 'projectValue', + assessment: 'assessmentValue', + }; + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.assessmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assessmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); - it('invokes listKeys with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.listKeys(request); }, expectedError); - assert((client.innerApiCalls.listKeys as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('assessmentPath', () => { + const result = client.assessmentPath('projectValue', 'assessmentValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assessmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); - it('invokes listKeysStream without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), - ]; - client.descriptors.page.listKeys.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listKeysStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.recaptchaenterprise.v1.Key[] = []; - stream.on('data', (response: protos.google.cloud.recaptchaenterprise.v1.Key) => { - 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.listKeys.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listKeys, request)); - assert.strictEqual( - (client.descriptors.page.listKeys.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('matchProjectFromAssessmentName', () => { + const result = client.matchProjectFromAssessmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.assessmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); - it('invokes listKeysStream with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listKeys.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listKeysStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.recaptchaenterprise.v1.Key[] = []; - stream.on('data', (response: protos.google.cloud.recaptchaenterprise.v1.Key) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(async () => { await promise; }, expectedError); - assert((client.descriptors.page.listKeys.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listKeys, request)); - assert.strictEqual( - (client.descriptors.page.listKeys.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('matchAssessmentFromAssessmentName', () => { + const result = client.matchAssessmentFromAssessmentName(fakePath); + assert.strictEqual(result, 'assessmentValue'); + assert( + (client.pathTemplates.assessmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); - it('uses async iteration with listKeys without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.Key()), - ]; - client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.recaptchaenterprise.v1.IKey[] = []; - const iterable = client.listKeysAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + describe('key', () => { + const fakePath = '/rendered/path/key'; + const expectedParameters = { + project: 'projectValue', + key: 'keyValue', + }; + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.keyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.keyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); - it('uses async iteration with listKeys with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listKeysAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.recaptchaenterprise.v1.IKey[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('keyPath', () => { + const result = client.keyPath('projectValue', 'keyValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.keyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromKeyName', () => { + const result = client.matchProjectFromKeyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.keyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKeyFromKeyName', () => { + const result = client.matchKeyFromKeyName(fakePath); + assert.strictEqual(result, 'keyValue'); + assert( + (client.pathTemplates.keyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); }); - describe('Path templates', () => { - - describe('assessment', () => { - const fakePath = "/rendered/path/assessment"; - const expectedParameters = { - project: "projectValue", - assessment: "assessmentValue", - }; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.assessmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.assessmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('assessmentPath', () => { - const result = client.assessmentPath("projectValue", "assessmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.assessmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAssessmentName', () => { - const result = client.matchProjectFromAssessmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.assessmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAssessmentFromAssessmentName', () => { - const result = client.matchAssessmentFromAssessmentName(fakePath); - assert.strictEqual(result, "assessmentValue"); - assert((client.pathTemplates.assessmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); - describe('key', () => { - const fakePath = "/rendered/path/key"; - const expectedParameters = { - project: "projectValue", - key: "keyValue", - }; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.keyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.keyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('keyPath', () => { - const result = client.keyPath("projectValue", "keyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.keyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromKeyName', () => { - const result = client.matchProjectFromKeyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.keyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchKeyFromKeyName', () => { - const result = client.matchKeyFromKeyName(fakePath); - assert.strictEqual(result, "keyValue"); - assert((client.pathTemplates.keyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); }); + }); }); diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts index a90909e64af..da6ed0287f8 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts @@ -20,7 +20,7 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; +import {describe, it} from 'mocha'; import * as recaptchaenterpriseservicev1beta1Module from '../src'; import {PassThrough} from 'stream'; @@ -28,978 +28,1365 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; } function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); } -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); } -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); } - return sinon.stub().returns(mockStream); + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); } -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); } describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { - it('has servicePath', () => { - const servicePath = recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client.servicePath; - assert(servicePath); + it('has servicePath', () => { + const servicePath = + recaptchaenterpriseservicev1beta1Module.v1beta1 + .RecaptchaEnterpriseServiceV1Beta1Client.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + recaptchaenterpriseservicev1beta1Module.v1beta1 + .RecaptchaEnterpriseServiceV1Beta1Client.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + recaptchaenterpriseservicev1beta1Module.v1beta1 + .RecaptchaEnterpriseServiceV1Beta1Client.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.recaptchaEnterpriseServiceV1Beta1Stub, undefined); + await client.initialize(); + assert(client.recaptchaEnterpriseServiceV1Beta1Stub); + }); + + it('has close method', () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + 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 recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); - it('has apiEndpoint', () => { - const apiEndpoint = recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client.apiEndpoint; - assert(apiEndpoint); + describe('createAssessment', () => { + it('invokes createAssessment without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Assessment() + ); + client.innerApiCalls.createAssessment = stubSimpleCall(expectedResponse); + const [response] = await client.createAssessment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - it('has port', () => { - const port = recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client.port; - assert(port); - assert(typeof port === 'number'); + it('invokes createAssessment without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Assessment() + ); + client.innerApiCalls.createAssessment = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createAssessment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - it('should create a client with no option', () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); - assert(client); + it('invokes createAssessment with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createAssessment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.createAssessment(request); + }, expectedError); + assert( + (client.innerApiCalls.createAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); + }); - it('should create a client with gRPC fallback', () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - fallback: true, - }); - assert(client); + describe('annotateAssessment', () => { + it('invokes annotateAssessment without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse() + ); + client.innerApiCalls.annotateAssessment = stubSimpleCall( + expectedResponse + ); + const [response] = await client.annotateAssessment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - it('has initialize method and supports deferred initialization', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - assert.strictEqual(client.recaptchaEnterpriseServiceV1Beta1Stub, undefined); - await client.initialize(); - assert(client.recaptchaEnterpriseServiceV1Beta1Stub); + it('invokes annotateAssessment without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse() + ); + client.innerApiCalls.annotateAssessment = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.annotateAssessment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - it('has close method', () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - client.close(); + it('invokes annotateAssessment with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.annotateAssessment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.annotateAssessment(request); + }, expectedError); + assert( + (client.innerApiCalls.annotateAssessment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); + }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - 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()); + describe('createKey', () => { + it('invokes createKey without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ); + client.innerApiCalls.createKey = stubSimpleCall(expectedResponse); + const [response] = await client.createKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - 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('createAssessment', () => { - it('invokes createAssessment without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Assessment()); - client.innerApiCalls.createAssessment = stubSimpleCall(expectedResponse); - const [response] = await client.createAssessment(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createAssessment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes createKey without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ); + client.innerApiCalls.createKey = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes createAssessment without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Assessment()); - client.innerApiCalls.createAssessment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createAssessment( - request, - (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createAssessment as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes createKey with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { + await client.createKey(request); + }, expectedError); + assert( + (client.innerApiCalls.createKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes createAssessment with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createAssessment = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.createAssessment(request); }, expectedError); - assert((client.innerApiCalls.createAssessment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('getKey', () => { + it('invokes getKey without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ); + client.innerApiCalls.getKey = stubSimpleCall(expectedResponse); + const [response] = await client.getKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('annotateAssessment', () => { - it('invokes annotateAssessment without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse()); - client.innerApiCalls.annotateAssessment = stubSimpleCall(expectedResponse); - const [response] = await client.annotateAssessment(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes getKey without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ); + client.innerApiCalls.getKey = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes annotateAssessment without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse()); - client.innerApiCalls.annotateAssessment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.annotateAssessment( - request, - (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes getKey with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { + await client.getKey(request); + }, expectedError); + assert( + (client.innerApiCalls.getKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes annotateAssessment with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.annotateAssessment = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.annotateAssessment(request); }, expectedError); - assert((client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('updateKey', () => { + it('invokes updateKey without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() + ); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = 'key.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ); + client.innerApiCalls.updateKey = stubSimpleCall(expectedResponse); + const [response] = await client.updateKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('createKey', () => { - it('invokes createKey without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()); - client.innerApiCalls.createKey = stubSimpleCall(expectedResponse); - const [response] = await client.createKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes updateKey without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() + ); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = 'key.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ); + client.innerApiCalls.updateKey = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes createKey without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()); - client.innerApiCalls.createKey = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createKey( - request, - (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes updateKey with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() + ); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = 'key.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { + await client.updateKey(request); + }, expectedError); + assert( + (client.innerApiCalls.updateKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes createKey with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.createKey(request); }, expectedError); - assert((client.innerApiCalls.createKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('deleteKey', () => { + it('invokes deleteKey without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteKey = stubSimpleCall(expectedResponse); + const [response] = await client.deleteKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('getKey', () => { - it('invokes getKey without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()); - client.innerApiCalls.getKey = stubSimpleCall(expectedResponse); - const [response] = await client.getKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes deleteKey without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteKey = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteKey( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes getKey without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()); - client.innerApiCalls.getKey = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getKey( - request, - (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes deleteKey with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { + await client.deleteKey(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); - it('invokes getKey with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.getKey(request); }, expectedError); - assert((client.innerApiCalls.getKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + describe('listKeys', () => { + it('invokes listKeys without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + ]; + client.innerApiCalls.listKeys = stubSimpleCall(expectedResponse); + const [response] = await client.listKeys(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listKeys as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('updateKey', () => { - it('invokes updateKey without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest()); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = "key.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()); - client.innerApiCalls.updateKey = stubSimpleCall(expectedResponse); - const [response] = await client.updateKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes listKeys without error using callback', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + ]; + client.innerApiCalls.listKeys = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listKeys( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listKeys as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes updateKey without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest()); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = "key.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()); - client.innerApiCalls.updateKey = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateKey( - request, - (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes listKeys with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { + await client.listKeys(request); + }, expectedError); + assert( + (client.innerApiCalls.listKeys as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes updateKey with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest()); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = "key.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.updateKey(request); }, expectedError); - assert((client.innerApiCalls.updateKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); + it('invokes listKeysStream without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + ]; + client.descriptors.page.listKeys.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = []; + stream.on( + 'data', + (response: protos.google.cloud.recaptchaenterprise.v1beta1.Key) => { + 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.listKeys.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listKeys, request) + ); + assert.strictEqual( + (client.descriptors.page.listKeys.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); }); - describe('deleteKey', () => { - it('invokes deleteKey without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteKey = stubSimpleCall(expectedResponse); - const [response] = await client.deleteKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); + it('invokes listKeysStream with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listKeys.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = []; + stream.on( + 'data', + (response: protos.google.cloud.recaptchaenterprise.v1beta1.Key) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); }); - - it('invokes deleteKey without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteKey = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteKey( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + stream.on('error', (err: Error) => { + reject(err); }); + }); + await assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listKeys.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listKeys, request) + ); + assert.strictEqual( + (client.descriptors.page.listKeys.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('invokes deleteKey with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.deleteKey(request); }, expectedError); - assert((client.innerApiCalls.deleteKey as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('uses async iteration with listKeys without error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.Key() + ), + ]; + client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = []; + const iterable = client.listKeysAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); }); - describe('listKeys', () => { - it('invokes listKeys without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), - ]; - client.innerApiCalls.listKeys = stubSimpleCall(expectedResponse); - const [response] = await client.listKeys(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listKeys as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('uses async iteration with listKeys with error', async () => { + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listKeysAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); - it('invokes listKeys without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), - ]; - client.innerApiCalls.listKeys = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listKeys( - request, - (err?: Error|null, result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listKeys as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + describe('Path templates', () => { + describe('assessment', () => { + const fakePath = '/rendered/path/assessment'; + const expectedParameters = { + project: 'projectValue', + assessment: 'assessmentValue', + }; + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.assessmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assessmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); - it('invokes listKeys with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { await client.listKeys(request); }, expectedError); - assert((client.innerApiCalls.listKeys as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('assessmentPath', () => { + const result = client.assessmentPath('projectValue', 'assessmentValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assessmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); - it('invokes listKeysStream without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), - ]; - client.descriptors.page.listKeys.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listKeysStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = []; - stream.on('data', (response: protos.google.cloud.recaptchaenterprise.v1beta1.Key) => { - 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.listKeys.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listKeys, request)); - assert.strictEqual( - (client.descriptors.page.listKeys.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('matchProjectFromAssessmentName', () => { + const result = client.matchProjectFromAssessmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.assessmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); - it('invokes listKeysStream with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listKeys.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listKeysStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = []; - stream.on('data', (response: protos.google.cloud.recaptchaenterprise.v1beta1.Key) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(async () => { await promise; }, expectedError); - assert((client.descriptors.page.listKeys.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listKeys, request)); - assert.strictEqual( - (client.descriptors.page.listKeys.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('matchAssessmentFromAssessmentName', () => { + const result = client.matchAssessmentFromAssessmentName(fakePath); + assert.strictEqual(result, 'assessmentValue'); + assert( + (client.pathTemplates.assessmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); - it('uses async iteration with listKeys without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), - generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.Key()), - ]; - client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = []; - const iterable = client.listKeysAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + describe('key', () => { + const fakePath = '/rendered/path/key'; + const expectedParameters = { + project: 'projectValue', + key: 'keyValue', + }; + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.keyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.keyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); - it('uses async iteration with listKeys with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listKeysAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('keyPath', () => { + const result = client.keyPath('projectValue', 'keyValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.keyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromKeyName', () => { + const result = client.matchProjectFromKeyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.keyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKeyFromKeyName', () => { + const result = client.matchKeyFromKeyName(fakePath); + assert.strictEqual(result, 'keyValue'); + assert( + (client.pathTemplates.keyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); }); - describe('Path templates', () => { - - describe('assessment', () => { - const fakePath = "/rendered/path/assessment"; - const expectedParameters = { - project: "projectValue", - assessment: "assessmentValue", - }; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.assessmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.assessmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('assessmentPath', () => { - const result = client.assessmentPath("projectValue", "assessmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.assessmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAssessmentName', () => { - const result = client.matchProjectFromAssessmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.assessmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAssessmentFromAssessmentName', () => { - const result = client.matchAssessmentFromAssessmentName(fakePath); - assert.strictEqual(result, "assessmentValue"); - assert((client.pathTemplates.assessmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); - describe('key', () => { - const fakePath = "/rendered/path/key"; - const expectedParameters = { - project: "projectValue", - key: "keyValue", - }; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.keyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.keyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('keyPath', () => { - const result = client.keyPath("projectValue", "keyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.keyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromKeyName', () => { - const result = client.matchProjectFromKeyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.keyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchKeyFromKeyName', () => { - const result = client.matchKeyFromKeyName(fakePath); - assert.strictEqual(result, "keyValue"); - assert((client.pathTemplates.keyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); }); + }); }); diff --git a/packages/google-cloud-recaptchaenterprise/webpack.config.js b/packages/google-cloud-recaptchaenterprise/webpack.config.js index 2435e0e2d56..04831b77a4d 100644 --- a/packages/google-cloud-recaptchaenterprise/webpack.config.js +++ b/packages/google-cloud-recaptchaenterprise/webpack.config.js @@ -36,27 +36,27 @@ module.exports = { { test: /\.tsx?$/, use: 'ts-loader', - exclude: /node_modules/ + exclude: /node_modules/, }, { test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]grpc/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]retry-request/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]gtoken/, - use: 'null-loader' + use: 'null-loader', }, ], }, From e0597deb34a702d096386bb019ac55c52a6b5059 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 23 Apr 2020 19:34:44 -0700 Subject: [PATCH 111/253] chore: update npm scripts and synth.py (#167) 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-recaptchaenterprise/package.json | 5 +++-- packages/google-cloud-recaptchaenterprise/synth.py | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index fbf61c6c451..2730400a896 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -47,7 +47,7 @@ "webpack-cli": "^3.3.10" }, "scripts": { - "lint": "gts fix", + "lint": "gts check", "fix": "gts fix", "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", "system-test": "mocha build/system-test", @@ -59,7 +59,8 @@ "compile-protos": "compileProtos src", "predocs-test": "npm run docs", "prepare": "npm run compile", - "prelint": "cd samples; npm link ../; npm install" + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" }, "license": "Apache-2.0", "engines": { diff --git a/packages/google-cloud-recaptchaenterprise/synth.py b/packages/google-cloud-recaptchaenterprise/synth.py index 7e3226740e7..3b87a2b80d6 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.py +++ b/packages/google-cloud-recaptchaenterprise/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) @@ -43,7 +43,4 @@ templates = common_templates.node_library(source_location='build/src') s.copy(templates) -# Node.js specific cleanup -subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'fix']) -subprocess.run(['npx', 'compileProtos', 'src']) +node.postprocess_gapic_library() From 676ade2e047d2d71a8b1382198e8accc41b00c5e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 1 May 2020 06:55:01 +0200 Subject: [PATCH 112/253] chore(deps): update dependency uuid to v8 (#168) 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 | |---|---|---|---| | [uuid](https://togithub.com/uuidjs/uuid) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/uuid/7.0.3/8.0.0) | --- ### Release Notes
uuidjs/uuid ### [`v8.0.0`](https://togithub.com/uuidjs/uuid/blob/master/CHANGELOG.md#​800-httpsgithubcomuuidjsuuidcomparev703v800-2020-04-29) [Compare Source](https://togithub.com/uuidjs/uuid/compare/v7.0.3...v8.0.0) ##### ⚠ BREAKING CHANGES - For native ECMAScript Module (ESM) usage in Node.js only named exports are exposed, there is no more default export. ```diff -import uuid from 'uuid'; -console.log(uuid.v4()); // -> 'cd6c3b08-0adc-4f4b-a6ef-36087a1c9869' +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' ``` - Deep requiring specific algorithms of this library like `require('uuid/v4')`, which has been deprecated in `uuid@7`, is no longer supported. Instead use the named exports that this module exports. For ECMAScript Modules (ESM): ```diff -import uuidv4 from 'uuid/v4'; +import { v4 as uuidv4 } from 'uuid'; uuidv4(); ``` For CommonJS: ```diff -const uuidv4 = require('uuid/v4'); +const { v4: uuidv4 } = require('uuid'); uuidv4(); ``` ##### Features - native Node.js ES Modules (wrapper approach) ([#​423](https://togithub.com/uuidjs/uuid/issues/423)) ([2d9f590](https://togithub.com/uuidjs/uuid/commit/2d9f590ad9701d692625c07ed62f0a0f91227991)), closes [#​245](https://togithub.com/uuidjs/uuid/issues/245) [#​419](https://togithub.com/uuidjs/uuid/issues/419) [#​342](https://togithub.com/uuidjs/uuid/issues/342) - remove deep requires ([#​426](https://togithub.com/uuidjs/uuid/issues/426)) ([daf72b8](https://togithub.com/uuidjs/uuid/commit/daf72b84ceb20272a81bb5fbddb05dd95922cbba)) ##### Bug Fixes - add CommonJS syntax example to README quickstart section ([#​417](https://togithub.com/uuidjs/uuid/issues/417)) ([e0ec840](https://togithub.com/uuidjs/uuid/commit/e0ec8402c7ad44b7ef0453036c612f5db513fda0)) ##### [7.0.3](https://togithub.com/uuidjs/uuid/compare/v7.0.2...v7.0.3) (2020-03-31) ##### Bug Fixes - make deep require deprecation warning work in browsers ([#​409](https://togithub.com/uuidjs/uuid/issues/409)) ([4b71107](https://togithub.com/uuidjs/uuid/commit/4b71107d8c0d2ef56861ede6403fc9dc35a1e6bf)), closes [#​408](https://togithub.com/uuidjs/uuid/issues/408) ##### [7.0.2](https://togithub.com/uuidjs/uuid/compare/v7.0.1...v7.0.2) (2020-03-04) ##### Bug Fixes - make access to msCrypto consistent ([#​393](https://togithub.com/uuidjs/uuid/issues/393)) ([8bf2a20](https://togithub.com/uuidjs/uuid/commit/8bf2a20f3565df743da7215eebdbada9d2df118c)) - simplify link in deprecation warning ([#​391](https://togithub.com/uuidjs/uuid/issues/391)) ([bb2c8e4](https://togithub.com/uuidjs/uuid/commit/bb2c8e4e9f4c5f9c1eaaf3ea59710c633cd90cb7)) - update links to match content in readme ([#​386](https://togithub.com/uuidjs/uuid/issues/386)) ([44f2f86](https://togithub.com/uuidjs/uuid/commit/44f2f86e9d2bbf14ee5f0f00f72a3db1292666d4)) ##### [7.0.1](https://togithub.com/uuidjs/uuid/compare/v7.0.0...v7.0.1) (2020-02-25) ##### Bug Fixes - clean up esm builds for node and browser ([#​383](https://togithub.com/uuidjs/uuid/issues/383)) ([59e6a49](https://togithub.com/uuidjs/uuid/commit/59e6a49e7ce7b3e8fb0f3ee52b9daae72af467dc)) - provide browser versions independent from module system ([#​380](https://togithub.com/uuidjs/uuid/issues/380)) ([4344a22](https://togithub.com/uuidjs/uuid/commit/4344a22e7aed33be8627eeaaf05360f256a21753)), closes [#​378](https://togithub.com/uuidjs/uuid/issues/378)
--- ### 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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 5f04ee99452..c3fa889e714 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -18,6 +18,6 @@ "devDependencies": { "chai": "^4.2.0", "mocha": "^7.0.0", - "uuid": "^7.0.0" + "uuid": "^8.0.0" } } From db58b67c3dc41f5996fb39da618e361423da05e5 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 5 May 2020 19:34:28 -0700 Subject: [PATCH 113/253] fix: regen protos and tests, formatting (#169) --- .../protos/protos.js | 414 +++++++++--------- .../synth.metadata | 14 +- .../gapic_recaptcha_enterprise_service_v1.ts | 32 +- ...cha_enterprise_service_v1_beta1_v1beta1.ts | 32 +- 4 files changed, 226 insertions(+), 266 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 6ab2d1c40c7..95df1028294 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -397,9 +397,9 @@ CreateAssessmentRequest.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.assessment != null && Object.hasOwnProperty.call(message, "assessment")) + if (message.assessment != null && message.hasOwnProperty("assessment")) $root.google.cloud.recaptchaenterprise.v1.Assessment.encode(message.assessment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -612,9 +612,9 @@ AnnotateAssessmentRequest.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.annotation != null && Object.hasOwnProperty.call(message, "annotation")) + if (message.annotation != null && message.hasOwnProperty("annotation")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.annotation); return writer; }; @@ -785,7 +785,7 @@ /** * Annotation enum. * @name google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation - * @enum {number} + * @enum {string} * @property {number} ANNOTATION_UNSPECIFIED=0 ANNOTATION_UNSPECIFIED value * @property {number} LEGITIMATE=1 LEGITIMATE value * @property {number} FRAUDULENT=2 FRAUDULENT value @@ -1048,13 +1048,13 @@ Assessment.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.event != null && Object.hasOwnProperty.call(message, "event")) + if (message.event != null && message.hasOwnProperty("event")) $root.google.cloud.recaptchaenterprise.v1.Event.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.riskAnalysis != null && Object.hasOwnProperty.call(message, "riskAnalysis")) + if (message.riskAnalysis != null && message.hasOwnProperty("riskAnalysis")) $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.encode(message.riskAnalysis, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.tokenProperties != null && Object.hasOwnProperty.call(message, "tokenProperties")) + if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) $root.google.cloud.recaptchaenterprise.v1.TokenProperties.encode(message.tokenProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -1326,15 +1326,15 @@ Event.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.token != null && Object.hasOwnProperty.call(message, "token")) + if (message.token != null && message.hasOwnProperty("token")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); - if (message.siteKey != null && Object.hasOwnProperty.call(message, "siteKey")) + if (message.siteKey != null && message.hasOwnProperty("siteKey")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.siteKey); - if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + if (message.userAgent != null && message.hasOwnProperty("userAgent")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.userAgent); - if (message.userIpAddress != null && Object.hasOwnProperty.call(message, "userIpAddress")) + if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.userIpAddress); - if (message.expectedAction != null && Object.hasOwnProperty.call(message, "expectedAction")) + if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.expectedAction); return writer; }; @@ -1576,7 +1576,7 @@ RiskAnalysis.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) + if (message.score != null && message.hasOwnProperty("score")) writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); if (message.reasons != null && message.reasons.length) { writer.uint32(/* id 2, wireType 2 =*/18).fork(); @@ -1779,7 +1779,7 @@ /** * ClassificationReason enum. * @name google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason - * @enum {number} + * @enum {string} * @property {number} CLASSIFICATION_REASON_UNSPECIFIED=0 CLASSIFICATION_REASON_UNSPECIFIED value * @property {number} AUTOMATION=1 AUTOMATION value * @property {number} UNEXPECTED_ENVIRONMENT=2 UNEXPECTED_ENVIRONMENT value @@ -1893,15 +1893,15 @@ TokenProperties.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.valid != null && Object.hasOwnProperty.call(message, "valid")) + if (message.valid != null && message.hasOwnProperty("valid")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid); - if (message.invalidReason != null && Object.hasOwnProperty.call(message, "invalidReason")) + if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.invalidReason); - 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 3, wireType 2 =*/26).fork()).ldelim(); - if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + if (message.hostname != null && message.hasOwnProperty("hostname")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.hostname); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) + if (message.action != null && message.hasOwnProperty("action")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.action); return writer; }; @@ -2115,7 +2115,7 @@ /** * InvalidReason enum. * @name google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason - * @enum {number} + * @enum {string} * @property {number} INVALID_REASON_UNSPECIFIED=0 INVALID_REASON_UNSPECIFIED value * @property {number} UNKNOWN_INVALID_REASON=1 UNKNOWN_INVALID_REASON value * @property {number} MALFORMED=2 MALFORMED value @@ -2202,9 +2202,9 @@ CreateKeyRequest.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.key != null && Object.hasOwnProperty.call(message, "key")) + if (message.key != null && message.hasOwnProperty("key")) $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -2426,11 +2426,11 @@ ListKeysRequest.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); return writer; }; @@ -2653,7 +2653,7 @@ if (message.keys != null && message.keys.length) for (var i = 0; i < message.keys.length; ++i) $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.keys[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; }; @@ -2871,7 +2871,7 @@ GetKeyRequest.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; }; @@ -3067,9 +3067,9 @@ UpdateKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) + if (message.key != null && message.hasOwnProperty("key")) $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - 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(); return writer; }; @@ -3278,7 +3278,7 @@ DeleteKeyRequest.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; }; @@ -3534,20 +3534,20 @@ Key.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.webSettings != null && Object.hasOwnProperty.call(message, "webSettings")) + if (message.webSettings != null && message.hasOwnProperty("webSettings")) $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.encode(message.webSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.androidSettings != null && Object.hasOwnProperty.call(message, "androidSettings")) + if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.encode(message.androidSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.iosSettings != null && Object.hasOwnProperty.call(message, "iosSettings")) + if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.encode(message.iosSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - 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 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).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 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -3901,13 +3901,13 @@ if (message.allowedDomains != null && message.allowedDomains.length) for (var i = 0; i < message.allowedDomains.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedDomains[i]); - if (message.allowAmpTraffic != null && Object.hasOwnProperty.call(message, "allowAmpTraffic")) + if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAmpTraffic); - if (message.allowAllDomains != null && Object.hasOwnProperty.call(message, "allowAllDomains")) + if (message.allowAllDomains != null && message.hasOwnProperty("allowAllDomains")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowAllDomains); - if (message.integrationType != null && Object.hasOwnProperty.call(message, "integrationType")) + if (message.integrationType != null && message.hasOwnProperty("integrationType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.integrationType); - if (message.challengeSecurityPreference != null && Object.hasOwnProperty.call(message, "challengeSecurityPreference")) + if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.challengeSecurityPreference); return writer; }; @@ -4144,7 +4144,7 @@ /** * IntegrationType enum. * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType - * @enum {number} + * @enum {string} * @property {number} INTEGRATION_TYPE_UNSPECIFIED=0 INTEGRATION_TYPE_UNSPECIFIED value * @property {number} SCORE=1 SCORE value * @property {number} CHECKBOX=2 CHECKBOX value @@ -4162,7 +4162,7 @@ /** * ChallengeSecurityPreference enum. * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference - * @enum {number} + * @enum {string} * @property {number} CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED=0 CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED value * @property {number} USABILITY=1 USABILITY value * @property {number} BALANCE=2 BALANCE value @@ -4929,9 +4929,9 @@ CreateAssessmentRequest.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.assessment != null && Object.hasOwnProperty.call(message, "assessment")) + if (message.assessment != null && message.hasOwnProperty("assessment")) $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.encode(message.assessment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -5144,9 +5144,9 @@ AnnotateAssessmentRequest.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.annotation != null && Object.hasOwnProperty.call(message, "annotation")) + if (message.annotation != null && message.hasOwnProperty("annotation")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.annotation); return writer; }; @@ -5307,7 +5307,7 @@ /** * Annotation enum. * @name google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation - * @enum {number} + * @enum {string} * @property {number} ANNOTATION_UNSPECIFIED=0 ANNOTATION_UNSPECIFIED value * @property {number} LEGITIMATE=1 LEGITIMATE value * @property {number} FRAUDULENT=2 FRAUDULENT value @@ -5576,13 +5576,13 @@ Assessment.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.event != null && Object.hasOwnProperty.call(message, "event")) + if (message.event != null && message.hasOwnProperty("event")) $root.google.cloud.recaptchaenterprise.v1beta1.Event.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) + if (message.score != null && message.hasOwnProperty("score")) writer.uint32(/* id 3, wireType 5 =*/29).float(message.score); - if (message.tokenProperties != null && Object.hasOwnProperty.call(message, "tokenProperties")) + if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.encode(message.tokenProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.reasons != null && message.reasons.length) { writer.uint32(/* id 5, wireType 2 =*/42).fork(); @@ -5829,7 +5829,7 @@ /** * ClassificationReason enum. * @name google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason - * @enum {number} + * @enum {string} * @property {number} CLASSIFICATION_REASON_UNSPECIFIED=0 CLASSIFICATION_REASON_UNSPECIFIED value * @property {number} AUTOMATION=1 AUTOMATION value * @property {number} UNEXPECTED_ENVIRONMENT=2 UNEXPECTED_ENVIRONMENT value @@ -5943,15 +5943,15 @@ Event.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.token != null && Object.hasOwnProperty.call(message, "token")) + if (message.token != null && message.hasOwnProperty("token")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); - if (message.siteKey != null && Object.hasOwnProperty.call(message, "siteKey")) + if (message.siteKey != null && message.hasOwnProperty("siteKey")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.siteKey); - if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + if (message.userAgent != null && message.hasOwnProperty("userAgent")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.userAgent); - if (message.userIpAddress != null && Object.hasOwnProperty.call(message, "userIpAddress")) + if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.userIpAddress); - if (message.expectedAction != null && Object.hasOwnProperty.call(message, "expectedAction")) + if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.expectedAction); return writer; }; @@ -6219,15 +6219,15 @@ TokenProperties.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.valid != null && Object.hasOwnProperty.call(message, "valid")) + if (message.valid != null && message.hasOwnProperty("valid")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid); - if (message.invalidReason != null && Object.hasOwnProperty.call(message, "invalidReason")) + if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.invalidReason); - 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 3, wireType 2 =*/26).fork()).ldelim(); - if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + if (message.hostname != null && message.hasOwnProperty("hostname")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.hostname); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) + if (message.action != null && message.hasOwnProperty("action")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.action); return writer; }; @@ -6446,7 +6446,7 @@ /** * InvalidReason enum. * @name google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason - * @enum {number} + * @enum {string} * @property {number} INVALID_REASON_UNSPECIFIED=0 INVALID_REASON_UNSPECIFIED value * @property {number} UNKNOWN_INVALID_REASON=1 UNKNOWN_INVALID_REASON value * @property {number} MALFORMED=2 MALFORMED value @@ -6535,9 +6535,9 @@ CreateKeyRequest.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.key != null && Object.hasOwnProperty.call(message, "key")) + if (message.key != null && message.hasOwnProperty("key")) $root.google.cloud.recaptchaenterprise.v1beta1.Key.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -6759,11 +6759,11 @@ ListKeysRequest.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); return writer; }; @@ -6986,7 +6986,7 @@ if (message.keys != null && message.keys.length) for (var i = 0; i < message.keys.length; ++i) $root.google.cloud.recaptchaenterprise.v1beta1.Key.encode(message.keys[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; }; @@ -7204,7 +7204,7 @@ GetKeyRequest.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; }; @@ -7400,9 +7400,9 @@ UpdateKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) + if (message.key != null && message.hasOwnProperty("key")) $root.google.cloud.recaptchaenterprise.v1beta1.Key.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - 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(); return writer; }; @@ -7611,7 +7611,7 @@ DeleteKeyRequest.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; }; @@ -7848,15 +7848,15 @@ Key.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.webSettings != null && Object.hasOwnProperty.call(message, "webSettings")) + if (message.webSettings != null && message.hasOwnProperty("webSettings")) $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.encode(message.webSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.androidSettings != null && Object.hasOwnProperty.call(message, "androidSettings")) + if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.encode(message.androidSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.iosSettings != null && Object.hasOwnProperty.call(message, "iosSettings")) + if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.encode(message.iosSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -8163,13 +8163,13 @@ if (message.allowedDomains != null && message.allowedDomains.length) for (var i = 0; i < message.allowedDomains.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedDomains[i]); - if (message.allowAmpTraffic != null && Object.hasOwnProperty.call(message, "allowAmpTraffic")) + if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAmpTraffic); - if (message.enforceAllowedDomains != null && Object.hasOwnProperty.call(message, "enforceAllowedDomains")) + if (message.enforceAllowedDomains != null && message.hasOwnProperty("enforceAllowedDomains")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enforceAllowedDomains); - if (message.integrationType != null && Object.hasOwnProperty.call(message, "integrationType")) + if (message.integrationType != null && message.hasOwnProperty("integrationType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.integrationType); - if (message.challengeSecurityPreference != null && Object.hasOwnProperty.call(message, "challengeSecurityPreference")) + if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.challengeSecurityPreference); return writer; }; @@ -8406,7 +8406,7 @@ /** * IntegrationType enum. * @name google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType - * @enum {number} + * @enum {string} * @property {number} INTEGRATION_TYPE_UNSPECIFIED=0 INTEGRATION_TYPE_UNSPECIFIED value * @property {number} SCORE_ONLY=1 SCORE_ONLY value * @property {number} CHECKBOX_CHALLENGE=2 CHECKBOX_CHALLENGE value @@ -8424,7 +8424,7 @@ /** * ChallengeSecurityPreference enum. * @name google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference - * @enum {number} + * @enum {string} * @property {number} CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED=0 CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED value * @property {number} USABILITY=1 USABILITY value * @property {number} BALANCED=2 BALANCED value @@ -8935,7 +8935,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; }; @@ -9249,26 +9249,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; }; @@ -9625,9 +9625,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; }; @@ -9773,7 +9773,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 @@ -9894,18 +9894,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; }; @@ -10125,7 +10125,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 @@ -10206,9 +10206,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; }; @@ -10733,9 +10733,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) @@ -10752,9 +10752,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) @@ -10762,7 +10762,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; }; @@ -11300,7 +11300,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) @@ -11317,7 +11317,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) @@ -11782,11 +11782,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; }; @@ -12010,9 +12010,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; }; @@ -12503,25 +12503,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; }; @@ -12868,7 +12868,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 @@ -12914,7 +12914,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 @@ -12995,9 +12995,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; }; @@ -13240,12 +13240,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) @@ -13548,9 +13548,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; }; @@ -13770,11 +13770,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; }; @@ -14008,12 +14008,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; }; @@ -14293,17 +14293,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; }; @@ -14742,45 +14742,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) @@ -15207,7 +15207,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 @@ -15325,18 +15325,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; }; @@ -15678,17 +15678,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) @@ -15699,7 +15699,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; }; @@ -16035,7 +16035,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 @@ -16051,7 +16051,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 @@ -16350,9 +16350,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) @@ -16595,7 +16595,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) @@ -16844,14 +16844,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; }; @@ -17130,9 +17130,9 @@ 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) @@ -17140,7 +17140,7 @@ 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; }; @@ -17374,7 +17374,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 @@ -17504,17 +17504,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; }; @@ -18291,9 +18291,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) @@ -18824,11 +18824,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; }; @@ -19444,9 +19444,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; }; diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 584e9cdb322..b757263eefc 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "e05cfb84b4f46841a19b2b6dfb81ef3ac9668451" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "42ee97c1b93a0e3759bbba3013da309f670a90ab", - "internalRef": "307114445" + "remote": "git@github.com:googleapis/nodejs-recaptcha-enterprise.git", + "sha": "e2c52184c758b9c080eb41f0082fbc50de2ff147" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" + "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" } } ], diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index 6a28b288ab3..64ac17a1eed 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -318,9 +318,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createAssessment(request); - }, expectedError); + await assert.rejects(client.createAssessment(request), expectedError); assert( (client.innerApiCalls.createAssessment as SinonStub) .getCall(0) @@ -440,9 +438,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.annotateAssessment(request); - }, expectedError); + await assert.rejects(client.annotateAssessment(request), expectedError); assert( (client.innerApiCalls.annotateAssessment as SinonStub) .getCall(0) @@ -557,9 +553,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.createKey(request); - }, expectedError); + await assert.rejects(client.createKey(request), expectedError); assert( (client.innerApiCalls.createKey as SinonStub) .getCall(0) @@ -674,9 +668,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.getKey(request); - }, expectedError); + await assert.rejects(client.getKey(request), expectedError); assert( (client.innerApiCalls.getKey as SinonStub) .getCall(0) @@ -794,9 +786,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.updateKey(request); - }, expectedError); + await assert.rejects(client.updateKey(request), expectedError); assert( (client.innerApiCalls.updateKey as SinonStub) .getCall(0) @@ -911,9 +901,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.deleteKey(request); - }, expectedError); + await assert.rejects(client.deleteKey(request), expectedError); assert( (client.innerApiCalls.deleteKey as SinonStub) .getCall(0) @@ -1044,9 +1032,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.listKeys(request); - }, expectedError); + await assert.rejects(client.listKeys(request), expectedError); assert( (client.innerApiCalls.listKeys as SinonStub) .getCall(0) @@ -1145,9 +1131,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listKeys.createStream as SinonStub) .getCall(0) diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts index da6ed0287f8..2023e4f8503 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts @@ -319,9 +319,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createAssessment(request); - }, expectedError); + await assert.rejects(client.createAssessment(request), expectedError); assert( (client.innerApiCalls.createAssessment as SinonStub) .getCall(0) @@ -441,9 +439,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.annotateAssessment(request); - }, expectedError); + await assert.rejects(client.annotateAssessment(request), expectedError); assert( (client.innerApiCalls.annotateAssessment as SinonStub) .getCall(0) @@ -558,9 +554,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.createKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.createKey(request); - }, expectedError); + await assert.rejects(client.createKey(request), expectedError); assert( (client.innerApiCalls.createKey as SinonStub) .getCall(0) @@ -675,9 +669,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.getKey(request); - }, expectedError); + await assert.rejects(client.getKey(request), expectedError); assert( (client.innerApiCalls.getKey as SinonStub) .getCall(0) @@ -795,9 +787,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.updateKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.updateKey(request); - }, expectedError); + await assert.rejects(client.updateKey(request), expectedError); assert( (client.innerApiCalls.updateKey as SinonStub) .getCall(0) @@ -912,9 +902,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.deleteKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.deleteKey(request); - }, expectedError); + await assert.rejects(client.deleteKey(request), expectedError); assert( (client.innerApiCalls.deleteKey as SinonStub) .getCall(0) @@ -1047,9 +1035,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.listKeys(request); - }, expectedError); + await assert.rejects(client.listKeys(request), expectedError); assert( (client.innerApiCalls.listKeys as SinonStub) .getCall(0) @@ -1148,9 +1134,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listKeys.createStream as SinonStub) .getCall(0) From 85cb93d0548ac523f72db92bcabf800294c1ed87 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 6 May 2020 19:34:46 -0700 Subject: [PATCH 114/253] chore: linting rules (#170) 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 --- .../protos/protos.js | 414 +++++++++--------- .../synth.metadata | 12 +- 2 files changed, 217 insertions(+), 209 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 95df1028294..6ab2d1c40c7 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -397,9 +397,9 @@ CreateAssessmentRequest.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.assessment != null && message.hasOwnProperty("assessment")) + if (message.assessment != null && Object.hasOwnProperty.call(message, "assessment")) $root.google.cloud.recaptchaenterprise.v1.Assessment.encode(message.assessment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -612,9 +612,9 @@ AnnotateAssessmentRequest.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.annotation != null && message.hasOwnProperty("annotation")) + if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.annotation); return writer; }; @@ -785,7 +785,7 @@ /** * Annotation enum. * @name google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation - * @enum {string} + * @enum {number} * @property {number} ANNOTATION_UNSPECIFIED=0 ANNOTATION_UNSPECIFIED value * @property {number} LEGITIMATE=1 LEGITIMATE value * @property {number} FRAUDULENT=2 FRAUDULENT value @@ -1048,13 +1048,13 @@ Assessment.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.event != null && message.hasOwnProperty("event")) + if (message.event != null && Object.hasOwnProperty.call(message, "event")) $root.google.cloud.recaptchaenterprise.v1.Event.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.riskAnalysis != null && message.hasOwnProperty("riskAnalysis")) + if (message.riskAnalysis != null && Object.hasOwnProperty.call(message, "riskAnalysis")) $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.encode(message.riskAnalysis, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) + if (message.tokenProperties != null && Object.hasOwnProperty.call(message, "tokenProperties")) $root.google.cloud.recaptchaenterprise.v1.TokenProperties.encode(message.tokenProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -1326,15 +1326,15 @@ Event.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.token != null && message.hasOwnProperty("token")) + if (message.token != null && Object.hasOwnProperty.call(message, "token")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); - if (message.siteKey != null && message.hasOwnProperty("siteKey")) + if (message.siteKey != null && Object.hasOwnProperty.call(message, "siteKey")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.siteKey); - if (message.userAgent != null && message.hasOwnProperty("userAgent")) + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.userAgent); - if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) + if (message.userIpAddress != null && Object.hasOwnProperty.call(message, "userIpAddress")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.userIpAddress); - if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) + if (message.expectedAction != null && Object.hasOwnProperty.call(message, "expectedAction")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.expectedAction); return writer; }; @@ -1576,7 +1576,7 @@ RiskAnalysis.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.score != null && message.hasOwnProperty("score")) + if (message.score != null && Object.hasOwnProperty.call(message, "score")) writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); if (message.reasons != null && message.reasons.length) { writer.uint32(/* id 2, wireType 2 =*/18).fork(); @@ -1779,7 +1779,7 @@ /** * ClassificationReason enum. * @name google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason - * @enum {string} + * @enum {number} * @property {number} CLASSIFICATION_REASON_UNSPECIFIED=0 CLASSIFICATION_REASON_UNSPECIFIED value * @property {number} AUTOMATION=1 AUTOMATION value * @property {number} UNEXPECTED_ENVIRONMENT=2 UNEXPECTED_ENVIRONMENT value @@ -1893,15 +1893,15 @@ TokenProperties.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.valid != null && message.hasOwnProperty("valid")) + if (message.valid != null && Object.hasOwnProperty.call(message, "valid")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid); - if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) + if (message.invalidReason != null && Object.hasOwnProperty.call(message, "invalidReason")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.invalidReason); - 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 3, wireType 2 =*/26).fork()).ldelim(); - if (message.hostname != null && message.hasOwnProperty("hostname")) + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.hostname); - if (message.action != null && message.hasOwnProperty("action")) + if (message.action != null && Object.hasOwnProperty.call(message, "action")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.action); return writer; }; @@ -2115,7 +2115,7 @@ /** * InvalidReason enum. * @name google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason - * @enum {string} + * @enum {number} * @property {number} INVALID_REASON_UNSPECIFIED=0 INVALID_REASON_UNSPECIFIED value * @property {number} UNKNOWN_INVALID_REASON=1 UNKNOWN_INVALID_REASON value * @property {number} MALFORMED=2 MALFORMED value @@ -2202,9 +2202,9 @@ CreateKeyRequest.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.key != null && message.hasOwnProperty("key")) + if (message.key != null && Object.hasOwnProperty.call(message, "key")) $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -2426,11 +2426,11 @@ ListKeysRequest.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); return writer; }; @@ -2653,7 +2653,7 @@ if (message.keys != null && message.keys.length) for (var i = 0; i < message.keys.length; ++i) $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.keys[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; }; @@ -2871,7 +2871,7 @@ GetKeyRequest.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; }; @@ -3067,9 +3067,9 @@ UpdateKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && message.hasOwnProperty("key")) + if (message.key != null && Object.hasOwnProperty.call(message, "key")) $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - 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(); return writer; }; @@ -3278,7 +3278,7 @@ DeleteKeyRequest.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; }; @@ -3534,20 +3534,20 @@ Key.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.webSettings != null && message.hasOwnProperty("webSettings")) + if (message.webSettings != null && Object.hasOwnProperty.call(message, "webSettings")) $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.encode(message.webSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) + if (message.androidSettings != null && Object.hasOwnProperty.call(message, "androidSettings")) $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.encode(message.androidSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) + if (message.iosSettings != null && Object.hasOwnProperty.call(message, "iosSettings")) $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.encode(message.iosSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - 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 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).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 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -3901,13 +3901,13 @@ if (message.allowedDomains != null && message.allowedDomains.length) for (var i = 0; i < message.allowedDomains.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedDomains[i]); - if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) + if (message.allowAmpTraffic != null && Object.hasOwnProperty.call(message, "allowAmpTraffic")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAmpTraffic); - if (message.allowAllDomains != null && message.hasOwnProperty("allowAllDomains")) + if (message.allowAllDomains != null && Object.hasOwnProperty.call(message, "allowAllDomains")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowAllDomains); - if (message.integrationType != null && message.hasOwnProperty("integrationType")) + if (message.integrationType != null && Object.hasOwnProperty.call(message, "integrationType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.integrationType); - if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) + if (message.challengeSecurityPreference != null && Object.hasOwnProperty.call(message, "challengeSecurityPreference")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.challengeSecurityPreference); return writer; }; @@ -4144,7 +4144,7 @@ /** * IntegrationType enum. * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType - * @enum {string} + * @enum {number} * @property {number} INTEGRATION_TYPE_UNSPECIFIED=0 INTEGRATION_TYPE_UNSPECIFIED value * @property {number} SCORE=1 SCORE value * @property {number} CHECKBOX=2 CHECKBOX value @@ -4162,7 +4162,7 @@ /** * ChallengeSecurityPreference enum. * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference - * @enum {string} + * @enum {number} * @property {number} CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED=0 CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED value * @property {number} USABILITY=1 USABILITY value * @property {number} BALANCE=2 BALANCE value @@ -4929,9 +4929,9 @@ CreateAssessmentRequest.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.assessment != null && message.hasOwnProperty("assessment")) + if (message.assessment != null && Object.hasOwnProperty.call(message, "assessment")) $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.encode(message.assessment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -5144,9 +5144,9 @@ AnnotateAssessmentRequest.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.annotation != null && message.hasOwnProperty("annotation")) + if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.annotation); return writer; }; @@ -5307,7 +5307,7 @@ /** * Annotation enum. * @name google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation - * @enum {string} + * @enum {number} * @property {number} ANNOTATION_UNSPECIFIED=0 ANNOTATION_UNSPECIFIED value * @property {number} LEGITIMATE=1 LEGITIMATE value * @property {number} FRAUDULENT=2 FRAUDULENT value @@ -5576,13 +5576,13 @@ Assessment.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.event != null && message.hasOwnProperty("event")) + if (message.event != null && Object.hasOwnProperty.call(message, "event")) $root.google.cloud.recaptchaenterprise.v1beta1.Event.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.score != null && message.hasOwnProperty("score")) + if (message.score != null && Object.hasOwnProperty.call(message, "score")) writer.uint32(/* id 3, wireType 5 =*/29).float(message.score); - if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) + if (message.tokenProperties != null && Object.hasOwnProperty.call(message, "tokenProperties")) $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.encode(message.tokenProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.reasons != null && message.reasons.length) { writer.uint32(/* id 5, wireType 2 =*/42).fork(); @@ -5829,7 +5829,7 @@ /** * ClassificationReason enum. * @name google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason - * @enum {string} + * @enum {number} * @property {number} CLASSIFICATION_REASON_UNSPECIFIED=0 CLASSIFICATION_REASON_UNSPECIFIED value * @property {number} AUTOMATION=1 AUTOMATION value * @property {number} UNEXPECTED_ENVIRONMENT=2 UNEXPECTED_ENVIRONMENT value @@ -5943,15 +5943,15 @@ Event.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.token != null && message.hasOwnProperty("token")) + if (message.token != null && Object.hasOwnProperty.call(message, "token")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); - if (message.siteKey != null && message.hasOwnProperty("siteKey")) + if (message.siteKey != null && Object.hasOwnProperty.call(message, "siteKey")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.siteKey); - if (message.userAgent != null && message.hasOwnProperty("userAgent")) + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.userAgent); - if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) + if (message.userIpAddress != null && Object.hasOwnProperty.call(message, "userIpAddress")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.userIpAddress); - if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) + if (message.expectedAction != null && Object.hasOwnProperty.call(message, "expectedAction")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.expectedAction); return writer; }; @@ -6219,15 +6219,15 @@ TokenProperties.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.valid != null && message.hasOwnProperty("valid")) + if (message.valid != null && Object.hasOwnProperty.call(message, "valid")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid); - if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) + if (message.invalidReason != null && Object.hasOwnProperty.call(message, "invalidReason")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.invalidReason); - 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 3, wireType 2 =*/26).fork()).ldelim(); - if (message.hostname != null && message.hasOwnProperty("hostname")) + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.hostname); - if (message.action != null && message.hasOwnProperty("action")) + if (message.action != null && Object.hasOwnProperty.call(message, "action")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.action); return writer; }; @@ -6446,7 +6446,7 @@ /** * InvalidReason enum. * @name google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason - * @enum {string} + * @enum {number} * @property {number} INVALID_REASON_UNSPECIFIED=0 INVALID_REASON_UNSPECIFIED value * @property {number} UNKNOWN_INVALID_REASON=1 UNKNOWN_INVALID_REASON value * @property {number} MALFORMED=2 MALFORMED value @@ -6535,9 +6535,9 @@ CreateKeyRequest.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.key != null && message.hasOwnProperty("key")) + if (message.key != null && Object.hasOwnProperty.call(message, "key")) $root.google.cloud.recaptchaenterprise.v1beta1.Key.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -6759,11 +6759,11 @@ ListKeysRequest.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); return writer; }; @@ -6986,7 +6986,7 @@ if (message.keys != null && message.keys.length) for (var i = 0; i < message.keys.length; ++i) $root.google.cloud.recaptchaenterprise.v1beta1.Key.encode(message.keys[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; }; @@ -7204,7 +7204,7 @@ GetKeyRequest.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; }; @@ -7400,9 +7400,9 @@ UpdateKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && message.hasOwnProperty("key")) + if (message.key != null && Object.hasOwnProperty.call(message, "key")) $root.google.cloud.recaptchaenterprise.v1beta1.Key.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - 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(); return writer; }; @@ -7611,7 +7611,7 @@ DeleteKeyRequest.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; }; @@ -7848,15 +7848,15 @@ Key.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.webSettings != null && message.hasOwnProperty("webSettings")) + if (message.webSettings != null && Object.hasOwnProperty.call(message, "webSettings")) $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.encode(message.webSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) + if (message.androidSettings != null && Object.hasOwnProperty.call(message, "androidSettings")) $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.encode(message.androidSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) + if (message.iosSettings != null && Object.hasOwnProperty.call(message, "iosSettings")) $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.encode(message.iosSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -8163,13 +8163,13 @@ if (message.allowedDomains != null && message.allowedDomains.length) for (var i = 0; i < message.allowedDomains.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedDomains[i]); - if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) + if (message.allowAmpTraffic != null && Object.hasOwnProperty.call(message, "allowAmpTraffic")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAmpTraffic); - if (message.enforceAllowedDomains != null && message.hasOwnProperty("enforceAllowedDomains")) + if (message.enforceAllowedDomains != null && Object.hasOwnProperty.call(message, "enforceAllowedDomains")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enforceAllowedDomains); - if (message.integrationType != null && message.hasOwnProperty("integrationType")) + if (message.integrationType != null && Object.hasOwnProperty.call(message, "integrationType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.integrationType); - if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) + if (message.challengeSecurityPreference != null && Object.hasOwnProperty.call(message, "challengeSecurityPreference")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.challengeSecurityPreference); return writer; }; @@ -8406,7 +8406,7 @@ /** * IntegrationType enum. * @name google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType - * @enum {string} + * @enum {number} * @property {number} INTEGRATION_TYPE_UNSPECIFIED=0 INTEGRATION_TYPE_UNSPECIFIED value * @property {number} SCORE_ONLY=1 SCORE_ONLY value * @property {number} CHECKBOX_CHALLENGE=2 CHECKBOX_CHALLENGE value @@ -8424,7 +8424,7 @@ /** * ChallengeSecurityPreference enum. * @name google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference - * @enum {string} + * @enum {number} * @property {number} CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED=0 CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED value * @property {number} USABILITY=1 USABILITY value * @property {number} BALANCED=2 BALANCED value @@ -8935,7 +8935,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; }; @@ -9249,26 +9249,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; }; @@ -9625,9 +9625,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; }; @@ -9773,7 +9773,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 @@ -9894,18 +9894,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; }; @@ -10125,7 +10125,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 @@ -10206,9 +10206,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; }; @@ -10733,9 +10733,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) @@ -10752,9 +10752,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) @@ -10762,7 +10762,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; }; @@ -11300,7 +11300,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) @@ -11317,7 +11317,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) @@ -11782,11 +11782,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; }; @@ -12010,9 +12010,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; }; @@ -12503,25 +12503,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; }; @@ -12868,7 +12868,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 @@ -12914,7 +12914,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 @@ -12995,9 +12995,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; }; @@ -13240,12 +13240,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) @@ -13548,9 +13548,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; }; @@ -13770,11 +13770,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; }; @@ -14008,12 +14008,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; }; @@ -14293,17 +14293,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; }; @@ -14742,45 +14742,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) @@ -15207,7 +15207,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 @@ -15325,18 +15325,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; }; @@ -15678,17 +15678,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) @@ -15699,7 +15699,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; }; @@ -16035,7 +16035,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 @@ -16051,7 +16051,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 @@ -16350,9 +16350,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) @@ -16595,7 +16595,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) @@ -16844,14 +16844,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; }; @@ -17130,9 +17130,9 @@ 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) @@ -17140,7 +17140,7 @@ 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; }; @@ -17374,7 +17374,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 @@ -17504,17 +17504,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; }; @@ -18291,9 +18291,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) @@ -18824,11 +18824,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; }; @@ -19444,9 +19444,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; }; diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index b757263eefc..ddbeadd89ba 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -3,8 +3,16 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-recaptcha-enterprise.git", - "sha": "e2c52184c758b9c080eb41f0082fbc50de2ff147" + "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", + "sha": "731fe3b8236478772a7cc311d0c26ee804080184" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "a3a0bf0f6291d69f2ff3df7fcd63d28ee20ac727", + "internalRef": "310060413" } }, { From 4c210be0abddf1cd0fc70d1de48cb52d5c0d1736 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 8 May 2020 11:27:55 -0700 Subject: [PATCH 115/253] build: do not fail builds on codecov errors (#528) (#171) 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-recaptchaenterprise/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index ddbeadd89ba..0307317ad33 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "731fe3b8236478772a7cc311d0c26ee804080184" + "sha": "42cd9f66c60fb4b989a3f6ea60510ca1e5a5080e" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" + "sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4" } } ], From fe3708d51efdf46625aa6636e7b83f5108940a66 Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Tue, 12 May 2020 10:48:39 -0700 Subject: [PATCH 116/253] fix!: synth.py clean up for multiple version (#172) BREAKING CHANGE: Remove RecaptchaEnterpriseServiceV1Beta1Client. --- .../src/index.ts | 28 ++++++------------- .../synth.metadata | 10 +++---- .../google-cloud-recaptchaenterprise/synth.py | 23 +++++++-------- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 4 +-- 5 files changed, 28 insertions(+), 39 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/index.ts b/packages/google-cloud-recaptchaenterprise/src/index.ts index c250e370615..f093420d3bf 100644 --- a/packages/google-cloud-recaptchaenterprise/src/index.ts +++ b/packages/google-cloud-recaptchaenterprise/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 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,28 +12,16 @@ // 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 v1beta1 from './v1beta1'; import * as v1 from './v1'; -const RecaptchaEnterpriseServiceV1Beta1Client = - v1beta1.RecaptchaEnterpriseServiceV1Beta1Client; +import * as v1beta1 from './v1beta1'; + const RecaptchaEnterpriseServiceClient = v1.RecaptchaEnterpriseServiceClient; -export { - v1, - v1beta1, - RecaptchaEnterpriseServiceV1Beta1Client, - RecaptchaEnterpriseServiceClient, -}; -// For compatibility with JavaScript libraries we need to provide this default export: -// tslint:disable-next-line no-default-export -export default { - v1, - v1beta1, - RecaptchaEnterpriseServiceV1Beta1Client, - RecaptchaEnterpriseServiceClient, -}; + +export {v1, v1beta1, RecaptchaEnterpriseServiceClient}; +export default {v1, v1beta1, RecaptchaEnterpriseServiceClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 0307317ad33..80fefb66755 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -3,23 +3,23 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "42cd9f66c60fb4b989a3f6ea60510ca1e5a5080e" + "remote": "git@github.com:googleapis/nodejs-recaptcha-enterprise.git", + "sha": "05f1acabb9834dd291475598f343ecf7ae62b128" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a3a0bf0f6291d69f2ff3df7fcd63d28ee20ac727", - "internalRef": "310060413" + "sha": "aed11c01e52921613b9ee469c2d85f5f33175fb7", + "internalRef": "310660461" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4" + "sha": "98c50772ec23295c64cf0d2ddf199ea52961fd4c" } } ], diff --git a/packages/google-cloud-recaptchaenterprise/synth.py b/packages/google-cloud-recaptchaenterprise/synth.py index 3b87a2b80d6..d425c125c15 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.py +++ b/packages/google-cloud-recaptchaenterprise/synth.py @@ -27,20 +27,21 @@ gapic = gcp.GAPICMicrogenerator() versions = ['v1', 'v1beta1'] for version in versions: - library = gapic.typescript_library( - 'recaptchaenterprise', version, - generator_args={ - "grpc-service-config": f"google/cloud/recaptchaenterprise/{version}/recaptchaenterprise_grpc_service_config.json", - "package-name": f"@google-cloud/recaptcha-enterprise", - }, - proto_path=f'/google/cloud/recaptchaenterprise/{version}', - extra_proto_files=['google/cloud/common_resources.proto'] - ) - s.copy(library, excludes=['package.json', 'src/index.ts']) + library = gapic.typescript_library( + 'recaptchaenterprise', version, + generator_args={ + "grpc-service-config": f"google/cloud/recaptchaenterprise/{version}/recaptchaenterprise_grpc_service_config.json", + "package-name": f"@google-cloud/recaptcha-enterprise", + }, + proto_path=f'/google/cloud/recaptchaenterprise/{version}', + extra_proto_files=['google/cloud/common_resources.proto'] + ) + s.copy(library, excludes=['package.json']) # Copy common templates common_templates = gcp.CommonTemplates() -templates = common_templates.node_library(source_location='build/src') +templates = common_templates.node_library( + source_location='build/src', versions=versions, default_version='v1') s.copy(templates) node.postprocess_gapic_library() diff --git a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js index cb2d9ca7462..329931436d0 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js @@ -20,7 +20,7 @@ const recaptchaenterprise = require('@google-cloud/recaptcha-enterprise'); function main() { - const recaptchaEnterpriseServiceV1Beta1Client = new recaptchaenterprise.RecaptchaEnterpriseServiceV1Beta1Client(); + const recaptchaEnterpriseServiceV1Beta1Client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); } main(); diff --git a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts index c457bf5c5cd..dd718e491b0 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts @@ -16,10 +16,10 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {RecaptchaEnterpriseServiceV1Beta1Client} from '@google-cloud/recaptcha-enterprise'; +import * as recaptchaenterprise from '@google-cloud/recaptcha-enterprise'; function main() { - new RecaptchaEnterpriseServiceV1Beta1Client(); + new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); } main(); From 0a4416d1944b8ac83bd22495a8649b9739e8ef45 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:52:59 -0700 Subject: [PATCH 117/253] chore: release 2.0.0 (#146) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .../CHANGELOG.md | 20 +++++++++++++++++++ .../package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 0cf0a50a565..dd2b08778aa 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,26 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [2.0.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.8.0...v2.0.0) (2020-05-12) + + +### ⚠ BREAKING CHANGES + +* Remove RecaptchaEnterpriseServiceV1Beta1Client. +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. + +### Features + +* drop node8 support, support for async iterators ([#145](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/145)) ([cc4cc51](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/cc4cc51ec7b1ff8d5078b8524a9e7240639d72c3)) + + +### Bug Fixes + +* export explicit version from protos.js ([#150](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/150)) ([0bfb3c7](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/0bfb3c74a6eaaa906ee34224675ea8dad2e5a055)) +* regen protos and tests, formatting ([#169](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/169)) ([731fe3b](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/731fe3b8236478772a7cc311d0c26ee804080184)) +* remove eslint, update gax, fix generated protos, run the generator ([#155](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/155)) ([21b09f5](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/21b09f555632c6f36d1a487ccac3567064077a49)) +* synth.py clean up for multiple version ([#172](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/172)) ([ee1c250](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/ee1c2509b43b340a731aa98674ebceeab5ccdb2a)) + ## [1.8.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.7.0...v1.8.0) (2020-03-25) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 2730400a896..66fe22c30ba 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.8.0", + "version": "2.0.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index c3fa889e714..76eff83f237 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.8.0" + "@google-cloud/recaptcha-enterprise": "^2.0.0" }, "devDependencies": { "chai": "^4.2.0", From 12f96b6cbdea9c74aaf053b9c60a020ceb2e3a76 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 11 Jun 2020 17:47:30 +0200 Subject: [PATCH 118/253] chore(deps): update dependency mocha to v8 (#178) 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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- packages/google-cloud-recaptchaenterprise/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 66fe22c30ba..2446797edcc 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -37,7 +37,7 @@ "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^2.0.0", - "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-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 76eff83f237..08966896176 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -17,7 +17,7 @@ }, "devDependencies": { "chai": "^4.2.0", - "mocha": "^7.0.0", + "mocha": "^8.0.0", "uuid": "^8.0.0" } } From 728c6f69cb0d32eecac6d498956e55896e86d680 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 16 Jun 2020 16:35:12 -0700 Subject: [PATCH 119/253] fix: proper fallback option handling (#180) --- .../protos/protos.d.ts | 6 ++++ .../protos/protos.js | 28 ++++++++++++++-- .../protos/protos.json | 6 +++- .../src/index.ts | 6 ++-- .../v1/recaptcha_enterprise_service_client.ts | 20 ++++++----- ...tcha_enterprise_service_v1_beta1_client.ts | 20 ++++++----- .../synth.metadata | 33 ++----------------- .../google-cloud-recaptchaenterprise/synth.py | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 4 +-- .../tsconfig.json | 2 +- .../webpack.config.js | 4 +-- 12 files changed, 73 insertions(+), 60 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 9b6337d91cc..a4696f1453e 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -5083,6 +5083,9 @@ export namespace google { /** FieldDescriptorProto options */ options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); } /** Represents a FieldDescriptorProto. */ @@ -5124,6 +5127,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-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 6ab2d1c40c7..d3cb0c5145d 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/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_recaptcha_enterprise_1_8_0_protos || ($protobuf.roots._google_cloud_recaptcha_enterprise_1_8_0_protos = {}); + var $root = $protobuf.roots._google_cloud_recaptcha_enterprise_protos || ($protobuf.roots._google_cloud_recaptcha_enterprise_protos = {}); $root.google = (function() { @@ -12382,6 +12382,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 */ /** @@ -12479,6 +12480,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 @@ -12523,6 +12532,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; }; @@ -12587,6 +12598,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; @@ -12681,6 +12695,9 @@ if (error) return "options." + error; } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; return null; }; @@ -12803,6 +12820,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; }; @@ -12830,6 +12849,7 @@ object.options = null; object.oneofIndex = 0; object.jsonName = ""; + object.proto3Optional = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -12851,6 +12871,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; }; @@ -14644,7 +14666,7 @@ * @memberof google.protobuf.FileOptions * @instance */ - FileOptions.prototype.ccEnableArenas = false; + FileOptions.prototype.ccEnableArenas = true; /** * FileOptions objcClassPrefix. @@ -15130,7 +15152,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-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index 3700f43e38b..199ef8544d8 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -1365,6 +1365,10 @@ "options": { "type": "FieldOptions", "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 } }, "nested": { @@ -1600,7 +1604,7 @@ "type": "bool", "id": 31, "options": { - "default": false + "default": true } }, "objcClassPrefix": { diff --git a/packages/google-cloud-recaptchaenterprise/src/index.ts b/packages/google-cloud-recaptchaenterprise/src/index.ts index f093420d3bf..005c69ded22 100644 --- a/packages/google-cloud-recaptchaenterprise/src/index.ts +++ b/packages/google-cloud-recaptchaenterprise/src/index.ts @@ -16,12 +16,12 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** -import * as v1 from './v1'; import * as v1beta1 from './v1beta1'; +import * as v1 from './v1'; const RecaptchaEnterpriseServiceClient = v1.RecaptchaEnterpriseServiceClient; -export {v1, v1beta1, RecaptchaEnterpriseServiceClient}; -export default {v1, v1beta1, RecaptchaEnterpriseServiceClient}; +export {v1beta1, v1, RecaptchaEnterpriseServiceClient}; +export default {v1beta1, v1, RecaptchaEnterpriseServiceClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index 57d53669357..1ad38c35088 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -100,16 +100,20 @@ export class RecaptchaEnterpriseServiceClient { } 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'; - 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 RecaptchaEnterpriseServiceClient 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-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index fbbfc223310..ec1ce52823c 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -100,16 +100,20 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { } 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'; - 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 RecaptchaEnterpriseServiceV1Beta1Client 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-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 80fefb66755..18185844f54 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,42 +4,15 @@ "git": { "name": ".", "remote": "git@github.com:googleapis/nodejs-recaptcha-enterprise.git", - "sha": "05f1acabb9834dd291475598f343ecf7ae62b128" + "sha": "f548f0270d13a5195c345e209ffeb75a1d038344" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "aed11c01e52921613b9ee469c2d85f5f33175fb7", - "internalRef": "310660461" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "98c50772ec23295c64cf0d2ddf199ea52961fd4c" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "recaptchaenterprise", - "apiVersion": "v1", - "language": "typescript", - "generator": "gapic-generator-typescript" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "recaptchaenterprise", - "apiVersion": "v1beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "sha": "c1ba5ba3f24307ca5a6df350d0137c29d69983d5", + "internalRef": "316715576" } } ] diff --git a/packages/google-cloud-recaptchaenterprise/synth.py b/packages/google-cloud-recaptchaenterprise/synth.py index d425c125c15..9b135f82691 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.py +++ b/packages/google-cloud-recaptchaenterprise/synth.py @@ -25,7 +25,7 @@ # run the gapic generator gapic = gcp.GAPICMicrogenerator() -versions = ['v1', 'v1beta1'] +versions = ['v1beta1', 'v1'] for version in versions: library = gapic.typescript_library( 'recaptchaenterprise', version, diff --git a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js index 329931436d0..d8d9e2cdd6d 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js @@ -20,7 +20,7 @@ const recaptchaenterprise = require('@google-cloud/recaptcha-enterprise'); function main() { - const recaptchaEnterpriseServiceV1Beta1Client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); + const recaptchaEnterpriseServiceClient = new recaptchaenterprise.RecaptchaEnterpriseServiceClient(); } main(); diff --git a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts index dd718e491b0..cc5f3b1a188 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts @@ -16,10 +16,10 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import * as recaptchaenterprise from '@google-cloud/recaptcha-enterprise'; +import {RecaptchaEnterpriseServiceClient} from '@google-cloud/recaptcha-enterprise'; function main() { - new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); + new RecaptchaEnterpriseServiceClient(); } main(); diff --git a/packages/google-cloud-recaptchaenterprise/tsconfig.json b/packages/google-cloud-recaptchaenterprise/tsconfig.json index 613d35597b5..c78f1c884ef 100644 --- a/packages/google-cloud-recaptchaenterprise/tsconfig.json +++ b/packages/google-cloud-recaptchaenterprise/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "build", "resolveJsonModule": true, "lib": [ - "es2016", + "es2018", "dom" ] }, diff --git a/packages/google-cloud-recaptchaenterprise/webpack.config.js b/packages/google-cloud-recaptchaenterprise/webpack.config.js index 04831b77a4d..4c93b13d835 100644 --- a/packages/google-cloud-recaptchaenterprise/webpack.config.js +++ b/packages/google-cloud-recaptchaenterprise/webpack.config.js @@ -17,8 +17,8 @@ const path = require('path'); module.exports = { entry: './src/index.ts', output: { - library: 'RecaptchaEnterpriseServiceV1Beta1', - filename: './recaptcha-enterprise-service-v1-beta1.js', + library: 'RecaptchaEnterpriseService', + filename: './recaptcha-enterprise-service.js', }, node: { child_process: 'empty', From ae08a366b98e6529e8684f255fc9dcac3551c4ef Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 19 Jun 2020 16:18:07 -0700 Subject: [PATCH 120/253] docs: update bug report template (#182) 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. --- .../synth.metadata | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 18185844f54..3265eb506e3 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -3,8 +3,8 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-recaptcha-enterprise.git", - "sha": "f548f0270d13a5195c345e209ffeb75a1d038344" + "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", + "sha": "52fe53d93402d247036b31badde5d57fa4f1ee78" } }, { @@ -14,6 +14,33 @@ "sha": "c1ba5ba3f24307ca5a6df350d0137c29d69983d5", "internalRef": "316715576" } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "b10590a4a1568548dd13cfcea9aa11d40898144b" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "recaptchaenterprise", + "apiVersion": "v1beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } + }, + { + "client": { + "source": "googleapis", + "apiName": "recaptchaenterprise", + "apiVersion": "v1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } } ] } \ No newline at end of file From 62836dffccfd81eab24532b55e5429ae27dd8ab9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 28 Jun 2020 06:52:03 -0700 Subject: [PATCH 121/253] build(secrets): begin migration to secret manager from keystore (#177) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/e6ac0f7f-2fc1-4ac2-9eb5-23ba1215b6a2/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/dc9caca650c77b7039e2bbc3339ffb34ae78e5b7 --- packages/google-cloud-recaptchaenterprise/.gitattributes | 3 +++ packages/google-cloud-recaptchaenterprise/synth.metadata | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/.gitattributes diff --git a/packages/google-cloud-recaptchaenterprise/.gitattributes b/packages/google-cloud-recaptchaenterprise/.gitattributes new file mode 100644 index 00000000000..2e63216ae9c --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/.gitattributes @@ -0,0 +1,3 @@ +*.ts text eol=lf +*.js test eol=lf +protos/* linguist-generated diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 3265eb506e3..8e9eac72aae 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "52fe53d93402d247036b31badde5d57fa4f1ee78" + "sha": "fd52ed9ae9cc159c2b3915fcfc4a11ae1462ac4b" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "b10590a4a1568548dd13cfcea9aa11d40898144b" + "sha": "dc9caca650c77b7039e2bbc3339ffb34ae78e5b7" } } ], From 7083ca6b79127343987671b5735519005716d4aa Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 6 Jul 2020 10:17:12 -0700 Subject: [PATCH 122/253] build: use bazel build (#183) --- .../synth.metadata | 22 ++++++------------- .../google-cloud-recaptchaenterprise/synth.py | 12 ++-------- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 8e9eac72aae..2171982bca2 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "fd52ed9ae9cc159c2b3915fcfc4a11ae1462ac4b" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c1ba5ba3f24307ca5a6df350d0137c29d69983d5", - "internalRef": "316715576" + "remote": "git@github.com:googleapis/nodejs-recaptcha-enterprise.git", + "sha": "dbccd2e444d5d808ad6981acf3ad6936106e9649" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "dc9caca650c77b7039e2bbc3339ffb34ae78e5b7" + "sha": "303271797a360f8a439203413f13a160f2f5b3b4" } } ], @@ -29,8 +21,8 @@ "source": "googleapis", "apiName": "recaptchaenterprise", "apiVersion": "v1beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "language": "nodejs", + "generator": "bazel" } }, { @@ -38,8 +30,8 @@ "source": "googleapis", "apiName": "recaptchaenterprise", "apiVersion": "v1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "language": "nodejs", + "generator": "bazel" } } ] diff --git a/packages/google-cloud-recaptchaenterprise/synth.py b/packages/google-cloud-recaptchaenterprise/synth.py index 9b135f82691..505642335aa 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.py +++ b/packages/google-cloud-recaptchaenterprise/synth.py @@ -24,18 +24,10 @@ # run the gapic generator -gapic = gcp.GAPICMicrogenerator() +gapic = gcp.GAPICBazel() versions = ['v1beta1', 'v1'] for version in versions: - library = gapic.typescript_library( - 'recaptchaenterprise', version, - generator_args={ - "grpc-service-config": f"google/cloud/recaptchaenterprise/{version}/recaptchaenterprise_grpc_service_config.json", - "package-name": f"@google-cloud/recaptcha-enterprise", - }, - proto_path=f'/google/cloud/recaptchaenterprise/{version}', - extra_proto_files=['google/cloud/common_resources.proto'] - ) + library = gapic.node_library('recaptchaenterprise', version) s.copy(library, excludes=['package.json']) # Copy common templates From 6635b5a96aea55589a4f9963cb7aaaa9923f8105 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 7 Jul 2020 14:02:51 -0700 Subject: [PATCH 123/253] chore: release 2.0.1 (#181) * 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-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index dd2b08778aa..6b3fbf36410 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [2.0.1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.0.0...v2.0.1) (2020-07-06) + + +### Bug Fixes + +* proper fallback option handling ([#180](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/180)) ([52fe53d](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/52fe53d93402d247036b31badde5d57fa4f1ee78)) + ## [2.0.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v1.8.0...v2.0.0) (2020-05-12) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 2446797edcc..d8a2d39dc57 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.0.0", + "version": "2.0.1", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 08966896176..95adcddd592 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.0.0" + "@google-cloud/recaptcha-enterprise": "^2.0.1" }, "devDependencies": { "chai": "^4.2.0", From 89755ec5d7fbb6487def7aef8a781c9381bf9abf Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 9 Jul 2020 22:38:10 -0700 Subject: [PATCH 124/253] build: typeo in nodejs .gitattribute (#187) 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 --- .../.gitattributes | 2 +- .../synth.metadata | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.gitattributes b/packages/google-cloud-recaptchaenterprise/.gitattributes index 2e63216ae9c..d4f4169b28b 100644 --- a/packages/google-cloud-recaptchaenterprise/.gitattributes +++ b/packages/google-cloud-recaptchaenterprise/.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-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 2171982bca2..703da67b194 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -3,15 +3,23 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-recaptcha-enterprise.git", - "sha": "dbccd2e444d5d808ad6981acf3ad6936106e9649" + "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", + "sha": "1d91f4b2eddecd653d07eea020da38ed7adeb295" + } + }, + { + "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 88e24368da76d8a02a9e244a8dd3da818bec0eed Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jul 2020 18:51:39 +0200 Subject: [PATCH 125/253] chore(deps): update dependency ts-loader to v8 (#186) 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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index d8a2d39dc57..1a46c631df9 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -41,7 +41,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.41.2", "webpack-cli": "^3.3.10" From 35ecba0d4a17feca130a5676558f7c994772660b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 12 Jul 2020 18:46:57 +0200 Subject: [PATCH 126/253] chore(deps): update dependency @types/mocha to v8 (#188) 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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 1a46c631df9..f175fadf509 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -28,7 +28,7 @@ "google-gax": "^2.1.0" }, "devDependencies": { - "@types/mocha": "^7.0.0", + "@types/mocha": "^8.0.0", "@types/node": "^12.0.0", "@types/sinon": "^9.0.0", "c8": "^7.0.0", From e2c1714e385ec647f6f04944bca92ca0656653d0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 17 Jul 2020 16:05:00 -0700 Subject: [PATCH 127/253] build: add Node 8 tests (#192) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/5b03461e-47c0-40e8-a8ad-c465ee146cc5/targets - [ ] To automatically regenerate this PR, check this box. --- .../protos/protos.js | 24 +++++++++++++++---- .../synth.metadata | 2 +- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index d3cb0c5145d..aa0d17bc411 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -3579,7 +3579,7 @@ Key.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.Key(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.Key(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3599,12 +3599,26 @@ message.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.decode(reader, reader.uint32()); break; case 6: - 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 7: message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 703da67b194..328e443c4f1 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "1d91f4b2eddecd653d07eea020da38ed7adeb295" + "sha": "b6d9bfa16627782deddb7d495a80d2acd7cb37d5" } }, { From 17bbd0b635ab32848fdacad356e953e6a42e4c0c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 17 Jul 2020 16:28:14 -0700 Subject: [PATCH 128/253] build: missing closing paren in publish script, delete template for Node 8, add config files for cloud-rad (#193) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/5b03461e-47c0-40e8-a8ad-c465ee146cc5/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/21f1470ecd01424dc91c70f1a7c798e4e87d1eec Source-Link: https://github.com/googleapis/synthtool/commit/388e10f5ae302d3e8de1fac99f3a95d1ab8f824a Source-Link: https://github.com/googleapis/synthtool/commit/d82deccf657a66e31bd5da9efdb96c6fa322fc7e --- .../api-extractor.json | 369 ++++++++++++++++++ .../synth.metadata | 2 +- 2 files changed, 370 insertions(+), 1 deletion(-) create mode 100644 packages/google-cloud-recaptchaenterprise/api-extractor.json diff --git a/packages/google-cloud-recaptchaenterprise/api-extractor.json b/packages/google-cloud-recaptchaenterprise/api-extractor.json new file mode 100644 index 00000000000..de228294b23 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 328e443c4f1..e092df56132 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" + "sha": "21f1470ecd01424dc91c70f1a7c798e4e87d1eec" } } ], From b22f7450e0854fbc3f7a5bf2455a770e0754735e Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Tue, 21 Jul 2020 14:46:43 -0400 Subject: [PATCH 129/253] chore: add dev dependencies for cloud-rad ref docs (#194) --- packages/google-cloud-recaptchaenterprise/package.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index f175fadf509..fbca7bfcc1b 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -44,7 +44,9 @@ "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^4.41.2", - "webpack-cli": "^3.3.10" + "webpack-cli": "^3.3.10", + "@microsoft/api-documenter": "^7.8.10", + "@microsoft/api-extractor": "^7.8.10" }, "scripts": { "lint": "gts check", @@ -60,7 +62,9 @@ "predocs-test": "npm run docs", "prepare": "npm run compile", "prelint": "cd samples; npm link ../; npm install", - "precompile": "gts clean" + "precompile": "gts clean", + "api-extractor": "api-extractor run --local", + "api-documenter": "api-documenter yaml --input-folder=temp" }, "license": "Apache-2.0", "engines": { From 8a2ca17d3160b385a085cbf150a9d2a07755458b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 22 Jul 2020 17:38:49 -0700 Subject: [PATCH 130/253] build: rename _toc to toc (#195) Source-Author: F. Hinkelmann Source-Date: Tue Jul 21 10:53:20 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 99c93fe09f8c1dca09dfc0301c8668e3a70dd796 Source-Link: https://github.com/googleapis/synthtool/commit/99c93fe09f8c1dca09dfc0301c8668e3a70dd796 Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- packages/google-cloud-recaptchaenterprise/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index e092df56132..b9e48cab5c4 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "b6d9bfa16627782deddb7d495a80d2acd7cb37d5" + "sha": "72955be73755a777a64a65669998d914ff8b73e5" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "21f1470ecd01424dc91c70f1a7c798e4e87d1eec" + "sha": "99c93fe09f8c1dca09dfc0301c8668e3a70dd796" } } ], From 3822eebc03e9d326cefa2dcaed076e7677f9dfab Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 24 Jul 2020 13:30:17 -0700 Subject: [PATCH 131/253] chore: move gitattributes files to node templates (#196) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/452e1583-6c83-495a-ad97-fb34fc6f653f/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3 --- packages/google-cloud-recaptchaenterprise/.gitattributes | 1 + packages/google-cloud-recaptchaenterprise/synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.gitattributes b/packages/google-cloud-recaptchaenterprise/.gitattributes index d4f4169b28b..33739cb74e4 100644 --- a/packages/google-cloud-recaptchaenterprise/.gitattributes +++ b/packages/google-cloud-recaptchaenterprise/.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-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index b9e48cab5c4..a783644fe30 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "72955be73755a777a64a65669998d914ff8b73e5" + "sha": "b3148afa6977364fe9d5cddf5c8c48bc22d2a8cd" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "99c93fe09f8c1dca09dfc0301c8668e3a70dd796" + "sha": "3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3" } } ], From 3dcd02be018207886cc27d4c3c3e5a57a9292de2 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 29 Jul 2020 16:36:31 -0700 Subject: [PATCH 132/253] chore(node): fix kokoro build path for cloud-rad (#197) 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-recaptchaenterprise/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index a783644fe30..1fd93df9727 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "b3148afa6977364fe9d5cddf5c8c48bc22d2a8cd" + "sha": "e808af3bf9640f95b51525aa6c43aa7dd66e68e0" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3" + "sha": "89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa" } } ], From 3b088e3eeeb769a944544e6f6b8be5cde0f443c6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 30 Jul 2020 20:25:00 -0700 Subject: [PATCH 133/253] build: update protos --- packages/google-cloud-recaptchaenterprise/protos/protos.d.ts | 2 +- packages/google-cloud-recaptchaenterprise/protos/protos.js | 2 +- packages/google-cloud-recaptchaenterprise/synth.metadata | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index a4696f1453e..97ece981f7b 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index aa0d17bc411..a66a777bd69 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 1fd93df9727..d7f91f54164 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "e808af3bf9640f95b51525aa6c43aa7dd66e68e0" + "sha": "330bd0361e20f47190b1c7eb544d69170c290744" } }, { From 84133fd0277945edc78d57530d1f721ed8b47a8b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 2 Aug 2020 21:50:03 -0700 Subject: [PATCH 134/253] docs: add links to the CHANGELOG from the README.md for Java and Node (#199) 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-recaptchaenterprise/README.md | 3 +++ packages/google-cloud-recaptchaenterprise/synth.metadata | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index bd9cb9be542..bc5912ed13a 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -14,6 +14,9 @@ reCAPTCHA Enterprise API client for Node.js +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-recaptcha-enterprise/blob/master/CHANGELOG.md). + * [Google Cloud reCAPTCHA Enterprise Node.js Client API Reference][client-docs] * [Google Cloud reCAPTCHA Enterprise Documentation][product-docs] * [github.com/googleapis/nodejs-recaptcha-enterprise](https://github.com/googleapis/nodejs-recaptcha-enterprise) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index d7f91f54164..1128777b677 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "330bd0361e20f47190b1c7eb544d69170c290744" + "sha": "7790462f551238d692442b8924bc257773bf16dc" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa" + "sha": "5936421202fb53ed4641bcb824017dd393a3dbcc" } } ], From 0ffe2606c9f2fd1481697acb231eddf9679277f1 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 10 Aug 2020 10:56:14 -0700 Subject: [PATCH 135/253] build: --credential-file-override is no longer required (#200) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/96fb0e9d-e02a-4451-878f-e646368369cc/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/94421c47802f56a44c320257b2b4c190dc7d6b68 --- packages/google-cloud-recaptchaenterprise/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 1128777b677..aba848a0e59 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "7790462f551238d692442b8924bc257773bf16dc" + "sha": "569c5da14e8b7c9a6f98eb0ed977a1f0d5e114cc" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5936421202fb53ed4641bcb824017dd393a3dbcc" + "sha": "94421c47802f56a44c320257b2b4c190dc7d6b68" } } ], From 5d76548adfad098899b9987c9184c51ac79a0045 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 12 Aug 2020 12:50:15 -0700 Subject: [PATCH 136/253] build: use gapic-generator-typescript v1.0.7. (#201) 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/v1/recaptcha_enterprise_service_client.ts | 5 ++--- .../v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts | 5 ++--- packages/google-cloud-recaptchaenterprise/synth.metadata | 6 +++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index 1ad38c35088..6fdef307026 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -253,12 +253,11 @@ export class RecaptchaEnterpriseServiceClient { } ); + const descriptor = this.descriptors.page[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-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index ec1ce52823c..0f72c7bc276 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -253,12 +253,11 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { } ); + const descriptor = this.descriptors.page[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-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index aba848a0e59..6ba3162408e 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "569c5da14e8b7c9a6f98eb0ed977a1f0d5e114cc" + "sha": "1efffc85e021059dd0eeb3d95cc5388f61a325f7" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4f4aa3a03e470f1390758b9d89eb1aa88837a5be", - "internalRef": "320300472" + "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", + "internalRef": "325949033" } }, { From e338cffc1743e3635371ebdc02ead84498c978db Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 12 Aug 2020 21:32:08 -0700 Subject: [PATCH 137/253] chore: update cloud rad kokoro build job (#202) 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-recaptchaenterprise/synth.metadata | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 6ba3162408e..0b88b4110e3 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "94421c47802f56a44c320257b2b4c190dc7d6b68" + "sha": "bd0deaa1113b588d70449535ab9cbf0f2bd0e72f" } } ], From a239ed2e6882c682751571991f0c4d4aa1d757cb Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 13 Aug 2020 12:40:06 -0700 Subject: [PATCH 138/253] build: perform publish using Node 12 (#203) 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-recaptchaenterprise/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 0b88b4110e3..6b86c561398 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "1efffc85e021059dd0eeb3d95cc5388f61a325f7" + "sha": "4b6b88d44dac12131d6ca322cd240fd7b4ab57da" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "bd0deaa1113b588d70449535ab9cbf0f2bd0e72f" + "sha": "5747555f7620113d9a2078a48f4c047a99d31b3e" } } ], From 67f78e7dc89c302ab707b27272f7c53f0b1c2efc Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 19 Aug 2020 09:42:51 -0700 Subject: [PATCH 139/253] chore: start tracking obsolete files (#204) 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. --- .../synth.metadata | 86 ++++++++++++++++++- 1 file changed, 82 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 6b86c561398..ffd9a8f30b6 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "4b6b88d44dac12131d6ca322cd240fd7b4ab57da" + "sha": "a4d916916a30af019e87bc6967f4b589431d0f0a" } }, { "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" } } ], @@ -42,5 +42,83 @@ "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.3476848224", + "protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto", + "protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto", + "protos/protos.d.ts", + "protos/protos.js", + "protos/protos.json", + "renovate.json", + "samples/README.md", + "samples/package-lock.json.3210380778", + "src/index.ts", + "src/v1/index.ts", + "src/v1/recaptcha_enterprise_service_client.ts", + "src/v1/recaptcha_enterprise_service_client_config.json", + "src/v1/recaptcha_enterprise_service_proto_list.json", + "src/v1beta1/index.ts", + "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts", + "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json", + "src/v1beta1/recaptcha_enterprise_service_v1_beta1_proto_list.json", + "system-test/fixtures/sample/src/index.js", + "system-test/fixtures/sample/src/index.ts", + "system-test/install.ts", + "test/gapic_recaptcha_enterprise_service_v1.ts", + "test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts", + "tsconfig.json", + "webpack.config.js" ] } \ No newline at end of file From 234ae37ba2f880bb6e484a0a10d4b77e332bdc6e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 21 Aug 2020 16:30:25 -0700 Subject: [PATCH 140/253] build: move system and samples test from Node 10 to Node 12 (#205) 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 --- .../synth.metadata | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index ffd9a8f30b6..15582341c99 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "a4d916916a30af019e87bc6967f4b589431d0f0a" + "sha": "7dfe7c78bff52b249c268270c591cde93f9dc47e" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1a60ff2a3975c2f5054431588bd95db9c3b862ba" + "sha": "05de3e1e14a0b07eab8b474e669164dbd31f81fb" } } ], @@ -60,19 +60,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", @@ -95,7 +95,6 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.3476848224", "protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto", "protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto", "protos/protos.d.ts", @@ -103,7 +102,6 @@ "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.3210380778", "src/index.ts", "src/v1/index.ts", "src/v1/recaptcha_enterprise_service_client.ts", From be1a52a479cbb2ecb96162e6f595a97161bfce79 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 27 Aug 2020 09:26:25 -0700 Subject: [PATCH 141/253] build: track flaky tests for "nightly", add new secrets for tagging (#206) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/36077dab-6428-471f-9375-a14a1a227f45/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/8cf6d2834ad14318e64429c3b94f6443ae83daf9 --- packages/google-cloud-recaptchaenterprise/synth.metadata | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 15582341c99..33538a9737c 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "7dfe7c78bff52b249c268270c591cde93f9dc47e" + "sha": "bd66d10665e7ffceff372245b93dac65cb122ea5" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "05de3e1e14a0b07eab8b474e669164dbd31f81fb" + "sha": "8cf6d2834ad14318e64429c3b94f6443ae83daf9" } } ], @@ -51,7 +51,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 502325a43960c52e1fb954f85a4924ac687a2af9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 12 Sep 2020 20:18:02 -0700 Subject: [PATCH 142/253] build(test): recursively find test files; fail on unsupported dependency versions (#209) Source-Author: Megan Potter <57276408+feywind@users.noreply.github.com> Source-Date: Fri Sep 11 18:47:00 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: fdd03c161003ab97657cc0218f25c82c89ddf4b6 Source-Link: https://github.com/googleapis/synthtool/commit/fdd03c161003ab97657cc0218f25c82c89ddf4b6 --- packages/google-cloud-recaptchaenterprise/.mocharc.js | 3 ++- packages/google-cloud-recaptchaenterprise/synth.metadata | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.mocharc.js b/packages/google-cloud-recaptchaenterprise/.mocharc.js index ff7b34fa5d1..0b600509bed 100644 --- a/packages/google-cloud-recaptchaenterprise/.mocharc.js +++ b/packages/google-cloud-recaptchaenterprise/.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-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 33538a9737c..3e013bb7177 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "bd66d10665e7ffceff372245b93dac65cb122ea5" + "sha": "c256fed025e45a530afc7c9400dfc044aee7683c" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8cf6d2834ad14318e64429c3b94f6443ae83daf9" + "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" } } ], From 373e1d38236b971997a2db5d167287d72302dce9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 1 Oct 2020 04:30:03 -0700 Subject: [PATCH 143/253] chore: update bucket for cloud-rad (#210) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/d5dc594d-067f-40c2-83fa-c3be5360d1dd/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/079dcce498117f9570cebe6e6cff254b38ba3860 --- packages/google-cloud-recaptchaenterprise/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 3e013bb7177..53c05999809 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "c256fed025e45a530afc7c9400dfc044aee7683c" + "sha": "fa5f460dfb6f892306a4adb62dad6487a6c7bf83" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" + "sha": "079dcce498117f9570cebe6e6cff254b38ba3860" } } ], From ea5fad012768da8bfd345ed48be9bfb67d9c8fc1 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 5 Oct 2020 10:42:25 -0700 Subject: [PATCH 144/253] build(node_library): migrate to Trampoline V2 (#211) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/da9a0346-3aae-4809-a60a-a33e68ec23d5/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9 --- packages/google-cloud-recaptchaenterprise/synth.metadata | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 53c05999809..bdeaad1077b 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "fa5f460dfb6f892306a4adb62dad6487a6c7bf83" + "sha": "6815a1fe7a647bd8d304bba30fb756b142ba0601" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "079dcce498117f9570cebe6e6cff254b38ba3860" + "sha": "0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9" } } ], @@ -84,10 +84,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 f59131eff0e2cd8b133e6f8c3a0c4ca18d059b92 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 12 Oct 2020 21:56:11 +0200 Subject: [PATCH 145/253] chore(deps): update dependency webpack-cli to v4 (#214) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [webpack-cli](https://togithub.com/webpack/webpack-cli) | devDependencies | major | [`^3.3.10` -> `^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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index fbca7bfcc1b..8550b8e78ba 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -44,7 +44,7 @@ "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^4.41.2", - "webpack-cli": "^3.3.10", + "webpack-cli": "^4.0.0", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" }, From 47e8eb853f838ab8695dab50387666f3a6588175 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Oct 2020 23:02:39 +0200 Subject: [PATCH 146/253] chore(deps): update dependency webpack to v5 (#213) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [webpack](https://togithub.com/webpack/webpack) | devDependencies | major | [`^4.41.2` -> `^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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 8550b8e78ba..84ca487539b 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -43,7 +43,7 @@ "sinon": "^9.0.1", "ts-loader": "^8.0.0", "typescript": "^3.8.3", - "webpack": "^4.41.2", + "webpack": "^5.0.0", "webpack-cli": "^4.0.0", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" From 417500a3357e24e0c5505382dabae3700e0e23cf Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 16 Oct 2020 10:08:43 -0700 Subject: [PATCH 147/253] build: only check --engine-strict for production deps (#215) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/a30f98da-7f8e-4a25-a598-8357af693448/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5451633881133e5573cc271a18e73b18caca8b1b --- packages/google-cloud-recaptchaenterprise/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index bdeaad1077b..c9cdac24b9f 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "6815a1fe7a647bd8d304bba30fb756b142ba0601" + "sha": "16142fdd0efaf8a0458d9fc6a3dd1fc9af4425d5" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9" + "sha": "5451633881133e5573cc271a18e73b18caca8b1b" } } ], From 64172911cdfcc939a3faf89e536a5aa1def97a5e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 21 Oct 2020 16:14:40 -0700 Subject: [PATCH 148/253] chore: clean up Node.js TOC for cloud-rad (#216) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/35103ef2-979e-4beb-a5b8-34c85c93e32a/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/901ddd44e9ef7887ee681b9183bbdea99437fdcc Source-Link: https://github.com/googleapis/synthtool/commit/f96d3b455fe27c3dc7bc37c3c9cd27b1c6d269c8 --- packages/google-cloud-recaptchaenterprise/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index c9cdac24b9f..cdf53d0fc86 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "16142fdd0efaf8a0458d9fc6a3dd1fc9af4425d5" + "sha": "f27bcc874fac320a680734caeb60c133bf3e34e9" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5451633881133e5573cc271a18e73b18caca8b1b" + "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" } } ], From 643613c2b52e7ba7cb5c6882e89d24a87b7f0273 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 27 Oct 2020 08:38:53 -0700 Subject: [PATCH 149/253] docs: updated code of conduct (includes update to actions) (#219) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/313ec1b8-2bb0-49a2-a59d-9211defb7a66/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 --- .../CODE_OF_CONDUCT.md | 123 +++++++++++++----- .../synth.metadata | 4 +- 2 files changed, 89 insertions(+), 38 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CODE_OF_CONDUCT.md b/packages/google-cloud-recaptchaenterprise/CODE_OF_CONDUCT.md index 46b2a08ea6d..2add2547a81 100644 --- a/packages/google-cloud-recaptchaenterprise/CODE_OF_CONDUCT.md +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index cdf53d0fc86..2870645bc18 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "f27bcc874fac320a680734caeb60c133bf3e34e9" + "sha": "f0edc8422d39eba895bd533177758df80f8922a6" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" + "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" } } ], From f64b92ccb5b80da3ee649f5de65f622f7f476b04 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 2 Nov 2020 15:58:14 -0800 Subject: [PATCH 150/253] build(node): add KOKORO_BUILD_ARTIFACTS_SUBDIR to env (#220) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/933ad2fd-a72d-472d-91bb-4b474e01ed77/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/ba9918cd22874245b55734f57470c719b577e591 --- packages/google-cloud-recaptchaenterprise/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 2870645bc18..eb60a7ee472 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "f0edc8422d39eba895bd533177758df80f8922a6" + "sha": "abf59a948ff90aead2b5e43d85edcefab92ec534" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" + "sha": "ba9918cd22874245b55734f57470c719b577e591" } } ], From fc32a17f2b69417594f1eabe65b3a580b4983384 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 6 Nov 2020 15:42:27 -0800 Subject: [PATCH 151/253] fix: do not modify options object, use defaultScopes (#222) Regenerated the library using [gapic-generator-typescript](https://github.com/googleapis/gapic-generator-typescript) v1.2.1. --- .../package.json | 2 +- .../src/index.ts | 1 + .../v1/recaptcha_enterprise_service_client.ts | 160 ++++++++++-------- ...tcha_enterprise_service_v1_beta1_client.ts | 160 ++++++++++-------- .../synth.metadata | 16 +- .../system-test/fixtures/sample/src/index.ts | 11 +- .../system-test/install.ts | 18 +- 7 files changed, 212 insertions(+), 156 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 84ca487539b..a2e6a69a5ac 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -25,7 +25,7 @@ "reCAPTCHA Enterprise API" ], "dependencies": { - "google-gax": "^2.1.0" + "google-gax": "^2.9.2" }, "devDependencies": { "@types/mocha": "^8.0.0", diff --git a/packages/google-cloud-recaptchaenterprise/src/index.ts b/packages/google-cloud-recaptchaenterprise/src/index.ts index 005c69ded22..48e5381c3e6 100644 --- a/packages/google-cloud-recaptchaenterprise/src/index.ts +++ b/packages/google-cloud-recaptchaenterprise/src/index.ts @@ -20,6 +20,7 @@ import * as v1beta1 from './v1beta1'; import * as v1 from './v1'; const RecaptchaEnterpriseServiceClient = v1.RecaptchaEnterpriseServiceClient; +type RecaptchaEnterpriseServiceClient = v1.RecaptchaEnterpriseServiceClient; export {v1beta1, v1, RecaptchaEnterpriseServiceClient}; export default {v1beta1, v1, RecaptchaEnterpriseServiceClient}; diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index 6fdef307026..7476f454049 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -60,8 +60,10 @@ export class RecaptchaEnterpriseServiceClient { /** * Construct an instance of RecaptchaEnterpriseServiceClient. * - * @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] @@ -81,44 +83,34 @@ export class RecaptchaEnterpriseServiceClient { * 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 RecaptchaEnterpriseServiceClient; 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 RecaptchaEnterpriseServiceClient 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 RecaptchaEnterpriseServiceClient).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. @@ -127,6 +119,11 @@ export class RecaptchaEnterpriseServiceClient { // 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) { @@ -268,6 +265,7 @@ export class RecaptchaEnterpriseServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'recaptchaenterprise.googleapis.com'; @@ -276,6 +274,7 @@ export class RecaptchaEnterpriseServiceClient { /** * 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 'recaptchaenterprise.googleapis.com'; @@ -283,6 +282,7 @@ export class RecaptchaEnterpriseServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -291,6 +291,7 @@ export class RecaptchaEnterpriseServiceClient { /** * 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']; @@ -300,8 +301,7 @@ export class RecaptchaEnterpriseServiceClient { 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 @@ -364,7 +364,11 @@ export class RecaptchaEnterpriseServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1.Assessment}. - * 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.createAssessment(request); */ createAssessment( request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, @@ -462,7 +466,11 @@ export class RecaptchaEnterpriseServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse}. - * 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.annotateAssessment(request); */ annotateAssessment( request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, @@ -556,7 +564,11 @@ export class RecaptchaEnterpriseServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * 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.createKey(request); */ createKey( request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, @@ -645,7 +657,11 @@ export class RecaptchaEnterpriseServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * 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.getKey(request); */ getKey( request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, @@ -736,7 +752,11 @@ export class RecaptchaEnterpriseServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * 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.updateKey(request); */ updateKey( request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, @@ -825,7 +845,11 @@ export class RecaptchaEnterpriseServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * 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.deleteKey(request); */ deleteKey( request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, @@ -921,19 +945,14 @@ export class RecaptchaEnterpriseServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * 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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key} 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 [ListKeysRequest]{@link google.cloud.recaptchaenterprise.v1.ListKeysRequest} - * 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 - * [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1.ListKeysResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listKeysAsync()` + * 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. */ listKeys( request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, @@ -981,18 +1000,7 @@ export class RecaptchaEnterpriseServiceClient { } /** - * Equivalent to {@link listKeys}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listKeys} 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 @@ -1008,6 +1016,13 @@ export class RecaptchaEnterpriseServiceClient { * 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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key} 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 `listKeysAsync()` + * 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. */ listKeysStream( request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, @@ -1032,10 +1047,9 @@ export class RecaptchaEnterpriseServiceClient { } /** - * Equivalent to {@link listKeys}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listKeys`, 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 @@ -1050,7 +1064,18 @@ export class RecaptchaEnterpriseServiceClient { * @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 + * [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. 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.listKeysAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listKeysAsync( request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, @@ -1176,9 +1201,10 @@ export class RecaptchaEnterpriseServiceClient { } /** - * 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-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 0f72c7bc276..c02a8bf4f19 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -60,8 +60,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { /** * Construct an instance of RecaptchaEnterpriseServiceV1Beta1Client. * - * @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] @@ -81,44 +83,34 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * 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 RecaptchaEnterpriseServiceV1Beta1Client; 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 RecaptchaEnterpriseServiceV1Beta1Client 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 RecaptchaEnterpriseServiceV1Beta1Client).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. @@ -127,6 +119,11 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // 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) { @@ -268,6 +265,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'recaptchaenterprise.googleapis.com'; @@ -276,6 +274,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { /** * 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 'recaptchaenterprise.googleapis.com'; @@ -283,6 +282,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -291,6 +291,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { /** * 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']; @@ -300,8 +301,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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 @@ -364,7 +364,11 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment}. - * 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.createAssessment(request); */ createAssessment( request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, @@ -462,7 +466,11 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse}. - * 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.annotateAssessment(request); */ annotateAssessment( request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, @@ -559,7 +567,11 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * 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.createKey(request); */ createKey( request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, @@ -654,7 +666,11 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * 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.getKey(request); */ getKey( request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, @@ -751,7 +767,11 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * 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.updateKey(request); */ updateKey( request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, @@ -846,7 +866,11 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * 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.deleteKey(request); */ deleteKey( request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, @@ -945,19 +969,14 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * 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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} 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 [ListKeysRequest]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} - * 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 - * [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listKeysAsync()` + * 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. */ listKeys( request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, @@ -1005,18 +1024,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { } /** - * Equivalent to {@link listKeys}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listKeys} 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 @@ -1032,6 +1040,13 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * 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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} 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 `listKeysAsync()` + * 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. */ listKeysStream( request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, @@ -1056,10 +1071,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { } /** - * Equivalent to {@link listKeys}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listKeys`, 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 @@ -1074,7 +1088,18 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @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 + * [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. 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.listKeysAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listKeysAsync( request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, @@ -1200,9 +1225,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { } /** - * 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-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index eb60a7ee472..ac0146b870b 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "abf59a948ff90aead2b5e43d85edcefab92ec534" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb", - "internalRef": "327369997" + "remote": "git@github.com:googleapis/nodejs-recaptcha-enterprise.git", + "sha": "630d2aa2d0ac82055ce137c874bcf5998e3c4474" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ba9918cd22874245b55734f57470c719b577e591" + "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" } } ], @@ -96,6 +88,7 @@ "README.md", "api-extractor.json", "linkinator.config.json", + "package-lock.json.41252956", "protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto", "protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto", "protos/protos.d.ts", @@ -103,6 +96,7 @@ "protos/protos.json", "renovate.json", "samples/README.md", + "samples/package-lock.json.3671243477", "src/index.ts", "src/v1/index.ts", "src/v1/recaptcha_enterprise_service_client.ts", diff --git a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts index cc5f3b1a188..84f769af1ea 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts @@ -18,8 +18,17 @@ import {RecaptchaEnterpriseServiceClient} from '@google-cloud/recaptcha-enterprise'; +// check that the client class type name can be used +function doStuffWithRecaptchaEnterpriseServiceClient( + client: RecaptchaEnterpriseServiceClient +) { + client.close(); +} + function main() { - new RecaptchaEnterpriseServiceClient(); + // check that the client instance can be created + const recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + doStuffWithRecaptchaEnterpriseServiceClient(recaptchaEnterpriseServiceClient); } main(); diff --git a/packages/google-cloud-recaptchaenterprise/system-test/install.ts b/packages/google-cloud-recaptchaenterprise/system-test/install.ts index 4c1ba3eb79a..39d90f771de 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/install.ts +++ b/packages/google-cloud-recaptchaenterprise/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 f02e8ad2bb81b8cf54319d658862cf4cb090ab9d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2020 12:59:22 -0800 Subject: [PATCH 152/253] chore: release 2.0.2 (#223) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 6b3fbf36410..7adde3540a1 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [2.0.2](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.0.1...v2.0.2) (2020-11-06) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#222](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/222)) ([807b692](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/807b6925ce52d14b3e7b2afa75fc54da805ce604)) + ### [2.0.1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.0.0...v2.0.1) (2020-07-06) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index a2e6a69a5ac..ea976e89f18 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.0.1", + "version": "2.0.2", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 95adcddd592..936c1b50849 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.0.1" + "@google-cloud/recaptcha-enterprise": "^2.0.2" }, "devDependencies": { "chai": "^4.2.0", From cb654d1ea3e6d117ca32897edef0821049dd1502 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 11 Nov 2020 13:06:13 -0800 Subject: [PATCH 153/253] build: add RecaptchaEnterpriseServiceClient type (#221) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/7a8e5b47-7aa7-4639-945d-d671b724d052/targets - [ ] To automatically regenerate this PR, check this box. --- .../google-cloud-recaptchaenterprise/synth.metadata | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index ac0146b870b..7164de1444f 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -3,10 +3,18 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-recaptcha-enterprise.git", + "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", "sha": "630d2aa2d0ac82055ce137c874bcf5998e3c4474" } }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb", + "internalRef": "327369997" + } + }, { "git": { "name": "synthtool", From b4365db8f2d963118b56bb274fd5fb2b6e35b562 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 23 Nov 2020 13:31:28 -0800 Subject: [PATCH 154/253] fix(browser): check for fetch on window (#226) --- .../protos/protos.json | 146 ++++++++++++++++-- .../v1/recaptcha_enterprise_service_client.ts | 90 ++++++----- ...tcha_enterprise_service_v1_beta1_client.ts | 90 ++++++----- .../synth.metadata | 8 +- 4 files changed, 233 insertions(+), 101 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index 199ef8544d8..3c33b8dd8bf 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -31,7 +31,18 @@ "(google.api.http).post": "/v1/{parent=projects/*}/assessments", "(google.api.http).body": "assessment", "(google.api.method_signature)": "parent,assessment" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/assessments", + "body": "assessment" + } + }, + { + "(google.api.method_signature)": "parent,assessment" + } + ] }, "AnnotateAssessment": { "requestType": "AnnotateAssessmentRequest", @@ -40,7 +51,18 @@ "(google.api.http).post": "/v1/{name=projects/*/assessments/*}:annotate", "(google.api.http).body": "*", "(google.api.method_signature)": "name,annotation" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/assessments/*}:annotate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,annotation" + } + ] }, "CreateKey": { "requestType": "CreateKeyRequest", @@ -48,21 +70,43 @@ "options": { "(google.api.http).post": "/v1/{parent=projects/*}/keys", "(google.api.http).body": "key" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/keys", + "body": "key" + } + } + ] }, "ListKeys": { "requestType": "ListKeysRequest", "responseType": "ListKeysResponse", "options": { "(google.api.http).get": "/v1/{parent=projects/*}/keys" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/keys" + } + } + ] }, "GetKey": { "requestType": "GetKeyRequest", "responseType": "Key", "options": { "(google.api.http).get": "/v1/{name=projects/*/keys/*}" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/keys/*}" + } + } + ] }, "UpdateKey": { "requestType": "UpdateKeyRequest", @@ -70,14 +114,29 @@ "options": { "(google.api.http).patch": "/v1/{key.name=projects/*/keys/*}", "(google.api.http).body": "key" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{key.name=projects/*/keys/*}", + "body": "key" + } + } + ] }, "DeleteKey": { "requestType": "DeleteKeyRequest", "responseType": "google.protobuf.Empty", "options": { "(google.api.http).delete": "/v1/{name=projects/*/keys/*}" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/keys/*}" + } + } + ] } } }, @@ -509,7 +568,18 @@ "(google.api.http).post": "/v1beta1/{parent=projects/*}/assessments", "(google.api.http).body": "assessment", "(google.api.method_signature)": "parent,assessment" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*}/assessments", + "body": "assessment" + } + }, + { + "(google.api.method_signature)": "parent,assessment" + } + ] }, "AnnotateAssessment": { "requestType": "AnnotateAssessmentRequest", @@ -518,7 +588,18 @@ "(google.api.http).post": "/v1beta1/{name=projects/*/assessments/*}:annotate", "(google.api.http).body": "*", "(google.api.method_signature)": "name,annotation" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/assessments/*}:annotate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,annotation" + } + ] }, "CreateKey": { "requestType": "CreateKeyRequest", @@ -526,21 +607,43 @@ "options": { "(google.api.http).post": "/v1beta1/{parent=projects/*}/keys", "(google.api.http).body": "key" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*}/keys", + "body": "key" + } + } + ] }, "ListKeys": { "requestType": "ListKeysRequest", "responseType": "ListKeysResponse", "options": { "(google.api.http).get": "/v1beta1/{parent=projects/*}/keys" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*}/keys" + } + } + ] }, "GetKey": { "requestType": "GetKeyRequest", "responseType": "Key", "options": { "(google.api.http).get": "/v1beta1/{name=projects/*/keys/*}" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/keys/*}" + } + } + ] }, "UpdateKey": { "requestType": "UpdateKeyRequest", @@ -548,14 +651,29 @@ "options": { "(google.api.http).patch": "/v1beta1/{key.name=projects/*/keys/*}", "(google.api.http).body": "key" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{key.name=projects/*/keys/*}", + "body": "key" + } + } + ] }, "DeleteKey": { "requestType": "DeleteKeyRequest", "responseType": "google.protobuf.Empty", "options": { "(google.api.http).delete": "/v1beta1/{name=projects/*/keys/*}" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/keys/*}" + } + } + ] } } }, diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index 7476f454049..fac42709f49 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_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, @@ -30,6 +31,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/v1/recaptcha_enterprise_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './recaptcha_enterprise_service_client_config.json'; const version = require('../../../package.json').version; @@ -83,9 +89,9 @@ export class RecaptchaEnterpriseServiceClient { * 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` @@ -99,7 +105,9 @@ export class RecaptchaEnterpriseServiceClient { 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. @@ -318,7 +326,7 @@ export class RecaptchaEnterpriseServiceClient { // ------------------- createAssessment( request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.recaptchaenterprise.v1.IAssessment, @@ -331,7 +339,7 @@ export class RecaptchaEnterpriseServiceClient { >; createAssessment( request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.recaptchaenterprise.v1.IAssessment, | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest @@ -373,7 +381,7 @@ export class RecaptchaEnterpriseServiceClient { createAssessment( request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.recaptchaenterprise.v1.IAssessment, | protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest @@ -399,12 +407,12 @@ export class RecaptchaEnterpriseServiceClient { ] > | 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 || {}; @@ -419,7 +427,7 @@ export class RecaptchaEnterpriseServiceClient { } annotateAssessment( request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, @@ -432,7 +440,7 @@ export class RecaptchaEnterpriseServiceClient { >; annotateAssessment( request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest @@ -475,7 +483,7 @@ export class RecaptchaEnterpriseServiceClient { annotateAssessment( request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentResponse, | protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest @@ -501,12 +509,12 @@ export class RecaptchaEnterpriseServiceClient { ] > | 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 || {}; @@ -521,7 +529,7 @@ export class RecaptchaEnterpriseServiceClient { } createKey( request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.recaptchaenterprise.v1.IKey, @@ -531,7 +539,7 @@ export class RecaptchaEnterpriseServiceClient { >; createKey( request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.recaptchaenterprise.v1.IKey, | protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest @@ -573,7 +581,7 @@ export class RecaptchaEnterpriseServiceClient { createKey( request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.recaptchaenterprise.v1.IKey, | protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest @@ -596,12 +604,12 @@ export class RecaptchaEnterpriseServiceClient { ] > | 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 || {}; @@ -616,7 +624,7 @@ export class RecaptchaEnterpriseServiceClient { } getKey( request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.recaptchaenterprise.v1.IKey, @@ -626,7 +634,7 @@ export class RecaptchaEnterpriseServiceClient { >; getKey( request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.recaptchaenterprise.v1.IKey, | protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest @@ -666,7 +674,7 @@ export class RecaptchaEnterpriseServiceClient { getKey( request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.recaptchaenterprise.v1.IKey, | protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest @@ -689,12 +697,12 @@ export class RecaptchaEnterpriseServiceClient { ] > | 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 || {}; @@ -709,7 +717,7 @@ export class RecaptchaEnterpriseServiceClient { } updateKey( request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.recaptchaenterprise.v1.IKey, @@ -719,7 +727,7 @@ export class RecaptchaEnterpriseServiceClient { >; updateKey( request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.recaptchaenterprise.v1.IKey, | protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest @@ -761,7 +769,7 @@ export class RecaptchaEnterpriseServiceClient { updateKey( request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.recaptchaenterprise.v1.IKey, | protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest @@ -784,12 +792,12 @@ export class RecaptchaEnterpriseServiceClient { ] > | 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 || {}; @@ -804,7 +812,7 @@ export class RecaptchaEnterpriseServiceClient { } deleteKey( request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -814,7 +822,7 @@ export class RecaptchaEnterpriseServiceClient { >; deleteKey( request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest @@ -854,7 +862,7 @@ export class RecaptchaEnterpriseServiceClient { deleteKey( request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest @@ -877,12 +885,12 @@ export class RecaptchaEnterpriseServiceClient { ] > | 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 || {}; @@ -898,7 +906,7 @@ export class RecaptchaEnterpriseServiceClient { listKeys( request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.recaptchaenterprise.v1.IKey[], @@ -908,7 +916,7 @@ export class RecaptchaEnterpriseServiceClient { >; listKeys( request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, | protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse @@ -957,7 +965,7 @@ export class RecaptchaEnterpriseServiceClient { listKeys( request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, | protos.google.cloud.recaptchaenterprise.v1.IListKeysResponse @@ -980,12 +988,12 @@ export class RecaptchaEnterpriseServiceClient { ] > | 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 || {}; @@ -1026,7 +1034,7 @@ export class RecaptchaEnterpriseServiceClient { */ listKeysStream( request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1079,7 +1087,7 @@ export class RecaptchaEnterpriseServiceClient { */ listKeysAsync( request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index c02a8bf4f19..8e3b7708c16 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_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, @@ -30,6 +31,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/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './recaptcha_enterprise_service_v1_beta1_client_config.json'; const version = require('../../../package.json').version; @@ -83,9 +89,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * 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` @@ -99,7 +105,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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. @@ -318,7 +326,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // ------------------- createAssessment( request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, @@ -331,7 +339,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { >; createAssessment( request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest @@ -373,7 +381,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { createAssessment( request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IAssessment, | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest @@ -399,12 +407,12 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ] > | 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 || {}; @@ -419,7 +427,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { } annotateAssessment( request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, @@ -432,7 +440,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { >; annotateAssessment( request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest @@ -475,7 +483,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { annotateAssessment( request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentResponse, | protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest @@ -501,12 +509,12 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ] > | 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 || {}; @@ -521,7 +529,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { } createKey( request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.recaptchaenterprise.v1beta1.IKey, @@ -534,7 +542,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { >; createKey( request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IKey, | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest @@ -576,7 +584,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { createKey( request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IKey, | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest @@ -602,12 +610,12 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ] > | 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 || {}; @@ -622,7 +630,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { } getKey( request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.recaptchaenterprise.v1beta1.IKey, @@ -635,7 +643,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { >; getKey( request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IKey, | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest @@ -675,7 +683,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { getKey( request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IKey, | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest @@ -701,12 +709,12 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ] > | 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 || {}; @@ -721,7 +729,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { } updateKey( request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.recaptchaenterprise.v1beta1.IKey, @@ -734,7 +742,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { >; updateKey( request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IKey, | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest @@ -776,7 +784,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { updateKey( request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.recaptchaenterprise.v1beta1.IKey, | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest @@ -802,12 +810,12 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ] > | 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 || {}; @@ -822,7 +830,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { } deleteKey( request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -835,7 +843,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { >; deleteKey( request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest @@ -875,7 +883,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { deleteKey( request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest @@ -901,12 +909,12 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ] > | 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 || {}; @@ -922,7 +930,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { listKeys( request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.recaptchaenterprise.v1beta1.IKey[], @@ -932,7 +940,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { >; listKeys( request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse @@ -981,7 +989,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { listKeys( request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse @@ -1004,12 +1012,12 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ] > | 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 || {}; @@ -1050,7 +1058,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { */ listKeysStream( request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1103,7 +1111,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { */ listKeysAsync( request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 7164de1444f..5c370ce8570 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "630d2aa2d0ac82055ce137c874bcf5998e3c4474" + "sha": "3c20aed6c6f2baf15cd6bbe3fdb1dfe2ba8141da" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb", - "internalRef": "327369997" + "sha": "5587028631d4d743fd906c4eb4e4e4649a7ee5ce", + "internalRef": "343187793" } }, { @@ -96,7 +96,6 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.41252956", "protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto", "protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto", "protos/protos.d.ts", @@ -104,7 +103,6 @@ "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.3671243477", "src/index.ts", "src/v1/index.ts", "src/v1/recaptcha_enterprise_service_client.ts", From 1308fd0cb5e02d82410aeeeb6a53a4dbb3e8957c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Nov 2020 08:34:49 -0800 Subject: [PATCH 155/253] docs: spelling correction for "targetting" (#228) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/75dad5cb-c926-42f9-97b9-e333e129c3c3/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/15013eff642a7e7e855aed5a29e6e83c39beba2a --- .../README.md | 2 +- .../synth.metadata | 81 +------------------ 2 files changed, 3 insertions(+), 80 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index bc5912ed13a..798e3d4f262 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -107,7 +107,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-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 5c370ce8570..70668ac5a66 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "3c20aed6c6f2baf15cd6bbe3fdb1dfe2ba8141da" + "sha": "8eb79dd2b9f1eb7d4848aef63bf3bf236928fc67" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" + "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" } } ], @@ -42,82 +42,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/recaptchaenterprise/v1/recaptchaenterprise.proto", - "protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto", - "protos/protos.d.ts", - "protos/protos.js", - "protos/protos.json", - "renovate.json", - "samples/README.md", - "src/index.ts", - "src/v1/index.ts", - "src/v1/recaptcha_enterprise_service_client.ts", - "src/v1/recaptcha_enterprise_service_client_config.json", - "src/v1/recaptcha_enterprise_service_proto_list.json", - "src/v1beta1/index.ts", - "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts", - "src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json", - "src/v1beta1/recaptcha_enterprise_service_v1_beta1_proto_list.json", - "system-test/fixtures/sample/src/index.js", - "system-test/fixtures/sample/src/index.ts", - "system-test/install.ts", - "test/gapic_recaptcha_enterprise_service_v1.ts", - "test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts", - "tsconfig.json", - "webpack.config.js" ] } \ No newline at end of file From 00ab16602d20df9cbd9358c21ae5cae372e38c79 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2020 19:40:41 +0000 Subject: [PATCH 156/253] chore: release 2.0.3 (#227) :robot: I have created a release \*beep\* \*boop\* --- ### [2.0.3](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.0.2...v2.0.3) (2020-11-25) ### Bug Fixes * **browser:** check for fetch on window ([#226](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/226)) ([8eb79dd](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/8eb79dd2b9f1eb7d4848aef63bf3bf236928fc67)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 7adde3540a1..7472d2423ab 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [2.0.3](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.0.2...v2.0.3) (2020-11-25) + + +### Bug Fixes + +* **browser:** check for fetch on window ([#226](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/226)) ([8eb79dd](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/8eb79dd2b9f1eb7d4848aef63bf3bf236928fc67)) + ### [2.0.2](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.0.1...v2.0.2) (2020-11-06) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index ea976e89f18..cf99bc2f5d3 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.0.2", + "version": "2.0.3", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 936c1b50849..0e338fb9439 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.0.2" + "@google-cloud/recaptcha-enterprise": "^2.0.3" }, "devDependencies": { "chai": "^4.2.0", From fd716e70a3bed3a0888910bca25a31dbb1898f04 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 4 Dec 2020 08:58:26 -0800 Subject: [PATCH 157/253] chore: generate GAPIC metadata JSON file (#229) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/15d2fc95-8ec0-48d8-8ade-d188b4874078/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 345596855 Source-Link: https://github.com/googleapis/googleapis/commit/d189e871205fea665a9648f7c4676f027495ccaf --- .../src/v1/gapic_metadata.json | 97 +++++++++++++++++++ .../src/v1beta1/gapic_metadata.json | 97 +++++++++++++++++++ .../synth.metadata | 6 +- 3 files changed, 197 insertions(+), 3 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json create mode 100644 packages/google-cloud-recaptchaenterprise/src/v1beta1/gapic_metadata.json diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json b/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..182faf09e97 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/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.recaptchaenterprise.v1", + "libraryPackage": "@google-cloud/recaptcha-enterprise", + "services": { + "RecaptchaEnterpriseService": { + "clients": { + "grpc": { + "libraryClient": "RecaptchaEnterpriseServiceClient", + "rpcs": { + "CreateAssessment": { + "methods": [ + "createAssessment" + ] + }, + "AnnotateAssessment": { + "methods": [ + "annotateAssessment" + ] + }, + "CreateKey": { + "methods": [ + "createKey" + ] + }, + "GetKey": { + "methods": [ + "getKey" + ] + }, + "UpdateKey": { + "methods": [ + "updateKey" + ] + }, + "DeleteKey": { + "methods": [ + "deleteKey" + ] + }, + "ListKeys": { + "methods": [ + "listKeys", + "listKeysStream", + "listKeysAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RecaptchaEnterpriseServiceClient", + "rpcs": { + "CreateAssessment": { + "methods": [ + "createAssessment" + ] + }, + "AnnotateAssessment": { + "methods": [ + "annotateAssessment" + ] + }, + "CreateKey": { + "methods": [ + "createKey" + ] + }, + "GetKey": { + "methods": [ + "getKey" + ] + }, + "UpdateKey": { + "methods": [ + "updateKey" + ] + }, + "DeleteKey": { + "methods": [ + "deleteKey" + ] + }, + "ListKeys": { + "methods": [ + "listKeys", + "listKeysStream", + "listKeysAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/gapic_metadata.json b/packages/google-cloud-recaptchaenterprise/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..7a2089e9920 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/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.recaptchaenterprise.v1beta1", + "libraryPackage": "@google-cloud/recaptcha-enterprise", + "services": { + "RecaptchaEnterpriseServiceV1Beta1": { + "clients": { + "grpc": { + "libraryClient": "RecaptchaEnterpriseServiceV1Beta1Client", + "rpcs": { + "CreateAssessment": { + "methods": [ + "createAssessment" + ] + }, + "AnnotateAssessment": { + "methods": [ + "annotateAssessment" + ] + }, + "CreateKey": { + "methods": [ + "createKey" + ] + }, + "GetKey": { + "methods": [ + "getKey" + ] + }, + "UpdateKey": { + "methods": [ + "updateKey" + ] + }, + "DeleteKey": { + "methods": [ + "deleteKey" + ] + }, + "ListKeys": { + "methods": [ + "listKeys", + "listKeysStream", + "listKeysAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RecaptchaEnterpriseServiceV1Beta1Client", + "rpcs": { + "CreateAssessment": { + "methods": [ + "createAssessment" + ] + }, + "AnnotateAssessment": { + "methods": [ + "annotateAssessment" + ] + }, + "CreateKey": { + "methods": [ + "createKey" + ] + }, + "GetKey": { + "methods": [ + "getKey" + ] + }, + "UpdateKey": { + "methods": [ + "updateKey" + ] + }, + "DeleteKey": { + "methods": [ + "deleteKey" + ] + }, + "ListKeys": { + "methods": [ + "listKeys", + "listKeysStream", + "listKeysAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 70668ac5a66..86e431c9f87 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "8eb79dd2b9f1eb7d4848aef63bf3bf236928fc67" + "sha": "ec3c7200c339820a65a65365c9af44a2ee13b8d6" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5587028631d4d743fd906c4eb4e4e4649a7ee5ce", - "internalRef": "343187793" + "sha": "d189e871205fea665a9648f7c4676f027495ccaf", + "internalRef": "345596855" } }, { From 8dd21af702f687e1a1d0708d6049989e10518d00 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 22 Dec 2020 11:44:31 -0800 Subject: [PATCH 158/253] docs: add instructions for authenticating for system tests (#232) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/e893c041-f585-44a0-8a3b-f1f3eee08f43/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/363fe305e9ce34a6cd53951c6ee5f997094b54ee --- .../CONTRIBUTING.md | 15 +++++++++++++-- .../google-cloud-recaptchaenterprise/README.md | 3 +-- .../synth.metadata | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CONTRIBUTING.md b/packages/google-cloud-recaptchaenterprise/CONTRIBUTING.md index f6c4cf010e3..3f52f24fcca 100644 --- a/packages/google-cloud-recaptchaenterprise/CONTRIBUTING.md +++ b/packages/google-cloud-recaptchaenterprise/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 Google Cloud reCAPTCHA Enterprise 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=recaptchaenterprise.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index 798e3d4f262..7221628d456 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -89,8 +89,7 @@ async function main(projectNumber) { ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-recaptcha-enterprise/tree/master/samples) directory. The samples' `README.md` -has instructions for running the samples. +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-recaptcha-enterprise/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-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 86e431c9f87..8accca8048f 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "ec3c7200c339820a65a65365c9af44a2ee13b8d6" + "sha": "4d19887174a68c8afb401294274cd3df17a6bb53" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" + "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" } } ], From 85002cd7d44540c2db5cf972a02f9a534059c54d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 1 Jan 2021 03:04:48 -0800 Subject: [PATCH 159/253] chore: update license headers (#233) --- packages/google-cloud-recaptchaenterprise/.jsdoc.js | 4 ++-- packages/google-cloud-recaptchaenterprise/protos/protos.d.ts | 2 +- packages/google-cloud-recaptchaenterprise/protos/protos.js | 2 +- packages/google-cloud-recaptchaenterprise/src/v1/index.ts | 2 +- .../src/v1/recaptcha_enterprise_service_client.ts | 2 +- .../google-cloud-recaptchaenterprise/src/v1beta1/index.ts | 2 +- .../v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts | 2 +- packages/google-cloud-recaptchaenterprise/synth.metadata | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../google-cloud-recaptchaenterprise/system-test/install.ts | 2 +- .../test/gapic_recaptcha_enterprise_service_v1.ts | 2 +- .../gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.jsdoc.js b/packages/google-cloud-recaptchaenterprise/.jsdoc.js index 9299cd63492..b6e3bb50897 100644 --- a/packages/google-cloud-recaptchaenterprise/.jsdoc.js +++ b/packages/google-cloud-recaptchaenterprise/.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/recaptcha-enterprise', diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 97ece981f7b..43f5580e340 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index a66a777bd69..7fdaf60e02e 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/src/v1/index.ts b/packages/google-cloud-recaptchaenterprise/src/v1/index.ts index 3759da4ef99..2159903e2fe 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/index.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/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-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index fac42709f49..f2f7e09b04d 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_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-recaptchaenterprise/src/v1beta1/index.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/index.ts index 1361289df05..6314ef606cf 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/index.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/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-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 8e3b7708c16..6797fd4037f 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_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-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 8accca8048f..9537cbe0767 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "4d19887174a68c8afb401294274cd3df17a6bb53" + "sha": "02967aa0ec2bd117239e5600becdde336f26014c" } }, { diff --git a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js index d8d9e2cdd6d..b5aead0cc2c 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts index 84f769af1ea..c90f525efe6 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/system-test/install.ts b/packages/google-cloud-recaptchaenterprise/system-test/install.ts index 39d90f771de..d2d61c0396f 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/install.ts +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index 64ac17a1eed..6cf3b169775 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.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-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts index 2023e4f8503..e303dc1295d 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.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 1e1094f85f03578fd4b38e8ff8ef4ec187c11eb3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 7 Jan 2021 11:27:42 -0800 Subject: [PATCH 160/253] feat: introduces style enumeration (#234) --- .../protos/protos.d.ts | 12 +++ .../protos/protos.js | 78 ++++++++++++++++++- .../protos/protos.json | 13 +++- .../synth.metadata | 2 +- 4 files changed, 102 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 43f5580e340..0cdc42b55f1 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -4160,6 +4160,9 @@ export namespace google { /** ResourceDescriptor singular */ singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); } /** Represents a ResourceDescriptor. */ @@ -4189,6 +4192,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 @@ -4268,6 +4274,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-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 7fdaf60e02e..a598f619f73 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -9818,6 +9818,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 */ /** @@ -9830,6 +9831,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) @@ -9884,6 +9886,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 @@ -9921,6 +9931,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; }; @@ -9975,6 +9991,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; @@ -10038,6 +10064,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; }; @@ -10082,6 +10120,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; }; @@ -10098,8 +10153,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 = ""; @@ -10122,6 +10179,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; }; @@ -10152,6 +10214,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-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index 3c33b8dd8bf..a41c2f94db9 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -1234,6 +1234,11 @@ "singular": { "type": "string", "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 } }, "nested": { @@ -1243,6 +1248,12 @@ "ORIGINALLY_SINGLE_PATTERN": 1, "FUTURE_MULTI_PATTERN": 2 } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } } } }, @@ -1262,7 +1273,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-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 9537cbe0767..7891121b768 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "02967aa0ec2bd117239e5600becdde336f26014c" + "sha": "537215ac271e7109183098e27e418413cd492230" } }, { From 56f86995a0a6f20c5c8d6cc29b5aebdf6d341378 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 7 Jan 2021 16:50:40 -0800 Subject: [PATCH 161/253] chore: release 2.1.0 (#235) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 7472d2423ab..1c34d1d867e 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [2.1.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.0.3...v2.1.0) (2021-01-07) + + +### Features + +* introduces style enumeration ([#234](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/234)) ([35f1bb6](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/35f1bb6de0d16a10cc9e18ab7cf5aadd332bd0d8)) + ### [2.0.3](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.0.2...v2.0.3) (2020-11-25) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index cf99bc2f5d3..04f19d5f7e9 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.0.3", + "version": "2.1.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 0e338fb9439..80a75592104 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.0.3" + "@google-cloud/recaptcha-enterprise": "^2.1.0" }, "devDependencies": { "chai": "^4.2.0", From d12c776256bda235473a4f029f49c33d7bde0d61 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 27 Jan 2021 08:42:27 -0800 Subject: [PATCH 162/253] refactor(nodejs): move build cop to flakybot (#237) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/6e88bfd3-7b66-4bc8-a7e5-10642f2428f5/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/57c23fa5705499a4181095ced81f0ee0933b64f6 --- packages/google-cloud-recaptchaenterprise/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 7891121b768..517c13ee89a 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "537215ac271e7109183098e27e418413cd492230" + "sha": "88725b0a6b65969f43bf108533f3cb01d5915632" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" + "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" } } ], From ca0bf58aef47db9d236de9366489840910fe22bb Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Feb 2021 17:58:22 -0800 Subject: [PATCH 163/253] build: adds UNORDERED_LIST enum (#238) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/78b836b1-707d-42b7-b42b-20337986af9f/targets - [ ] To automatically regenerate this PR, check this box. --- .../google-cloud-recaptchaenterprise/protos/protos.d.ts | 3 ++- packages/google-cloud-recaptchaenterprise/protos/protos.js | 7 +++++++ .../google-cloud-recaptchaenterprise/protos/protos.json | 3 ++- packages/google-cloud-recaptchaenterprise/synth.metadata | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 0cdc42b55f1..4d7eee28855 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -4137,7 +4137,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-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index a598f619f73..63136e19eb5 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -9794,6 +9794,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); @@ -9803,6 +9804,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; })(); @@ -15970,6 +15972,7 @@ case 3: case 4: case 5: + case 6: break; } } @@ -16070,6 +16073,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-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index a41c2f94db9..cfe679b002b 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -1189,7 +1189,8 @@ "REQUIRED": 2, "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, - "IMMUTABLE": 5 + "IMMUTABLE": 5, + "UNORDERED_LIST": 6 } }, "resourceReference": { diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 517c13ee89a..8a58ee8797c 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "88725b0a6b65969f43bf108533f3cb01d5915632" + "sha": "6a09b1c53e09dbba6ee756a8c4e53339fdb886aa" } }, { From a693fef86bfcef7fb90b15b621b18f39132631bf Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 7 Mar 2021 09:00:18 -0800 Subject: [PATCH 164/253] build: update gapic-generator-typescript to v1.2.10. (#239) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/7de5fca1-c450-46ed-b4bd-ed0a7f991ee4/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 361273630 Source-Link: https://github.com/googleapis/googleapis/commit/5477122b3e8037a1dc5bc920536158edbd151dc4 --- packages/google-cloud-recaptchaenterprise/synth.metadata | 6 +++--- packages/google-cloud-recaptchaenterprise/webpack.config.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata index 8a58ee8797c..ae9135ca968 100644 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ b/packages/google-cloud-recaptchaenterprise/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "6a09b1c53e09dbba6ee756a8c4e53339fdb886aa" + "sha": "2f9b3ec02f223834aaaa2427aee441eeba284718" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d189e871205fea665a9648f7c4676f027495ccaf", - "internalRef": "345596855" + "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", + "internalRef": "361273630" } }, { diff --git a/packages/google-cloud-recaptchaenterprise/webpack.config.js b/packages/google-cloud-recaptchaenterprise/webpack.config.js index 4c93b13d835..8a8caae6493 100644 --- a/packages/google-cloud-recaptchaenterprise/webpack.config.js +++ b/packages/google-cloud-recaptchaenterprise/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 9b233cbfe0f1d832811f32ba48178b3bd256e786 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Thu, 18 Mar 2021 14:47:21 -0700 Subject: [PATCH 165/253] chore: migrate to owl bot (#241) --- .../.github/.OwlBot.yaml | 23 ++++++++++ .../.repo-metadata.json | 15 +++--- .../synth.metadata | 46 ------------------- .../google-cloud-recaptchaenterprise/synth.py | 39 ---------------- 4 files changed, 31 insertions(+), 92 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/.github/.OwlBot.yaml delete mode 100644 packages/google-cloud-recaptchaenterprise/synth.metadata delete mode 100644 packages/google-cloud-recaptchaenterprise/synth.py diff --git a/packages/google-cloud-recaptchaenterprise/.github/.OwlBot.yaml b/packages/google-cloud-recaptchaenterprise/.github/.OwlBot.yaml new file mode 100644 index 00000000000..4c123611662 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/.github/.OwlBot.yaml @@ -0,0 +1,23 @@ +# 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/recaptchaenterprise/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + diff --git a/packages/google-cloud-recaptchaenterprise/.repo-metadata.json b/packages/google-cloud-recaptchaenterprise/.repo-metadata.json index 0b9b6d62a99..0423ef0494b 100644 --- a/packages/google-cloud-recaptchaenterprise/.repo-metadata.json +++ b/packages/google-cloud-recaptchaenterprise/.repo-metadata.json @@ -1,13 +1,14 @@ { - "name": "recaptcha-enterprise", - "name_pretty": "Google Cloud reCAPTCHA Enterprise", - "product_documentation": "https://cloud.google.com/recaptcha-enterprise/docs/", "client_documentation": "https://googleapis.dev/nodejs/recaptcha-enterprise/latest", - "issue_tracker": "", + "api_id": "recaptchaenterprise.googleapis.com", + "distribution_name": "@google-cloud/recaptcha-enterprise", "release_level": "ga", + "default_version": "v1", "language": "nodejs", + "name_pretty": "Google Cloud reCAPTCHA Enterprise", "repo": "googleapis/nodejs-recaptcha-enterprise", - "distribution_name": "@google-cloud/recaptcha-enterprise", - "api_id": "recaptchaenterprise.googleapis.com", - "requires_billing": true + "product_documentation": "https://cloud.google.com/recaptcha-enterprise/docs/", + "requires_billing": true, + "name": "recaptcha-enterprise", + "issue_tracker": "" } diff --git a/packages/google-cloud-recaptchaenterprise/synth.metadata b/packages/google-cloud-recaptchaenterprise/synth.metadata deleted file mode 100644 index ae9135ca968..00000000000 --- a/packages/google-cloud-recaptchaenterprise/synth.metadata +++ /dev/null @@ -1,46 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git", - "sha": "2f9b3ec02f223834aaaa2427aee441eeba284718" - } - }, - { - "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": "57c23fa5705499a4181095ced81f0ee0933b64f6" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "recaptchaenterprise", - "apiVersion": "v1beta1", - "language": "nodejs", - "generator": "bazel" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "recaptchaenterprise", - "apiVersion": "v1", - "language": "nodejs", - "generator": "bazel" - } - } - ] -} \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/synth.py b/packages/google-cloud-recaptchaenterprise/synth.py deleted file mode 100644 index 505642335aa..00000000000 --- a/packages/google-cloud-recaptchaenterprise/synth.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.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) - -AUTOSYNTH_MULTIPLE_COMMITS = True - - -# run the gapic generator -gapic = gcp.GAPICBazel() -versions = ['v1beta1', 'v1'] -for version in versions: - library = gapic.node_library('recaptchaenterprise', version) - s.copy(library, excludes=['package.json']) - -# Copy common templates -common_templates = gcp.CommonTemplates() -templates = common_templates.node_library( - source_location='build/src', versions=versions, default_version='v1') -s.copy(templates) - -node.postprocess_gapic_library() From b279e9dbe0a0bf487d6ce157febb12ebdf7d46fb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 23 Mar 2021 17:52:33 +0100 Subject: [PATCH 166/253] chore(deps): update dependency sinon to v10 (#248) [![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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 04f19d5f7e9..f79efaacfb5 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -40,7 +40,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 7ff88ed14b0cce250b1a2a4af9c61c58fceb986c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Apr 2021 23:10:14 +0200 Subject: [PATCH 167/253] chore(deps): update dependency @types/sinon to v10 (#261) [![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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index f79efaacfb5..7358a285c55 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -30,7 +30,7 @@ "devDependencies": { "@types/mocha": "^8.0.0", "@types/node": "^12.0.0", - "@types/sinon": "^9.0.0", + "@types/sinon": "^10.0.0", "c8": "^7.0.0", "gts": "^2.0.0", "jsdoc": "^3.6.2", From e77272d9940371db990def28c9a3fdf964c56709 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Apr 2021 00:56:07 +0200 Subject: [PATCH 168/253] chore(deps): update dependency ts-loader to v9 (#265) [![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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 7358a285c55..a0b6588594a 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -41,7 +41,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 20c3ef45cf85238d5378864913ecf10bd8c512cb Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 6 May 2021 17:50:23 -0700 Subject: [PATCH 169/253] fix(deps): require google-gax v2.12.0 (#270) --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index a0b6588594a..b2c5323988b 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -25,7 +25,7 @@ "reCAPTCHA Enterprise API" ], "dependencies": { - "google-gax": "^2.9.2" + "google-gax": "^2.12.0" }, "devDependencies": { "@types/mocha": "^8.0.0", From 7c3e059bd7c38d545f8db373463b632749034568 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:00:46 +0000 Subject: [PATCH 170/253] chore: new owl bot post processor docker image (#272) gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f --- .../protos/protos.d.ts | 10 +- .../protos/protos.js | 20 +- .../v1/recaptcha_enterprise_service_client.ts | 98 ++-- ...tcha_enterprise_service_v1_beta1_client.ts | 98 ++-- .../system-test/fixtures/sample/src/index.js | 3 +- .../system-test/fixtures/sample/src/index.ts | 3 +- .../gapic_recaptcha_enterprise_service_v1.ts | 459 ++++++++-------- ...cha_enterprise_service_v1_beta1_v1beta1.ts | 499 +++++++++--------- 8 files changed, 608 insertions(+), 582 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 4d7eee28855..b4becef0b67 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -3934,19 +3934,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-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 63136e19eb5..85a4d4c9cf9 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -9155,43 +9155,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-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index f2f7e09b04d..b77fb281d0e 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -246,13 +246,14 @@ export class RecaptchaEnterpriseServiceClient { ]; for (const methodName of recaptchaEnterpriseServiceStubMethods) { const callPromise = this.recaptchaEnterpriseServiceStub.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; } @@ -417,11 +418,10 @@ export class RecaptchaEnterpriseServiceClient { 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.createAssessment(request, options, callback); } @@ -519,11 +519,10 @@ export class RecaptchaEnterpriseServiceClient { 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.annotateAssessment(request, options, callback); } @@ -614,11 +613,10 @@ export class RecaptchaEnterpriseServiceClient { 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.createKey(request, options, callback); } @@ -707,11 +705,10 @@ export class RecaptchaEnterpriseServiceClient { 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.getKey(request, options, callback); } @@ -802,11 +799,10 @@ export class RecaptchaEnterpriseServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'key.name': request.key!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'key.name': request.key!.name || '', + }); this.initialize(); return this.innerApiCalls.updateKey(request, options, callback); } @@ -895,11 +891,10 @@ export class RecaptchaEnterpriseServiceClient { 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.deleteKey(request, options, callback); } @@ -998,11 +993,10 @@ export class RecaptchaEnterpriseServiceClient { 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.listKeys(request, options, callback); } @@ -1040,11 +1034,10 @@ export class RecaptchaEnterpriseServiceClient { 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.listKeys.createStream( @@ -1093,17 +1086,16 @@ export class RecaptchaEnterpriseServiceClient { 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.listKeys.asyncIterate( this.innerApiCalls['listKeys'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 6797fd4037f..38fe9793c6e 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -246,13 +246,14 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { ]; for (const methodName of recaptchaEnterpriseServiceV1Beta1StubMethods) { const callPromise = this.recaptchaEnterpriseServiceV1Beta1Stub.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; } @@ -417,11 +418,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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.createAssessment(request, options, callback); } @@ -519,11 +519,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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.annotateAssessment(request, options, callback); } @@ -620,11 +619,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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.createKey(request, options, callback); } @@ -719,11 +717,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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.getKey(request, options, callback); } @@ -820,11 +817,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'key.name': request.key!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'key.name': request.key!.name || '', + }); this.initialize(); return this.innerApiCalls.updateKey(request, options, callback); } @@ -919,11 +915,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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.deleteKey(request, options, callback); } @@ -1022,11 +1017,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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.listKeys(request, options, callback); } @@ -1064,11 +1058,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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.listKeys.createStream( @@ -1117,17 +1110,16 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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.listKeys.asyncIterate( this.innerApiCalls['listKeys'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js index b5aead0cc2c..d686cde343d 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js @@ -20,7 +20,8 @@ const recaptchaenterprise = require('@google-cloud/recaptcha-enterprise'); function main() { - const recaptchaEnterpriseServiceClient = new recaptchaenterprise.RecaptchaEnterpriseServiceClient(); + const recaptchaEnterpriseServiceClient = + new recaptchaenterprise.RecaptchaEnterpriseServiceClient(); } main(); diff --git a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts index c90f525efe6..ad545b0d6fc 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts @@ -27,7 +27,8 @@ function doStuffWithRecaptchaEnterpriseServiceClient( function main() { // check that the client instance can be created - const recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient(); + const recaptchaEnterpriseServiceClient = + new RecaptchaEnterpriseServiceClient(); doStuffWithRecaptchaEnterpriseServiceClient(recaptchaEnterpriseServiceClient); } diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index 6cf3b169775..634f3810699 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf} 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; @@ -136,49 +135,46 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('should create a client with no option', () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ fallback: true, - } - ); + }); assert(client); }); it('has initialize method and supports deferred initialization', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); assert.strictEqual(client.recaptchaEnterpriseServiceStub, undefined); await client.initialize(); assert(client.recaptchaEnterpriseServiceStub); }); it('has close method', () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.close(); }); it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ 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); @@ -187,12 +183,11 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -211,12 +206,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { describe('createAssessment', () => { it('invokes createAssessment without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() @@ -244,12 +240,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes createAssessment without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() @@ -266,9 +263,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Assessment() ); - client.innerApiCalls.createAssessment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createAssessment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createAssessment( request, @@ -294,12 +290,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes createAssessment with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() @@ -329,12 +326,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { describe('annotateAssessment', () => { it('invokes annotateAssessment without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() @@ -351,9 +349,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse() ); - client.innerApiCalls.annotateAssessment = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.annotateAssessment = + stubSimpleCall(expectedResponse); const [response] = await client.annotateAssessment(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -364,12 +361,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes annotateAssessment without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() @@ -386,9 +384,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse() ); - client.innerApiCalls.annotateAssessment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.annotateAssessment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.annotateAssessment( request, @@ -414,12 +411,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes annotateAssessment with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() @@ -449,12 +447,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { describe('createKey', () => { it('invokes createKey without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() @@ -482,12 +481,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes createKey without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() @@ -504,9 +504,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() ); - client.innerApiCalls.createKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createKey( request, @@ -532,12 +531,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes createKey with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() @@ -564,12 +564,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { describe('getKey', () => { it('invokes getKey without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() @@ -597,12 +598,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes getKey without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() @@ -619,9 +621,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() ); - client.innerApiCalls.getKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getKey( request, @@ -647,12 +648,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes getKey with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() @@ -679,12 +681,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { describe('updateKey', () => { it('invokes updateKey without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() @@ -713,12 +716,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes updateKey without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() @@ -736,9 +740,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() ); - client.innerApiCalls.updateKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateKey( request, @@ -764,12 +767,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes updateKey with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() @@ -797,12 +801,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { describe('deleteKey', () => { it('invokes deleteKey without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() @@ -830,12 +835,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes deleteKey without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() @@ -852,9 +858,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteKey( request, @@ -880,12 +885,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes deleteKey with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() @@ -912,12 +918,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { describe('listKeys', () => { it('invokes listKeys without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() @@ -953,12 +960,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes listKeys without error using callback', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() @@ -983,9 +991,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.Key() ), ]; - client.innerApiCalls.listKeys = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listKeys = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listKeys( request, @@ -1011,12 +1018,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes listKeys with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() @@ -1041,12 +1049,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes listKeysStream without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() @@ -1064,9 +1073,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.Key() ), ]; - client.descriptors.page.listKeys.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listKeys.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listKeysStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.recaptchaenterprise.v1.Key[] = []; @@ -1098,12 +1106,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('invokes listKeysStream with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() @@ -1145,12 +1154,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('uses async iteration with listKeys without error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() @@ -1168,9 +1178,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.Key() ), ]; - client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listKeys.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.recaptchaenterprise.v1.IKey[] = []; const iterable = client.listKeysAsync(request); for await (const resource of iterable) { @@ -1190,12 +1199,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); it('uses async iteration with listKeys with error', async () => { - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() @@ -1234,12 +1244,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { project: 'projectValue', assessment: 'assessmentValue', }; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.assessmentPathTemplate.render = sinon .stub() @@ -1285,12 +1296,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { project: 'projectValue', key: 'keyValue', }; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.keyPathTemplate.render = sinon .stub() @@ -1335,12 +1347,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const expectedParameters = { project: 'projectValue', }; - const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.projectPathTemplate.render = sinon .stub() diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts index e303dc1295d..c5c060f6c1c 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf} 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; @@ -137,49 +136,54 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('should create a client with no option', () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - fallback: true, - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + fallback: true, + } + ); assert(client); }); it('has initialize method and supports deferred initialization', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); assert.strictEqual(client.recaptchaEnterpriseServiceV1Beta1Stub, undefined); await client.initialize(); assert(client.recaptchaEnterpriseServiceV1Beta1Stub); }); it('has close method', () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.close(); }); it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + 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); @@ -188,12 +192,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -212,12 +217,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { describe('createAssessment', () => { it('invokes createAssessment without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() @@ -245,12 +251,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes createAssessment without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() @@ -267,9 +274,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.Assessment() ); - client.innerApiCalls.createAssessment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createAssessment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createAssessment( request, @@ -295,12 +301,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes createAssessment with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() @@ -330,12 +337,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { describe('annotateAssessment', () => { it('invokes annotateAssessment without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() @@ -352,9 +360,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse() ); - client.innerApiCalls.annotateAssessment = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.annotateAssessment = + stubSimpleCall(expectedResponse); const [response] = await client.annotateAssessment(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -365,12 +372,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes annotateAssessment without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() @@ -387,9 +395,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse() ); - client.innerApiCalls.annotateAssessment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.annotateAssessment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.annotateAssessment( request, @@ -415,12 +422,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes annotateAssessment with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() @@ -450,12 +458,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { describe('createKey', () => { it('invokes createKey without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() @@ -483,12 +492,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes createKey without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() @@ -505,9 +515,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.Key() ); - client.innerApiCalls.createKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createKey( request, @@ -533,12 +542,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes createKey with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() @@ -565,12 +575,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { describe('getKey', () => { it('invokes getKey without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() @@ -598,12 +609,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes getKey without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() @@ -620,9 +632,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.Key() ); - client.innerApiCalls.getKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getKey( request, @@ -648,12 +659,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes getKey with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() @@ -680,12 +692,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { describe('updateKey', () => { it('invokes updateKey without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() @@ -714,12 +727,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes updateKey without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() @@ -737,9 +751,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.Key() ); - client.innerApiCalls.updateKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateKey( request, @@ -765,12 +778,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes updateKey with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() @@ -798,12 +812,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { describe('deleteKey', () => { it('invokes deleteKey without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() @@ -831,12 +846,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes deleteKey without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() @@ -853,9 +869,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteKey = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteKey = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteKey( request, @@ -881,12 +896,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes deleteKey with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() @@ -913,12 +929,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { describe('listKeys', () => { it('invokes listKeys without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() @@ -954,12 +971,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes listKeys without error using callback', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() @@ -984,9 +1002,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { new protos.google.cloud.recaptchaenterprise.v1beta1.Key() ), ]; - client.innerApiCalls.listKeys = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listKeys = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listKeys( request, @@ -1014,12 +1031,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes listKeys with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() @@ -1044,12 +1062,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes listKeysStream without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() @@ -1067,12 +1086,12 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { new protos.google.cloud.recaptchaenterprise.v1beta1.Key() ), ]; - client.descriptors.page.listKeys.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listKeys.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listKeysStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = []; + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = + []; stream.on( 'data', (response: protos.google.cloud.recaptchaenterprise.v1beta1.Key) => { @@ -1101,12 +1120,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('invokes listKeysStream with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() @@ -1120,7 +1140,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); const stream = client.listKeysStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = []; + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = + []; stream.on( 'data', (response: protos.google.cloud.recaptchaenterprise.v1beta1.Key) => { @@ -1148,12 +1169,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('uses async iteration with listKeys without error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() @@ -1171,10 +1193,10 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { new protos.google.cloud.recaptchaenterprise.v1beta1.Key() ), ]; - client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = []; + client.descriptors.page.listKeys.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = + []; const iterable = client.listKeysAsync(request); for await (const resource of iterable) { responses.push(resource!); @@ -1193,12 +1215,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); it('uses async iteration with listKeys with error', async () => { - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() @@ -1212,7 +1235,8 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); const iterable = client.listKeysAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = []; + const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = + []; for await (const resource of iterable) { responses.push(resource!); } @@ -1237,12 +1261,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { project: 'projectValue', assessment: 'assessmentValue', }; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.assessmentPathTemplate.render = sinon .stub() @@ -1288,12 +1313,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { project: 'projectValue', key: 'keyValue', }; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.keyPathTemplate.render = sinon .stub() @@ -1338,12 +1364,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const expectedParameters = { project: 'projectValue', }; - const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.projectPathTemplate.render = sinon .stub() From e7cdb8ba1759a02a5096c745830e0eb8365e4ff7 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:30 +0000 Subject: [PATCH 171/253] fix: use require() to load JSON protos (#273) 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 --- .../v1/recaptcha_enterprise_service_client.ts | 18 ++---------------- ...ptcha_enterprise_service_v1_beta1_client.ts | 18 ++---------------- 2 files changed, 4 insertions(+), 32 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index b77fb281d0e..e83e50afaf9 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -31,6 +31,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/recaptcha_enterprise_service_client_config.json`. @@ -146,22 +147,7 @@ export class RecaptchaEnterpriseServiceClient { 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. diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 38fe9793c6e..4ee304ca359 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -31,6 +31,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/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json`. @@ -146,22 +147,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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. From a06e5628348eb1d4bc97d388bc527d6bb03c7888 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:26 +0000 Subject: [PATCH 172/253] chore: update gapic-generator-typescript to v1.3.2 (#274) 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 --- .../src/v1/recaptcha_enterprise_service_client.ts | 1 - .../src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index e83e50afaf9..75e142c54f1 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -26,7 +26,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-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 4ee304ca359..5197dcc95e1 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -26,7 +26,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 671daaedd4d85cde150ec8603768325dceb9833a 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:34:37 -0700 Subject: [PATCH 173/253] chore: release 2.1.1 (#271) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 8 ++++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 1c34d1d867e..af74d53decb 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [2.1.1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.0...v2.1.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#270](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/270)) ([ab16a25](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/ab16a254b7da037039a51277495e65bbc983f1c7)) +* use require() to load JSON protos ([#273](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/273)) ([fdbc0fe](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/fdbc0fe7d12c1f70f3f592028c30c455a1526ee2)) + ## [2.1.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.0.3...v2.1.0) (2021-01-07) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index b2c5323988b..08b2a1ee77c 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.1.0", + "version": "2.1.1", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 80a75592104..d35380655fd 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.1.0" + "@google-cloud/recaptcha-enterprise": "^2.1.1" }, "devDependencies": { "chai": "^4.2.0", From 06e855c0ef09a74155457b7a07ff03dc7a15daec Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 21 May 2021 19:04:10 +0200 Subject: [PATCH 174/253] chore(deps): update dependency @types/node to v14 (#277) 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.0.0` -> `^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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 08b2a1ee77c..1753cd1e4b3 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -29,7 +29,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^12.0.0", + "@types/node": "^14.0.0", "@types/sinon": "^10.0.0", "c8": "^7.0.0", "gts": "^2.0.0", From d51fb090c527263ae8955dc1cca320d0563d8974 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 25 May 2021 17:58:15 +0200 Subject: [PATCH 175/253] chore(deps): update dependency sinon to v11 (#278) 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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 1753cd1e4b3..00b16d823b3 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -40,7 +40,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 23360a59c531e39d84e67448b4ae07aeba5559f2 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 176/253] fix: GoogleAdsError missing using generator version after 1.3.0 (#279) [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 --- .../src/v1/recaptcha_enterprise_service_client.ts | 2 ++ .../src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index 75e142c54f1..f2f96b2d598 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -141,6 +141,8 @@ export class RecaptchaEnterpriseServiceClient { } 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-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 5197dcc95e1..7d3bd291ae7 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -141,6 +141,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { } 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 2b90dbb1f7eeb6213c81c2474f294a7c3e63e799 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 25 May 2021 18:18:26 -0400 Subject: [PATCH 177/253] chore: release 2.1.2 (#280) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index af74d53decb..83a66ba1b25 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [2.1.2](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.1...v2.1.2) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#279](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/279)) ([6dc35a7](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/6dc35a7c158b3981d7854969d37ff0ddebbbe6de)) + ### [2.1.1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.0...v2.1.1) (2021-05-12) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 00b16d823b3..a6e8c7e0bc6 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.1.1", + "version": "2.1.2", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index d35380655fd..c5255eeedd1 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.1.1" + "@google-cloud/recaptcha-enterprise": "^2.1.2" }, "devDependencies": { "chai": "^4.2.0", From f9386d11200ab29c00c540bff5d6db3fb11ce55c 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:07 +0000 Subject: [PATCH 178/253] chore: make generate_index_ts() deterministic (#281) 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-recaptchaenterprise/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/index.ts b/packages/google-cloud-recaptchaenterprise/src/index.ts index 48e5381c3e6..021aa3bc199 100644 --- a/packages/google-cloud-recaptchaenterprise/src/index.ts +++ b/packages/google-cloud-recaptchaenterprise/src/index.ts @@ -16,13 +16,13 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** -import * as v1beta1 from './v1beta1'; import * as v1 from './v1'; +import * as v1beta1 from './v1beta1'; const RecaptchaEnterpriseServiceClient = v1.RecaptchaEnterpriseServiceClient; type RecaptchaEnterpriseServiceClient = v1.RecaptchaEnterpriseServiceClient; -export {v1beta1, v1, RecaptchaEnterpriseServiceClient}; -export default {v1beta1, v1, RecaptchaEnterpriseServiceClient}; +export {v1, v1beta1, RecaptchaEnterpriseServiceClient}; +export default {v1, v1beta1, RecaptchaEnterpriseServiceClient}; import * as protos from '../protos/protos'; export {protos}; From 63a6060db270f2889a4f5336b997c061277bf5e6 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Thu, 10 Jun 2021 23:04:21 +0200 Subject: [PATCH 179/253] chore(nodejs): remove api-extractor dependencies (#287) --- packages/google-cloud-recaptchaenterprise/package.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index a6e8c7e0bc6..b536497fcc7 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -44,9 +44,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" }, "scripts": { "lint": "gts check", @@ -62,9 +60,7 @@ "predocs-test": "npm run docs", "prepare": "npm run compile", "prelint": "cd samples; npm link ../; npm install", - "precompile": "gts clean", - "api-extractor": "api-extractor run --local", - "api-documenter": "api-documenter yaml --input-folder=temp" + "precompile": "gts clean" }, "license": "Apache-2.0", "engines": { From a605ccda5454b1fabd7a3561bbcd072100aef20f 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:20:32 +0000 Subject: [PATCH 180/253] fix: make request optional in all cases (#290) ... 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 --- .../v1/recaptcha_enterprise_service_client.ts | 28 +++++++++---------- ...tcha_enterprise_service_v1_beta1_client.ts | 28 +++++++++---------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index f2f96b2d598..b5e383278aa 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -313,7 +313,7 @@ export class RecaptchaEnterpriseServiceClient { // -- Service calls -- // ------------------- createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + request?: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, options?: CallOptions ): Promise< [ @@ -367,7 +367,7 @@ export class RecaptchaEnterpriseServiceClient { * const [response] = await client.createAssessment(request); */ createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, + request?: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -413,7 +413,7 @@ export class RecaptchaEnterpriseServiceClient { return this.innerApiCalls.createAssessment(request, options, callback); } annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + request?: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, options?: CallOptions ): Promise< [ @@ -468,7 +468,7 @@ export class RecaptchaEnterpriseServiceClient { * const [response] = await client.annotateAssessment(request); */ annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, + request?: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -514,7 +514,7 @@ export class RecaptchaEnterpriseServiceClient { return this.innerApiCalls.annotateAssessment(request, options, callback); } createKey( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + request?: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, options?: CallOptions ): Promise< [ @@ -565,7 +565,7 @@ export class RecaptchaEnterpriseServiceClient { * const [response] = await client.createKey(request); */ createKey( - request: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, + request?: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, optionsOrCallback?: | CallOptions | Callback< @@ -608,7 +608,7 @@ export class RecaptchaEnterpriseServiceClient { return this.innerApiCalls.createKey(request, options, callback); } getKey( - request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + request?: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, options?: CallOptions ): Promise< [ @@ -657,7 +657,7 @@ export class RecaptchaEnterpriseServiceClient { * const [response] = await client.getKey(request); */ getKey( - request: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, + request?: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, optionsOrCallback?: | CallOptions | Callback< @@ -700,7 +700,7 @@ export class RecaptchaEnterpriseServiceClient { return this.innerApiCalls.getKey(request, options, callback); } updateKey( - request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + request?: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, options?: CallOptions ): Promise< [ @@ -751,7 +751,7 @@ export class RecaptchaEnterpriseServiceClient { * const [response] = await client.updateKey(request); */ updateKey( - request: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, + request?: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, optionsOrCallback?: | CallOptions | Callback< @@ -794,7 +794,7 @@ export class RecaptchaEnterpriseServiceClient { return this.innerApiCalls.updateKey(request, options, callback); } deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + request?: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, options?: CallOptions ): Promise< [ @@ -843,7 +843,7 @@ export class RecaptchaEnterpriseServiceClient { * const [response] = await client.deleteKey(request); */ deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, + request?: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, optionsOrCallback?: | CallOptions | Callback< @@ -887,7 +887,7 @@ export class RecaptchaEnterpriseServiceClient { } listKeys( - request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, options?: CallOptions ): Promise< [ @@ -945,7 +945,7 @@ export class RecaptchaEnterpriseServiceClient { * for more details and examples. */ listKeys( - request: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, + request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, optionsOrCallback?: | CallOptions | PaginationCallback< diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 7d3bd291ae7..318dc5a5300 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -313,7 +313,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // -- Service calls -- // ------------------- createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + request?: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, options?: CallOptions ): Promise< [ @@ -367,7 +367,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * const [response] = await client.createAssessment(request); */ createAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, + request?: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -413,7 +413,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { return this.innerApiCalls.createAssessment(request, options, callback); } annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + request?: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, options?: CallOptions ): Promise< [ @@ -468,7 +468,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * const [response] = await client.annotateAssessment(request); */ annotateAssessment( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, + request?: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -514,7 +514,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { return this.innerApiCalls.annotateAssessment(request, options, callback); } createKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + request?: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, options?: CallOptions ): Promise< [ @@ -568,7 +568,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * const [response] = await client.createKey(request); */ createKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, + request?: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, optionsOrCallback?: | CallOptions | Callback< @@ -614,7 +614,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { return this.innerApiCalls.createKey(request, options, callback); } getKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + request?: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, options?: CallOptions ): Promise< [ @@ -666,7 +666,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * const [response] = await client.getKey(request); */ getKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, + request?: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, optionsOrCallback?: | CallOptions | Callback< @@ -712,7 +712,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { return this.innerApiCalls.getKey(request, options, callback); } updateKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + request?: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, options?: CallOptions ): Promise< [ @@ -766,7 +766,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * const [response] = await client.updateKey(request); */ updateKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, + request?: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, optionsOrCallback?: | CallOptions | Callback< @@ -812,7 +812,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { return this.innerApiCalls.updateKey(request, options, callback); } deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + request?: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, options?: CallOptions ): Promise< [ @@ -864,7 +864,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * const [response] = await client.deleteKey(request); */ deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, + request?: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, optionsOrCallback?: | CallOptions | Callback< @@ -911,7 +911,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { } listKeys( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, options?: CallOptions ): Promise< [ @@ -969,7 +969,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * for more details and examples. */ listKeys( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, + request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, optionsOrCallback?: | CallOptions | PaginationCallback< From ca99703bc7573fc87680913ec493742db54b6b7f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 25 Jun 2021 09:16:49 -0700 Subject: [PATCH 181/253] chore: release 2.1.3 (#291) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 83a66ba1b25..6b240987ed7 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [2.1.3](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.2...v2.1.3) (2021-06-24) + + +### Bug Fixes + +* make request optional in all cases ([#290](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/290)) ([e18a1d1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/e18a1d1131bed1ce355f9e91811a68b0799ca696)) + ### [2.1.2](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.1...v2.1.2) (2021-05-25) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index b536497fcc7..15cc4ebc3d2 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.1.2", + "version": "2.1.3", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index c5255eeedd1..4e0f1e71748 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.1.2" + "@google-cloud/recaptcha-enterprise": "^2.1.3" }, "devDependencies": { "chai": "^4.2.0", From 905ce30d55520ca1f7ebf54fc272153f8dc91b42 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 30 Jun 2021 12:14:56 -0400 Subject: [PATCH 182/253] fix(deps): google-gax v2.17.0 with mTLS (#294) --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 15cc4ebc3d2..ca64e8a19c9 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -25,7 +25,7 @@ "reCAPTCHA Enterprise API" ], "dependencies": { - "google-gax": "^2.12.0" + "google-gax": "^2.17.0" }, "devDependencies": { "@types/mocha": "^8.0.0", From 74f4e01df0edb241b10cf19b170229a22b35de07 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 30 Jun 2021 16:24:38 +0000 Subject: [PATCH 183/253] chore: release 2.1.4 (#296) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.4](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.3...v2.1.4) (2021-06-30) ### Bug Fixes * **deps:** google-gax v2.17.0 with mTLS ([#294](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/294)) ([45c12e5](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/45c12e5a7f9dbb40f054f7a4d9da0477010f6b00)) --- 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-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 6b240987ed7..7332a935148 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [2.1.4](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.3...v2.1.4) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#294](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/294)) ([45c12e5](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/45c12e5a7f9dbb40f054f7a4d9da0477010f6b00)) + ### [2.1.3](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.2...v2.1.3) (2021-06-24) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index ca64e8a19c9..f4ee894686e 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.1.3", + "version": "2.1.4", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 4e0f1e71748..954a82e9327 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.1.3" + "@google-cloud/recaptcha-enterprise": "^2.1.4" }, "devDependencies": { "chai": "^4.2.0", From d172956e6e9fdf1c3b8fbdf693e3c57c81208881 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 12 Jul 2021 17:44:40 -0400 Subject: [PATCH 184/253] fix(deps): google-gax v2.17.1 (#297) --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index f4ee894686e..5415a56c7db 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -25,7 +25,7 @@ "reCAPTCHA Enterprise API" ], "dependencies": { - "google-gax": "^2.17.0" + "google-gax": "^2.17.1" }, "devDependencies": { "@types/mocha": "^8.0.0", From c05e98cf2b076ff557343f3c50e86ab4a1b2d783 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 185/253] chore: release 2.1.5 (#298) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.5](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.4...v2.1.5) (2021-07-12) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#297](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/297)) ([15640f1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/15640f1a4a931caa9ece4b749994e7d6d609200e)) --- 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-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 7332a935148..1d71493a0dc 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [2.1.5](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.4...v2.1.5) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#297](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/297)) ([15640f1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/15640f1a4a931caa9ece4b749994e7d6d609200e)) + ### [2.1.4](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.3...v2.1.4) (2021-06-30) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 5415a56c7db..265475e2fa1 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.1.4", + "version": "2.1.5", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 954a82e9327..ecb8461daf9 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.1.4" + "@google-cloud/recaptcha-enterprise": "^2.1.5" }, "devDependencies": { "chai": "^4.2.0", From 2d20383f553115b37c05e708cb2c0c8cd6e3cb3c 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:38 +0000 Subject: [PATCH 186/253] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#299) 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/recaptcha_enterprise_service_client.ts | 11 ++++++++++- .../recaptcha_enterprise_service_v1_beta1_client.ts | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index b5e383278aa..23ccb56e868 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class RecaptchaEnterpriseServiceClient { 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: {}; @@ -59,6 +60,7 @@ export class RecaptchaEnterpriseServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; recaptchaEnterpriseServiceStub?: Promise<{[name: string]: Function}>; @@ -103,6 +105,9 @@ export class RecaptchaEnterpriseServiceClient { .constructor as typeof RecaptchaEnterpriseServiceClient; 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 = @@ -188,6 +193,9 @@ export class RecaptchaEnterpriseServiceClient { // 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; } /** @@ -217,7 +225,8 @@ export class RecaptchaEnterpriseServiceClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.recaptchaenterprise.v1 .RecaptchaEnterpriseService, - 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-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 318dc5a5300..b2533d8e540 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -48,6 +48,7 @@ const version = require('../../../package.json').version; export class RecaptchaEnterpriseServiceV1Beta1Client { 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: {}; @@ -59,6 +60,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; recaptchaEnterpriseServiceV1Beta1Stub?: Promise<{[name: string]: Function}>; @@ -103,6 +105,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { .constructor as typeof RecaptchaEnterpriseServiceV1Beta1Client; 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 = @@ -188,6 +193,9 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // 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; } /** @@ -217,7 +225,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.recaptchaenterprise.v1beta1 .RecaptchaEnterpriseServiceV1Beta1, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides From 9b747726e478228dde2b9c4de05adc5bf17786e3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 12:50:56 -0700 Subject: [PATCH 187/253] chore: release 2.1.6 (#300) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 1d71493a0dc..4b8bfe4cbd7 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [2.1.6](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.5...v2.1.6) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#299](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/299)) ([6787e23](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/6787e23374c3ef97b4f267bf629ae03bf58f321a)) + ### [2.1.5](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.4...v2.1.5) (2021-07-12) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 265475e2fa1..7908bb0143b 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.1.5", + "version": "2.1.6", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index ecb8461daf9..4b458edc480 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.1.5" + "@google-cloud/recaptcha-enterprise": "^2.1.6" }, "devDependencies": { "chai": "^4.2.0", From 5be2bcc77eb6581008525c33300605c5a8ec9f2f Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 4 Aug 2021 16:00:44 -0400 Subject: [PATCH 188/253] chore(nodejs): update client ref docs link in metadata (#305) --- packages/google-cloud-recaptchaenterprise/.repo-metadata.json | 2 +- packages/google-cloud-recaptchaenterprise/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.repo-metadata.json b/packages/google-cloud-recaptchaenterprise/.repo-metadata.json index 0423ef0494b..20c1f6c861b 100644 --- a/packages/google-cloud-recaptchaenterprise/.repo-metadata.json +++ b/packages/google-cloud-recaptchaenterprise/.repo-metadata.json @@ -1,5 +1,5 @@ { - "client_documentation": "https://googleapis.dev/nodejs/recaptcha-enterprise/latest", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/recaptcha-enterprise/latest", "api_id": "recaptchaenterprise.googleapis.com", "distribution_name": "@google-cloud/recaptcha-enterprise", "release_level": "ga", diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index 7221628d456..982c220df90 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -156,7 +156,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-recaptcha-enterprise/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/recaptcha-enterprise/latest +[client-docs]: https://cloud.google.com/nodejs/docs/reference/recaptcha-enterprise/latest [product-docs]: https://cloud.google.com/recaptcha-enterprise/docs/ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From 0979e4867b6a85743337fc88a2fa83d0004e82c3 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 16 Aug 2021 22:42:25 -0400 Subject: [PATCH 189/253] fix(deps): google-gax v2.24.1 (#309) --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 7908bb0143b..a8e9fc36167 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -25,7 +25,7 @@ "reCAPTCHA Enterprise API" ], "dependencies": { - "google-gax": "^2.17.1" + "google-gax": "^2.24.1" }, "devDependencies": { "@types/mocha": "^8.0.0", From 32d3a5e0349f565cccc6a3dcdc1c9df1c8fc787f 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:14:24 +0000 Subject: [PATCH 190/253] chore: release 2.1.7 (#310) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.7](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.6...v2.1.7) (2021-08-17) ### Bug Fixes * **deps:** google-gax v2.24.1 ([#309](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/309)) ([de80090](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/de800902327bad13ee6145ecbbb6b90d11cb8f59)) --- 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-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 4b8bfe4cbd7..1eba46a338a 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [2.1.7](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.6...v2.1.7) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#309](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/309)) ([de80090](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/de800902327bad13ee6145ecbbb6b90d11cb8f59)) + ### [2.1.6](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.5...v2.1.6) (2021-07-16) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index a8e9fc36167..eed6f6e042d 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.1.6", + "version": "2.1.7", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 4b458edc480..f99e527726b 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.1.6" + "@google-cloud/recaptcha-enterprise": "^2.1.7" }, "devDependencies": { "chai": "^4.2.0", From 568fa59c394d949741cb7424cac7c448904f9849 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:30:19 +0000 Subject: [PATCH 191/253] feat: turns on self-signed JWT feature flag (#311) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 392067151 Source-Link: https://github.com/googleapis/googleapis/commit/06345f7b95c4b4a3ffe4303f1f2984ccc304b2e0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/95882b37970e41e4cd51b22fa507cfd46dc7c4b6 --- .../src/v1/recaptcha_enterprise_service_client.ts | 6 ++++++ .../v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index 23ccb56e868..ce4b941794a 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -132,6 +132,12 @@ export class RecaptchaEnterpriseServiceClient { // 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; diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index b2533d8e540..886beb80ec4 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -132,6 +132,12 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // 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; From 4b38992b3876535e43c4005a6339dbc25b3a03a2 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:50:30 +0000 Subject: [PATCH 192/253] chore: release 2.2.0 (#312) :robot: I have created a release \*beep\* \*boop\* --- ## [2.2.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.7...v2.2.0) (2021-08-23) ### Features * turns on self-signed JWT feature flag ([#311](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/311)) ([c12da34](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/c12da3410a4ebc87884d9caaaba7c700b396c6b4)) --- 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-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 1eba46a338a..c8210f42642 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [2.2.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.7...v2.2.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#311](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/311)) ([c12da34](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/c12da3410a4ebc87884d9caaaba7c700b396c6b4)) + ### [2.1.7](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.6...v2.1.7) (2021-08-17) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index eed6f6e042d..25ba71ec4cc 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.1.7", + "version": "2.2.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index f99e527726b..2e08b8bc0cb 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.1.7" + "@google-cloud/recaptcha-enterprise": "^2.2.0" }, "devDependencies": { "chai": "^4.2.0", From faa7568b8abd9b667d3bacaa42d256bc1b6cde4b 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:38:43 +0000 Subject: [PATCH 193/253] chore: disable renovate dependency dashboard (#1194) (#314) --- packages/google-cloud-recaptchaenterprise/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index 982c220df90..4cc7cbfe005 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -147,8 +147,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 7a093c9d5ad14b4c898b0350a21c98bfe6dfb956 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 8 Sep 2021 20:41:25 -0400 Subject: [PATCH 194/253] fix(build): switch primary branch to main (#315) --- packages/google-cloud-recaptchaenterprise/README.md | 12 ++++++------ .../samples/README.md | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index 4cc7cbfe005..2e961f75932 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/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/recaptcha-enterprise.svg)](https://www.npmjs.org/package/@google-cloud/recaptcha-enterprise) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-recaptcha-enterprise/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-recaptcha-enterprise) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-recaptcha-enterprise/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-recaptcha-enterprise) @@ -15,7 +15,7 @@ reCAPTCHA Enterprise API client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-recaptcha-enterprise/blob/master/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/nodejs-recaptcha-enterprise/blob/main/CHANGELOG.md). * [Google Cloud reCAPTCHA Enterprise Node.js Client API Reference][client-docs] * [Google Cloud reCAPTCHA Enterprise Documentation][product-docs] @@ -89,11 +89,11 @@ async function main(projectNumber) { ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-recaptcha-enterprise/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-recaptcha-enterprise/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-recaptcha-enterprise/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-recaptcha-enterprise&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-recaptcha-enterprise/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-recaptcha-enterprise&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | @@ -142,7 +142,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-recaptcha-enterprise/blob/master/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-recaptcha-enterprise/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`) @@ -154,7 +154,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-recaptcha-enterprise/blob/master/LICENSE) +See [LICENSE](https://github.com/googleapis/nodejs-recaptcha-enterprise/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/recaptcha-enterprise/latest [product-docs]: https://cloud.google.com/recaptcha-enterprise/docs/ diff --git a/packages/google-cloud-recaptchaenterprise/samples/README.md b/packages/google-cloud-recaptchaenterprise/samples/README.md index 29686772faa..a0d2aa1da25 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/README.md +++ b/packages/google-cloud-recaptchaenterprise/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-recaptcha-enterprise/blob/master/samples/quickstart.js). +View the [source code](https://github.com/googleapis/nodejs-recaptcha-enterprise/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-recaptcha-enterprise&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) From 50e0ce7118b390c2ebd2b0175fe84129d2eff81d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 8 Sep 2021 19:05:27 -0700 Subject: [PATCH 195/253] chore: release 2.2.1 (#316) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index c8210f42642..bc09af2ead2 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +### [2.2.1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.2.0...v2.2.1) (2021-09-09) + + +### Bug Fixes + +* **build:** switch primary branch to main ([#315](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/315)) ([2fc99ad](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/2fc99ad6d478bc98f8d3cf39ba19780b13449db3)) + ## [2.2.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.1.7...v2.2.0) (2021-08-23) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 25ba71ec4cc..ec4efaf17a7 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.2.0", + "version": "2.2.1", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 2e08b8bc0cb..c47841fa77d 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.2.0" + "@google-cloud/recaptcha-enterprise": "^2.2.1" }, "devDependencies": { "chai": "^4.2.0", From 4402b00a1d9b3e72bd261eff2db8dd04723081f6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 16 Sep 2021 07:10:27 -0700 Subject: [PATCH 196/253] feat: add GetMetrics and MigrateKey methods to reCAPTCHA enterprise API (#318) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add GetMetrics and MigrateKey methods to reCAPTCHA enterprise API PiperOrigin-RevId: 396937887 Source-Link: https://github.com/googleapis/googleapis/commit/020672e489e00ba3eccbb66f9286657cbc8dfb73 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a5847907eb3607837f10f93e95fdfcc0a98e6f21 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTU4NDc5MDdlYjM2MDc4MzdmMTBmOTNlOTVmZGZjYzBhOThlNmYyMSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../v1/recaptchaenterprise.proto | 216 +- .../protos/protos.d.ts | 769 +++- .../protos/protos.js | 3339 +++++++++++++---- .../protos/protos.json | 192 +- .../src/v1/gapic_metadata.json | 20 + .../v1/recaptcha_enterprise_service_client.ts | 243 +- ...tcha_enterprise_service_client_config.json | 8 + .../gapic_recaptcha_enterprise_service_v1.ts | 292 ++ 8 files changed, 4378 insertions(+), 701 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index 9b60fcef7ca..c28fbde79e3 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -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. @@ -48,7 +48,7 @@ service RecaptchaEnterpriseService { } // Annotates a previously created Assessment to provide additional information - // on whether the event turned out to be authentic or fradulent. + // on whether the event turned out to be authentic or fraudulent. rpc AnnotateAssessment(AnnotateAssessmentRequest) returns (AnnotateAssessmentResponse) { option (google.api.http) = { post: "/v1/{name=projects/*/assessments/*}:annotate" @@ -93,6 +93,28 @@ service RecaptchaEnterpriseService { delete: "/v1/{name=projects/*/keys/*}" }; } + + // Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. + // Once a key is migrated, it can be used from either product. SiteVerify + // requests are billed as CreateAssessment calls. You must be + // authenticated as one of the current owners of the reCAPTCHA Site Key, and + // your user must have the reCAPTCHA Enterprise Admin IAM role in the + // destination project. + rpc MigrateKey(MigrateKeyRequest) returns (Key) { + option (google.api.http) = { + post: "/v1/{name=projects/*/keys/*}:migrate" + body: "*" + }; + } + + // Get some aggregated metrics for a Key. This data can be used to build + // dashboards. + rpc GetMetrics(GetMetricsRequest) returns (Metrics) { + option (google.api.http) = { + get: "/v1/{name=projects/*/keys/*/metrics}" + }; + option (google.api.method_signature) = "name"; + } } // The create assessment request message. @@ -112,7 +134,7 @@ message CreateAssessmentRequest { // The request message to annotate an Assessment. message AnnotateAssessmentRequest { - // Enum that reprensents the types of annotations. + // Enum that represents the types of annotations. enum Annotation { // Default unspecified type. ANNOTATION_UNSPECIFIED = 0; @@ -124,12 +146,47 @@ message AnnotateAssessmentRequest { FRAUDULENT = 2; // Provides information that the event was related to a login event in which - // the user typed the correct password. - PASSWORD_CORRECT = 3; + // the user typed the correct password. Deprecated, prefer indicating + // CORRECT_PASSWORD through the reasons field instead. + PASSWORD_CORRECT = 3 [deprecated = true]; // Provides information that the event was related to a login event in which - // the user typed the incorrect password. - PASSWORD_INCORRECT = 4; + // the user typed the incorrect password. Deprecated, prefer indicating + // INCORRECT_PASSWORD through the reasons field instead. + PASSWORD_INCORRECT = 4 [deprecated = true]; + } + + // Enum that represents potential reasons for annotating an assessment. + enum Reason { + // Default unspecified reason. + REASON_UNSPECIFIED = 0; + + // Indicates a chargeback for fraud was issued for the transaction + // associated with the assessment. + CHARGEBACK = 1; + + // Indicates the transaction associated with the assessment is suspected of + // being fraudulent based on the payment method, billing details, shipping + // address or other transaction information. + PAYMENT_HEURISTICS = 2; + + // Indicates that the user was served a 2FA challenge. An old assessment + // with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been + // overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow. + // This is equivalent to `FAILED_TWO_FACTOR`. + INITIATED_TWO_FACTOR = 7; + + // Indicates that the user passed a 2FA challenge. + PASSED_TWO_FACTOR = 3; + + // Indicates that the user failed a 2FA challenge. + FAILED_TWO_FACTOR = 4; + + // Indicates the user provided the correct password. + CORRECT_PASSWORD = 5; + + // Indicates the user provided an incorrect password. + INCORRECT_PASSWORD = 6; } // Required. The resource name of the Assessment, in the format @@ -141,8 +198,13 @@ message AnnotateAssessmentRequest { } ]; - // Required. The annotation that will be assigned to the Event. - Annotation annotation = 2 [(google.api.field_behavior) = REQUIRED]; + // Optional. The annotation that will be assigned to the Event. This field can be left + // empty to provide reasons that apply to an event without concluding whether + // the event is legitimate or fraudulent. + Annotation annotation = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional reasons for the annotation that will be assigned to the Event. + repeated Reason reasons = 3 [(google.api.field_behavior) = OPTIONAL]; } // Empty response for AnnotateAssessment. @@ -195,7 +257,6 @@ message Event { // Risk analysis result for an event. message RiskAnalysis { - // LINT.IfChange(classification_reason) // Reasons contributing to the risk analysis verdict. enum ClassificationReason { // Default unspecified type. @@ -229,7 +290,6 @@ message RiskAnalysis { } message TokenProperties { - // LINT.IfChange // Enum that represents the types of invalid token reasons. enum InvalidReason { // Default unspecified type. @@ -249,6 +309,10 @@ message TokenProperties { // The user verification token was not present. MISSING = 5; + + // A retriable error (such as network failure) occurred on the browser. + // Could easily be simulated by an attacker. + BROWSER_ERROR = 6; } // Whether the provided user response token is valid. When valid = false, the @@ -333,7 +397,7 @@ message UpdateKeyRequest { // Required. The key to update. Key key = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The mask to control which field of the key get updated. If the mask is not + // Optional. The mask to control which fields of the key get updated. If the mask is not // present, all fields will be updated. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; } @@ -350,6 +414,54 @@ message DeleteKeyRequest { ]; } +// The migrate key request message. +message MigrateKeyRequest { + // Required. The name of the key to be migrated, in the format + // "projects/{project}/keys/{key}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/Key" + } + ]; +} + +// The get metrics request message. +message GetMetricsRequest { + // Required. The name of the requested metrics, in the format + // "projects/{project}/keys/{key}/metrics". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/Metrics" + } + ]; +} + +// Metrics for a single Key. +message Metrics { + option (google.api.resource) = { + type: "recaptchaenterprise.googleapis.com/Metrics" + pattern: "projects/{project}/keys/{key}/metrics" + }; + + // Output only. The name of the metrics, in the format + // "projects/{project}/keys/{key}/metrics". + string name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Inclusive start time aligned to a day (UTC). + google.protobuf.Timestamp start_time = 1; + + // Metrics will be continuous and in order by dates, and in the granularity + // of day. All Key types should have score-based data. + repeated ScoreMetrics score_metrics = 2; + + // Metrics will be continuous and in order by dates, and in the granularity + // of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have + // challenge-based data. + repeated ChallengeMetrics challenge_metrics = 3; +} + // A key used to identify and configure applications (web and/or mobile) that // use reCAPTCHA Enterprise. message Key { @@ -378,12 +490,43 @@ message Key { IOSKeySettings ios_settings = 5; } - // Optional. See + // See // Creating and managing labels. - map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + map labels = 6; // The timestamp corresponding to the creation of this Key. google.protobuf.Timestamp create_time = 7; + + // Options for user acceptance testing. + TestingOptions testing_options = 9; +} + +// Options for user acceptance testing. +message TestingOptions { + // Enum that represents the challenge option for challenge-based (CHECKBOX, + // INVISIBLE) testing keys. + enum TestingChallenge { + // Perform the normal risk analysis and return either nocaptcha or a + // challenge depending on risk and trust factors. + TESTING_CHALLENGE_UNSPECIFIED = 0; + + // Challenge requests for this key will always return a nocaptcha, which + // does not require a solution. + NOCAPTCHA = 1; + + // Challenge requests for this key will always return an unsolvable + // challenge. + UNSOLVABLE_CHALLENGE = 2; + } + + // All assessments for this Key will return this score. Must be between 0 + // (likely not legitimate) and 1 (likely legitimate) inclusive. + float testing_score = 1; + + // For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests + // for this site will return nocaptcha if NOCAPTCHA, or an unsolvable + // challenge if CHALLENGE. + TestingChallenge testing_challenge = 2; } // Settings specific to keys that can be used by websites. @@ -434,6 +577,7 @@ message WebKeySettings { repeated string allowed_domains = 1; // Required. Whether this key can be used on AMP (Accelerated Mobile Pages) websites. + // This can only be set for the SCORE integration type. bool allow_amp_traffic = 2 [(google.api.field_behavior) = REQUIRED]; // Required. Describes how this key is integrated with the website. @@ -447,6 +591,9 @@ message WebKeySettings { // Settings specific to keys that can be used by Android apps. message AndroidKeySettings { + // If set to true, it means allowed_package_names will not be enforced. + bool allow_all_package_names = 2; + // Android package names of apps allowed to use the key. // Example: 'com.companyname.appname' repeated string allowed_package_names = 1; @@ -454,7 +601,48 @@ message AndroidKeySettings { // Settings specific to keys that can be used by iOS apps. message IOSKeySettings { + // If set to true, it means allowed_bundle_ids will not be enforced. + bool allow_all_bundle_ids = 2; + // iOS bundle ids of apps allowed to use the key. // Example: 'com.companyname.productname.appname' repeated string allowed_bundle_ids = 1; } + +// Score distribution. +message ScoreDistribution { + // Map key is score value multiplied by 100. The scores are discrete values + // between [0, 1]. The maximum number of buckets is on order of a few dozen, + // but typically much lower (ie. 10). + map score_buckets = 1; +} + +// Metrics related to scoring. +message ScoreMetrics { + // Aggregated score metrics for all traffic. + ScoreDistribution overall_metrics = 1; + + // Action-based metrics. The map key is the action name which specified by the + // site owners at time of the "execute" client-side call. + // Populated only for SCORE keys. + map action_metrics = 2; +} + +// Metrics related to challenges. +message ChallengeMetrics { + // Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent + // to a count of pageloads for pages that include reCAPTCHA. + int64 pageload_count = 1; + + // Count of nocaptchas (successful verification without a challenge) issued. + int64 nocaptcha_count = 2; + + // Count of submitted challenge solutions that were incorrect or otherwise + // deemed suspicious such that a subsequent challenge was triggered. + int64 failed_count = 3; + + // Count of nocaptchas (successful verification without a challenge) plus + // submitted challenge solutions that were correct and resulted in + // verification. + int64 passed_count = 4; +} diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index b4becef0b67..95e5c6bcce3 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -143,6 +143,34 @@ export namespace google { * @returns Promise */ public deleteKey(request: google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest): Promise; + + /** + * Calls MigrateKey. + * @param request MigrateKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Key + */ + public migrateKey(request: google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest, callback: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.MigrateKeyCallback): void; + + /** + * Calls MigrateKey. + * @param request MigrateKeyRequest message or plain object + * @returns Promise + */ + public migrateKey(request: google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest): Promise; + + /** + * Calls GetMetrics. + * @param request GetMetricsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Metrics + */ + public getMetrics(request: google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, callback: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetMetricsCallback): void; + + /** + * Calls GetMetrics. + * @param request GetMetricsRequest message or plain object + * @returns Promise + */ + public getMetrics(request: google.cloud.recaptchaenterprise.v1.IGetMetricsRequest): Promise; } namespace RecaptchaEnterpriseService { @@ -195,6 +223,20 @@ export namespace google { * @param [response] Empty */ type DeleteKeyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#migrateKey}. + * @param error Error, if any + * @param [response] Key + */ + type MigrateKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.Key) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#getMetrics}. + * @param error Error, if any + * @param [response] Metrics + */ + type GetMetricsCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.Metrics) => void; } /** Properties of a CreateAssessmentRequest. */ @@ -301,6 +343,9 @@ export namespace google { /** AnnotateAssessmentRequest annotation */ annotation?: (google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation|keyof typeof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation|null); + + /** AnnotateAssessmentRequest reasons */ + reasons?: (google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason[]|null); } /** Represents an AnnotateAssessmentRequest. */ @@ -318,6 +363,9 @@ export namespace google { /** AnnotateAssessmentRequest annotation. */ public annotation: (google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation|keyof typeof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation); + /** AnnotateAssessmentRequest reasons. */ + public reasons: google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason[]; + /** * Creates a new AnnotateAssessmentRequest instance using the specified properties. * @param [properties] Properties to set @@ -399,6 +447,18 @@ export namespace google { PASSWORD_CORRECT = 3, PASSWORD_INCORRECT = 4 } + + /** Reason enum. */ + enum Reason { + REASON_UNSPECIFIED = 0, + CHARGEBACK = 1, + PAYMENT_HEURISTICS = 2, + INITIATED_TWO_FACTOR = 7, + PASSED_TWO_FACTOR = 3, + FAILED_TWO_FACTOR = 4, + CORRECT_PASSWORD = 5, + INCORRECT_PASSWORD = 6 + } } /** Properties of an AnnotateAssessmentResponse. */ @@ -939,7 +999,8 @@ export namespace google { MALFORMED = 2, EXPIRED = 3, DUPE = 4, - MISSING = 5 + MISSING = 5, + BROWSER_ERROR = 6 } } @@ -1513,6 +1574,294 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a MigrateKeyRequest. */ + interface IMigrateKeyRequest { + + /** MigrateKeyRequest name */ + name?: (string|null); + } + + /** Represents a MigrateKeyRequest. */ + class MigrateKeyRequest implements IMigrateKeyRequest { + + /** + * Constructs a new MigrateKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest); + + /** MigrateKeyRequest name. */ + public name: string; + + /** + * Creates a new MigrateKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MigrateKeyRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest): google.cloud.recaptchaenterprise.v1.MigrateKeyRequest; + + /** + * Encodes the specified MigrateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.MigrateKeyRequest.verify|verify} messages. + * @param message MigrateKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MigrateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.MigrateKeyRequest.verify|verify} messages. + * @param message MigrateKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MigrateKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MigrateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.MigrateKeyRequest; + + /** + * Decodes a MigrateKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MigrateKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.MigrateKeyRequest; + + /** + * Verifies a MigrateKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MigrateKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MigrateKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.MigrateKeyRequest; + + /** + * Creates a plain object from a MigrateKeyRequest message. Also converts values to other types if specified. + * @param message MigrateKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.MigrateKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MigrateKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetMetricsRequest. */ + interface IGetMetricsRequest { + + /** GetMetricsRequest name */ + name?: (string|null); + } + + /** Represents a GetMetricsRequest. */ + class GetMetricsRequest implements IGetMetricsRequest { + + /** + * Constructs a new GetMetricsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IGetMetricsRequest); + + /** GetMetricsRequest name. */ + public name: string; + + /** + * Creates a new GetMetricsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMetricsRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IGetMetricsRequest): google.cloud.recaptchaenterprise.v1.GetMetricsRequest; + + /** + * Encodes the specified GetMetricsRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetMetricsRequest.verify|verify} messages. + * @param message GetMetricsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMetricsRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetMetricsRequest.verify|verify} messages. + * @param message GetMetricsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMetricsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMetricsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.GetMetricsRequest; + + /** + * Decodes a GetMetricsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMetricsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.GetMetricsRequest; + + /** + * Verifies a GetMetricsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMetricsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMetricsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.GetMetricsRequest; + + /** + * Creates a plain object from a GetMetricsRequest message. Also converts values to other types if specified. + * @param message GetMetricsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.GetMetricsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMetricsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Metrics. */ + interface IMetrics { + + /** Metrics name */ + name?: (string|null); + + /** Metrics startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Metrics scoreMetrics */ + scoreMetrics?: (google.cloud.recaptchaenterprise.v1.IScoreMetrics[]|null); + + /** Metrics challengeMetrics */ + challengeMetrics?: (google.cloud.recaptchaenterprise.v1.IChallengeMetrics[]|null); + } + + /** Represents a Metrics. */ + class Metrics implements IMetrics { + + /** + * Constructs a new Metrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IMetrics); + + /** Metrics name. */ + public name: string; + + /** Metrics startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Metrics scoreMetrics. */ + public scoreMetrics: google.cloud.recaptchaenterprise.v1.IScoreMetrics[]; + + /** Metrics challengeMetrics. */ + public challengeMetrics: google.cloud.recaptchaenterprise.v1.IChallengeMetrics[]; + + /** + * Creates a new Metrics instance using the specified properties. + * @param [properties] Properties to set + * @returns Metrics instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IMetrics): google.cloud.recaptchaenterprise.v1.Metrics; + + /** + * Encodes the specified Metrics message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Metrics.verify|verify} messages. + * @param message Metrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Metrics.verify|verify} messages. + * @param message Metrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.Metrics; + + /** + * Decodes a Metrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.Metrics; + + /** + * Verifies a Metrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.Metrics; + + /** + * Creates a plain object from a Metrics message. Also converts values to other types if specified. + * @param message Metrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.Metrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a Key. */ interface IKey { @@ -1536,6 +1885,9 @@ export namespace google { /** Key createTime */ createTime?: (google.protobuf.ITimestamp|null); + + /** Key testingOptions */ + testingOptions?: (google.cloud.recaptchaenterprise.v1.ITestingOptions|null); } /** Represents a Key. */ @@ -1568,6 +1920,9 @@ export namespace google { /** Key createTime. */ public createTime?: (google.protobuf.ITimestamp|null); + /** Key testingOptions. */ + public testingOptions?: (google.cloud.recaptchaenterprise.v1.ITestingOptions|null); + /** Key platformSettings. */ public platformSettings?: ("webSettings"|"androidSettings"|"iosSettings"); @@ -1642,6 +1997,112 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a TestingOptions. */ + interface ITestingOptions { + + /** TestingOptions testingScore */ + testingScore?: (number|null); + + /** TestingOptions testingChallenge */ + testingChallenge?: (google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge|keyof typeof google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge|null); + } + + /** Represents a TestingOptions. */ + class TestingOptions implements ITestingOptions { + + /** + * Constructs a new TestingOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.ITestingOptions); + + /** TestingOptions testingScore. */ + public testingScore: number; + + /** TestingOptions testingChallenge. */ + public testingChallenge: (google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge|keyof typeof google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge); + + /** + * Creates a new TestingOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns TestingOptions instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.ITestingOptions): google.cloud.recaptchaenterprise.v1.TestingOptions; + + /** + * Encodes the specified TestingOptions message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TestingOptions.verify|verify} messages. + * @param message TestingOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.ITestingOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestingOptions message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TestingOptions.verify|verify} messages. + * @param message TestingOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.ITestingOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestingOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.TestingOptions; + + /** + * Decodes a TestingOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.TestingOptions; + + /** + * Verifies a TestingOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestingOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestingOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.TestingOptions; + + /** + * Creates a plain object from a TestingOptions message. Also converts values to other types if specified. + * @param message TestingOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.TestingOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestingOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TestingOptions { + + /** TestingChallenge enum. */ + enum TestingChallenge { + TESTING_CHALLENGE_UNSPECIFIED = 0, + NOCAPTCHA = 1, + UNSOLVABLE_CHALLENGE = 2 + } + } + /** Properties of a WebKeySettings. */ interface IWebKeySettings { @@ -1778,6 +2239,9 @@ export namespace google { /** Properties of an AndroidKeySettings. */ interface IAndroidKeySettings { + /** AndroidKeySettings allowAllPackageNames */ + allowAllPackageNames?: (boolean|null); + /** AndroidKeySettings allowedPackageNames */ allowedPackageNames?: (string[]|null); } @@ -1791,6 +2255,9 @@ export namespace google { */ constructor(properties?: google.cloud.recaptchaenterprise.v1.IAndroidKeySettings); + /** AndroidKeySettings allowAllPackageNames. */ + public allowAllPackageNames: boolean; + /** AndroidKeySettings allowedPackageNames. */ public allowedPackageNames: string[]; @@ -1868,6 +2335,9 @@ export namespace google { /** Properties of a IOSKeySettings. */ interface IIOSKeySettings { + /** IOSKeySettings allowAllBundleIds */ + allowAllBundleIds?: (boolean|null); + /** IOSKeySettings allowedBundleIds */ allowedBundleIds?: (string[]|null); } @@ -1881,6 +2351,9 @@ export namespace google { */ constructor(properties?: google.cloud.recaptchaenterprise.v1.IIOSKeySettings); + /** IOSKeySettings allowAllBundleIds. */ + public allowAllBundleIds: boolean; + /** IOSKeySettings allowedBundleIds. */ public allowedBundleIds: string[]; @@ -1954,6 +2427,300 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Properties of a ScoreDistribution. */ + interface IScoreDistribution { + + /** ScoreDistribution scoreBuckets */ + scoreBuckets?: ({ [k: string]: (number|Long|string) }|null); + } + + /** Represents a ScoreDistribution. */ + class ScoreDistribution implements IScoreDistribution { + + /** + * Constructs a new ScoreDistribution. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IScoreDistribution); + + /** ScoreDistribution scoreBuckets. */ + public scoreBuckets: { [k: string]: (number|Long|string) }; + + /** + * Creates a new ScoreDistribution instance using the specified properties. + * @param [properties] Properties to set + * @returns ScoreDistribution instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IScoreDistribution): google.cloud.recaptchaenterprise.v1.ScoreDistribution; + + /** + * Encodes the specified ScoreDistribution message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ScoreDistribution.verify|verify} messages. + * @param message ScoreDistribution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IScoreDistribution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScoreDistribution message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ScoreDistribution.verify|verify} messages. + * @param message ScoreDistribution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IScoreDistribution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScoreDistribution message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScoreDistribution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.ScoreDistribution; + + /** + * Decodes a ScoreDistribution message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScoreDistribution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.ScoreDistribution; + + /** + * Verifies a ScoreDistribution message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScoreDistribution message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScoreDistribution + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.ScoreDistribution; + + /** + * Creates a plain object from a ScoreDistribution message. Also converts values to other types if specified. + * @param message ScoreDistribution + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.ScoreDistribution, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScoreDistribution to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ScoreMetrics. */ + interface IScoreMetrics { + + /** ScoreMetrics overallMetrics */ + overallMetrics?: (google.cloud.recaptchaenterprise.v1.IScoreDistribution|null); + + /** ScoreMetrics actionMetrics */ + actionMetrics?: ({ [k: string]: google.cloud.recaptchaenterprise.v1.IScoreDistribution }|null); + } + + /** Represents a ScoreMetrics. */ + class ScoreMetrics implements IScoreMetrics { + + /** + * Constructs a new ScoreMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IScoreMetrics); + + /** ScoreMetrics overallMetrics. */ + public overallMetrics?: (google.cloud.recaptchaenterprise.v1.IScoreDistribution|null); + + /** ScoreMetrics actionMetrics. */ + public actionMetrics: { [k: string]: google.cloud.recaptchaenterprise.v1.IScoreDistribution }; + + /** + * Creates a new ScoreMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ScoreMetrics instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IScoreMetrics): google.cloud.recaptchaenterprise.v1.ScoreMetrics; + + /** + * Encodes the specified ScoreMetrics message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ScoreMetrics.verify|verify} messages. + * @param message ScoreMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IScoreMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScoreMetrics message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ScoreMetrics.verify|verify} messages. + * @param message ScoreMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IScoreMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScoreMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScoreMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.ScoreMetrics; + + /** + * Decodes a ScoreMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScoreMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.ScoreMetrics; + + /** + * Verifies a ScoreMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScoreMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScoreMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.ScoreMetrics; + + /** + * Creates a plain object from a ScoreMetrics message. Also converts values to other types if specified. + * @param message ScoreMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.ScoreMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScoreMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ChallengeMetrics. */ + interface IChallengeMetrics { + + /** ChallengeMetrics pageloadCount */ + pageloadCount?: (number|Long|string|null); + + /** ChallengeMetrics nocaptchaCount */ + nocaptchaCount?: (number|Long|string|null); + + /** ChallengeMetrics failedCount */ + failedCount?: (number|Long|string|null); + + /** ChallengeMetrics passedCount */ + passedCount?: (number|Long|string|null); + } + + /** Represents a ChallengeMetrics. */ + class ChallengeMetrics implements IChallengeMetrics { + + /** + * Constructs a new ChallengeMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IChallengeMetrics); + + /** ChallengeMetrics pageloadCount. */ + public pageloadCount: (number|Long|string); + + /** ChallengeMetrics nocaptchaCount. */ + public nocaptchaCount: (number|Long|string); + + /** ChallengeMetrics failedCount. */ + public failedCount: (number|Long|string); + + /** ChallengeMetrics passedCount. */ + public passedCount: (number|Long|string); + + /** + * Creates a new ChallengeMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ChallengeMetrics instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IChallengeMetrics): google.cloud.recaptchaenterprise.v1.ChallengeMetrics; + + /** + * Encodes the specified ChallengeMetrics message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ChallengeMetrics.verify|verify} messages. + * @param message ChallengeMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IChallengeMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChallengeMetrics message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ChallengeMetrics.verify|verify} messages. + * @param message ChallengeMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IChallengeMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChallengeMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChallengeMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.ChallengeMetrics; + + /** + * Decodes a ChallengeMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChallengeMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.ChallengeMetrics; + + /** + * Verifies a ChallengeMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChallengeMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChallengeMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.ChallengeMetrics; + + /** + * Creates a plain object from a ChallengeMetrics message. Also converts values to other types if specified. + * @param message ChallengeMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.ChallengeMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChallengeMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } /** Namespace v1beta1. */ diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 85a4d4c9cf9..c667be10859 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -329,6 +329,72 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#migrateKey}. + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @typedef MigrateKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1.Key} [response] Key + */ + + /** + * Calls MigrateKey. + * @function migrateKey + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest} request MigrateKeyRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.MigrateKeyCallback} callback Node-style callback called with the error, if any, and Key + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseService.prototype.migrateKey = function migrateKey(request, callback) { + return this.rpcCall(migrateKey, $root.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest, $root.google.cloud.recaptchaenterprise.v1.Key, request, callback); + }, "name", { value: "MigrateKey" }); + + /** + * Calls MigrateKey. + * @function migrateKey + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest} request MigrateKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#getMetrics}. + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @typedef GetMetricsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1.Metrics} [response] Metrics + */ + + /** + * Calls GetMetrics. + * @function getMetrics + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest} request GetMetricsRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetMetricsCallback} callback Node-style callback called with the error, if any, and Metrics + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseService.prototype.getMetrics = function getMetrics(request, callback) { + return this.rpcCall(getMetrics, $root.google.cloud.recaptchaenterprise.v1.GetMetricsRequest, $root.google.cloud.recaptchaenterprise.v1.Metrics, request, callback); + }, "name", { value: "GetMetrics" }); + + /** + * Calls GetMetrics. + * @function getMetrics + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest} request GetMetricsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return RecaptchaEnterpriseService; })(); @@ -555,6 +621,7 @@ * @interface IAnnotateAssessmentRequest * @property {string|null} [name] AnnotateAssessmentRequest name * @property {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation|null} [annotation] AnnotateAssessmentRequest annotation + * @property {Array.|null} [reasons] AnnotateAssessmentRequest reasons */ /** @@ -566,6 +633,7 @@ * @param {google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest=} [properties] Properties to set */ function AnnotateAssessmentRequest(properties) { + this.reasons = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -588,6 +656,14 @@ */ AnnotateAssessmentRequest.prototype.annotation = 0; + /** + * AnnotateAssessmentRequest reasons. + * @member {Array.} reasons + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest + * @instance + */ + AnnotateAssessmentRequest.prototype.reasons = $util.emptyArray; + /** * Creates a new AnnotateAssessmentRequest instance using the specified properties. * @function create @@ -616,6 +692,12 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.annotation); + if (message.reasons != null && message.reasons.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.reasons.length; ++i) + writer.int32(message.reasons[i]); + writer.ldelim(); + } return writer; }; @@ -656,6 +738,16 @@ case 2: message.annotation = reader.int32(); break; + case 3: + if (!(message.reasons && message.reasons.length)) + message.reasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.reasons.push(reader.int32()); + } else + message.reasons.push(reader.int32()); + break; default: reader.skipType(tag & 7); break; @@ -705,6 +797,24 @@ case 4: break; } + if (message.reasons != null && message.hasOwnProperty("reasons")) { + if (!Array.isArray(message.reasons)) + return "reasons: array expected"; + for (var i = 0; i < message.reasons.length; ++i) + switch (message.reasons[i]) { + default: + return "reasons: enum value[] expected"; + case 0: + case 1: + case 2: + case 7: + case 3: + case 4: + case 5: + case 6: + break; + } + } return null; }; @@ -744,6 +854,47 @@ message.annotation = 4; break; } + if (object.reasons) { + if (!Array.isArray(object.reasons)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.reasons: array expected"); + message.reasons = []; + for (var i = 0; i < object.reasons.length; ++i) + switch (object.reasons[i]) { + default: + case "REASON_UNSPECIFIED": + case 0: + message.reasons[i] = 0; + break; + case "CHARGEBACK": + case 1: + message.reasons[i] = 1; + break; + case "PAYMENT_HEURISTICS": + case 2: + message.reasons[i] = 2; + break; + case "INITIATED_TWO_FACTOR": + case 7: + message.reasons[i] = 7; + break; + case "PASSED_TWO_FACTOR": + case 3: + message.reasons[i] = 3; + break; + case "FAILED_TWO_FACTOR": + case 4: + message.reasons[i] = 4; + break; + case "CORRECT_PASSWORD": + case 5: + message.reasons[i] = 5; + break; + case "INCORRECT_PASSWORD": + case 6: + message.reasons[i] = 6; + break; + } + } return message; }; @@ -760,6 +911,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.reasons = []; if (options.defaults) { object.name = ""; object.annotation = options.enums === String ? "ANNOTATION_UNSPECIFIED" : 0; @@ -768,6 +921,11 @@ object.name = message.name; if (message.annotation != null && message.hasOwnProperty("annotation")) object.annotation = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation[message.annotation] : message.annotation; + if (message.reasons && message.reasons.length) { + object.reasons = []; + for (var j = 0; j < message.reasons.length; ++j) + object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason[message.reasons[j]] : message.reasons[j]; + } return object; }; @@ -802,6 +960,32 @@ return values; })(); + /** + * Reason enum. + * @name google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason + * @enum {number} + * @property {number} REASON_UNSPECIFIED=0 REASON_UNSPECIFIED value + * @property {number} CHARGEBACK=1 CHARGEBACK value + * @property {number} PAYMENT_HEURISTICS=2 PAYMENT_HEURISTICS value + * @property {number} INITIATED_TWO_FACTOR=7 INITIATED_TWO_FACTOR value + * @property {number} PASSED_TWO_FACTOR=3 PASSED_TWO_FACTOR value + * @property {number} FAILED_TWO_FACTOR=4 FAILED_TWO_FACTOR value + * @property {number} CORRECT_PASSWORD=5 CORRECT_PASSWORD value + * @property {number} INCORRECT_PASSWORD=6 INCORRECT_PASSWORD value + */ + AnnotateAssessmentRequest.Reason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "CHARGEBACK"] = 1; + values[valuesById[2] = "PAYMENT_HEURISTICS"] = 2; + values[valuesById[7] = "INITIATED_TWO_FACTOR"] = 7; + values[valuesById[3] = "PASSED_TWO_FACTOR"] = 3; + values[valuesById[4] = "FAILED_TWO_FACTOR"] = 4; + values[valuesById[5] = "CORRECT_PASSWORD"] = 5; + values[valuesById[6] = "INCORRECT_PASSWORD"] = 6; + return values; + })(); + return AnnotateAssessmentRequest; })(); @@ -2000,6 +2184,7 @@ case 3: case 4: case 5: + case 6: break; } if (message.createTime != null && message.hasOwnProperty("createTime")) { @@ -2055,6 +2240,10 @@ case 5: message.invalidReason = 5; break; + case "BROWSER_ERROR": + case 6: + message.invalidReason = 6; + break; } if (object.createTime != null) { if (typeof object.createTime !== "object") @@ -2122,6 +2311,7 @@ * @property {number} EXPIRED=3 EXPIRED value * @property {number} DUPE=4 DUPE value * @property {number} MISSING=5 MISSING value + * @property {number} BROWSER_ERROR=6 BROWSER_ERROR value */ TokenProperties.InvalidReason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -2131,6 +2321,7 @@ values[valuesById[3] = "EXPIRED"] = 3; values[valuesById[4] = "DUPE"] = 4; values[valuesById[5] = "MISSING"] = 5; + values[valuesById[6] = "BROWSER_ERROR"] = 6; return values; })(); @@ -3409,31 +3600,24 @@ return DeleteKeyRequest; })(); - v1.Key = (function() { + v1.MigrateKeyRequest = (function() { /** - * Properties of a Key. + * Properties of a MigrateKeyRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IKey - * @property {string|null} [name] Key name - * @property {string|null} [displayName] Key displayName - * @property {google.cloud.recaptchaenterprise.v1.IWebKeySettings|null} [webSettings] Key webSettings - * @property {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings|null} [androidSettings] Key androidSettings - * @property {google.cloud.recaptchaenterprise.v1.IIOSKeySettings|null} [iosSettings] Key iosSettings - * @property {Object.|null} [labels] Key labels - * @property {google.protobuf.ITimestamp|null} [createTime] Key createTime + * @interface IMigrateKeyRequest + * @property {string|null} [name] MigrateKeyRequest name */ /** - * Constructs a new Key. + * Constructs a new MigrateKeyRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a Key. - * @implements IKey + * @classdesc Represents a MigrateKeyRequest. + * @implements IMigrateKeyRequest * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IKey=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest=} [properties] Properties to set */ - function Key(properties) { - this.labels = {}; + function MigrateKeyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3441,190 +3625,78 @@ } /** - * Key name. + * MigrateKeyRequest name. * @member {string} name - * @memberof google.cloud.recaptchaenterprise.v1.Key - * @instance - */ - Key.prototype.name = ""; - - /** - * Key displayName. - * @member {string} displayName - * @memberof google.cloud.recaptchaenterprise.v1.Key - * @instance - */ - Key.prototype.displayName = ""; - - /** - * Key webSettings. - * @member {google.cloud.recaptchaenterprise.v1.IWebKeySettings|null|undefined} webSettings - * @memberof google.cloud.recaptchaenterprise.v1.Key - * @instance - */ - Key.prototype.webSettings = null; - - /** - * Key androidSettings. - * @member {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings|null|undefined} androidSettings - * @memberof google.cloud.recaptchaenterprise.v1.Key - * @instance - */ - Key.prototype.androidSettings = null; - - /** - * Key iosSettings. - * @member {google.cloud.recaptchaenterprise.v1.IIOSKeySettings|null|undefined} iosSettings - * @memberof google.cloud.recaptchaenterprise.v1.Key - * @instance - */ - Key.prototype.iosSettings = null; - - /** - * Key labels. - * @member {Object.} labels - * @memberof google.cloud.recaptchaenterprise.v1.Key - * @instance - */ - Key.prototype.labels = $util.emptyObject; - - /** - * Key createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.recaptchaenterprise.v1.Key - * @instance - */ - Key.prototype.createTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Key platformSettings. - * @member {"webSettings"|"androidSettings"|"iosSettings"|undefined} platformSettings - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @instance */ - Object.defineProperty(Key.prototype, "platformSettings", { - get: $util.oneOfGetter($oneOfFields = ["webSettings", "androidSettings", "iosSettings"]), - set: $util.oneOfSetter($oneOfFields) - }); + MigrateKeyRequest.prototype.name = ""; /** - * Creates a new Key instance using the specified properties. + * Creates a new MigrateKeyRequest instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IKey=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.Key} Key instance + * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} MigrateKeyRequest instance */ - Key.create = function create(properties) { - return new Key(properties); + MigrateKeyRequest.create = function create(properties) { + return new MigrateKeyRequest(properties); }; /** - * Encodes the specified Key message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Key.verify|verify} messages. + * Encodes the specified MigrateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.MigrateKeyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IKey} message Key message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest} message MigrateKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Key.encode = function encode(message, writer) { + MigrateKeyRequest.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.webSettings != null && Object.hasOwnProperty.call(message, "webSettings")) - $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.encode(message.webSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.androidSettings != null && Object.hasOwnProperty.call(message, "androidSettings")) - $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.encode(message.androidSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.iosSettings != null && Object.hasOwnProperty.call(message, "iosSettings")) - $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.encode(message.iosSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; /** - * Encodes the specified Key message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Key.verify|verify} messages. + * Encodes the specified MigrateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.MigrateKeyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IKey} message Key message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest} message MigrateKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Key.encodeDelimited = function encodeDelimited(message, writer) { + MigrateKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Key message from the specified reader or buffer. + * Decodes a MigrateKeyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1.Key} Key + * @returns {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} MigrateKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Key.decode = function decode(reader, length) { + MigrateKeyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.Key(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; - case 2: - message.displayName = reader.string(); - break; - case 3: - message.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.decode(reader, reader.uint32()); - break; - case 4: - message.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.decode(reader, reader.uint32()); - break; - case 5: - message.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.decode(reader, reader.uint32()); - break; - case 6: - 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 7: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); + default: + reader.skipType(tag & 7); break; } } @@ -3632,216 +3704,107 @@ }; /** - * Decodes a Key message from the specified reader or buffer, length delimited. + * Decodes a MigrateKeyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.Key} Key + * @returns {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} MigrateKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Key.decodeDelimited = function decodeDelimited(reader) { + MigrateKeyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Key message. + * Verifies a MigrateKeyRequest message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Key.verify = function verify(message) { + MigrateKeyRequest.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.webSettings != null && message.hasOwnProperty("webSettings")) { - properties.platformSettings = 1; - { - var error = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.verify(message.webSettings); - if (error) - return "webSettings." + error; - } - } - if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) { - if (properties.platformSettings === 1) - return "platformSettings: multiple values"; - properties.platformSettings = 1; - { - var error = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify(message.androidSettings); - if (error) - return "androidSettings." + error; - } - } - if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) { - if (properties.platformSettings === 1) - return "platformSettings: multiple values"; - properties.platformSettings = 1; - { - var error = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify(message.iosSettings); - if (error) - return "iosSettings." + error; - } - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } return null; }; /** - * Creates a Key message from a plain object. Also converts values to their respective internal types. + * Creates a MigrateKeyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.Key} Key + * @returns {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} MigrateKeyRequest */ - Key.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.Key) + MigrateKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.Key(); + var message = new $root.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest(); if (object.name != null) message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.webSettings != null) { - if (typeof object.webSettings !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.webSettings: object expected"); - message.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.fromObject(object.webSettings); - } - if (object.androidSettings != null) { - if (typeof object.androidSettings !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.androidSettings: object expected"); - message.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.fromObject(object.androidSettings); - } - if (object.iosSettings != null) { - if (typeof object.iosSettings !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.iosSettings: object expected"); - message.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.fromObject(object.iosSettings); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.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.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } return message; }; /** - * Creates a plain object from a Key message. Also converts values to other types if specified. + * Creates a plain object from a MigrateKeyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.Key} message Key + * @param {google.cloud.recaptchaenterprise.v1.MigrateKeyRequest} message MigrateKeyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Key.toObject = function toObject(message, options) { + MigrateKeyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.displayName = ""; - object.createTime = null; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.webSettings != null && message.hasOwnProperty("webSettings")) { - object.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.toObject(message.webSettings, options); - if (options.oneofs) - object.platformSettings = "webSettings"; - } - if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) { - object.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.toObject(message.androidSettings, options); - if (options.oneofs) - object.platformSettings = "androidSettings"; - } - if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) { - object.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.toObject(message.iosSettings, options); - if (options.oneofs) - object.platformSettings = "iosSettings"; - } - 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.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); return object; }; /** - * Converts this Key to JSON. + * Converts this MigrateKeyRequest to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.Key + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest * @instance * @returns {Object.} JSON object */ - Key.prototype.toJSON = function toJSON() { + MigrateKeyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Key; + return MigrateKeyRequest; })(); - v1.WebKeySettings = (function() { + v1.GetMetricsRequest = (function() { /** - * Properties of a WebKeySettings. + * Properties of a GetMetricsRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IWebKeySettings - * @property {boolean|null} [allowAllDomains] WebKeySettings allowAllDomains - * @property {Array.|null} [allowedDomains] WebKeySettings allowedDomains - * @property {boolean|null} [allowAmpTraffic] WebKeySettings allowAmpTraffic - * @property {google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType|null} [integrationType] WebKeySettings integrationType - * @property {google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference|null} [challengeSecurityPreference] WebKeySettings challengeSecurityPreference + * @interface IGetMetricsRequest + * @property {string|null} [name] GetMetricsRequest name */ /** - * Constructs a new WebKeySettings. + * Constructs a new GetMetricsRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a WebKeySettings. - * @implements IWebKeySettings + * @classdesc Represents a GetMetricsRequest. + * @implements IGetMetricsRequest * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest=} [properties] Properties to set */ - function WebKeySettings(properties) { - this.allowedDomains = []; + function GetMetricsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3849,130 +3812,75 @@ } /** - * WebKeySettings allowAllDomains. - * @member {boolean} allowAllDomains - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings - * @instance - */ - WebKeySettings.prototype.allowAllDomains = false; - - /** - * WebKeySettings allowedDomains. - * @member {Array.} allowedDomains - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings - * @instance - */ - WebKeySettings.prototype.allowedDomains = $util.emptyArray; - - /** - * WebKeySettings allowAmpTraffic. - * @member {boolean} allowAmpTraffic - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings - * @instance - */ - WebKeySettings.prototype.allowAmpTraffic = false; - - /** - * WebKeySettings integrationType. - * @member {google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType} integrationType - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings - * @instance - */ - WebKeySettings.prototype.integrationType = 0; - - /** - * WebKeySettings challengeSecurityPreference. - * @member {google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference} challengeSecurityPreference - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * GetMetricsRequest name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @instance */ - WebKeySettings.prototype.challengeSecurityPreference = 0; + GetMetricsRequest.prototype.name = ""; /** - * Creates a new WebKeySettings instance using the specified properties. + * Creates a new GetMetricsRequest instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings instance + * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} GetMetricsRequest instance */ - WebKeySettings.create = function create(properties) { - return new WebKeySettings(properties); + GetMetricsRequest.create = function create(properties) { + return new GetMetricsRequest(properties); }; /** - * Encodes the specified WebKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WebKeySettings.verify|verify} messages. + * Encodes the specified GetMetricsRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetMetricsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings} message WebKeySettings message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest} message GetMetricsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebKeySettings.encode = function encode(message, writer) { + GetMetricsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowedDomains != null && message.allowedDomains.length) - for (var i = 0; i < message.allowedDomains.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedDomains[i]); - if (message.allowAmpTraffic != null && Object.hasOwnProperty.call(message, "allowAmpTraffic")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAmpTraffic); - if (message.allowAllDomains != null && Object.hasOwnProperty.call(message, "allowAllDomains")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowAllDomains); - if (message.integrationType != null && Object.hasOwnProperty.call(message, "integrationType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.integrationType); - if (message.challengeSecurityPreference != null && Object.hasOwnProperty.call(message, "challengeSecurityPreference")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.challengeSecurityPreference); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified WebKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WebKeySettings.verify|verify} messages. + * Encodes the specified GetMetricsRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.GetMetricsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings} message WebKeySettings message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IGetMetricsRequest} message GetMetricsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebKeySettings.encodeDelimited = function encodeDelimited(message, writer) { + GetMetricsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WebKeySettings message from the specified reader or buffer. + * Decodes a GetMetricsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings + * @returns {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} GetMetricsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebKeySettings.decode = function decode(reader, length) { + GetMetricsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.WebKeySettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.GetMetricsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.allowAllDomains = reader.bool(); - break; case 1: - if (!(message.allowedDomains && message.allowedDomains.length)) - message.allowedDomains = []; - message.allowedDomains.push(reader.string()); - break; - case 2: - message.allowAmpTraffic = reader.bool(); - break; - case 4: - message.integrationType = reader.int32(); - break; - case 5: - message.challengeSecurityPreference = reader.int32(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -3983,236 +3891,2155 @@ }; /** - * Decodes a WebKeySettings message from the specified reader or buffer, length delimited. + * Decodes a GetMetricsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings + * @returns {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} GetMetricsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebKeySettings.decodeDelimited = function decodeDelimited(reader) { + GetMetricsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WebKeySettings message. + * Verifies a GetMetricsRequest message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WebKeySettings.verify = function verify(message) { + GetMetricsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.allowAllDomains != null && message.hasOwnProperty("allowAllDomains")) - if (typeof message.allowAllDomains !== "boolean") - return "allowAllDomains: boolean expected"; - if (message.allowedDomains != null && message.hasOwnProperty("allowedDomains")) { - if (!Array.isArray(message.allowedDomains)) - return "allowedDomains: array expected"; - for (var i = 0; i < message.allowedDomains.length; ++i) - if (!$util.isString(message.allowedDomains[i])) - return "allowedDomains: string[] expected"; - } - if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) - if (typeof message.allowAmpTraffic !== "boolean") - return "allowAmpTraffic: boolean expected"; - if (message.integrationType != null && message.hasOwnProperty("integrationType")) - switch (message.integrationType) { - default: - return "integrationType: enum value expected"; - case 0: + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetMetricsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} GetMetricsRequest + */ + GetMetricsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.GetMetricsRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.GetMetricsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetMetricsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.GetMetricsRequest} message GetMetricsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMetricsRequest.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 GetMetricsRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest + * @instance + * @returns {Object.} JSON object + */ + GetMetricsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetMetricsRequest; + })(); + + v1.Metrics = (function() { + + /** + * Properties of a Metrics. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IMetrics + * @property {string|null} [name] Metrics name + * @property {google.protobuf.ITimestamp|null} [startTime] Metrics startTime + * @property {Array.|null} [scoreMetrics] Metrics scoreMetrics + * @property {Array.|null} [challengeMetrics] Metrics challengeMetrics + */ + + /** + * Constructs a new Metrics. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a Metrics. + * @implements IMetrics + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IMetrics=} [properties] Properties to set + */ + function Metrics(properties) { + this.scoreMetrics = []; + this.challengeMetrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metrics name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @instance + */ + Metrics.prototype.name = ""; + + /** + * Metrics startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @instance + */ + Metrics.prototype.startTime = null; + + /** + * Metrics scoreMetrics. + * @member {Array.} scoreMetrics + * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @instance + */ + Metrics.prototype.scoreMetrics = $util.emptyArray; + + /** + * Metrics challengeMetrics. + * @member {Array.} challengeMetrics + * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @instance + */ + Metrics.prototype.challengeMetrics = $util.emptyArray; + + /** + * Creates a new Metrics instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @static + * @param {google.cloud.recaptchaenterprise.v1.IMetrics=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.Metrics} Metrics instance + */ + Metrics.create = function create(properties) { + return new Metrics(properties); + }; + + /** + * Encodes the specified Metrics message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Metrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @static + * @param {google.cloud.recaptchaenterprise.v1.IMetrics} message Metrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.scoreMetrics != null && message.scoreMetrics.length) + for (var i = 0; i < message.scoreMetrics.length; ++i) + $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.encode(message.scoreMetrics[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.challengeMetrics != null && message.challengeMetrics.length) + for (var i = 0; i < message.challengeMetrics.length; ++i) + $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.encode(message.challengeMetrics[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Metrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @static + * @param {google.cloud.recaptchaenterprise.v1.IMetrics} message Metrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.Metrics} Metrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.Metrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.name = reader.string(); + break; case 1: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; case 2: + if (!(message.scoreMetrics && message.scoreMetrics.length)) + message.scoreMetrics = []; + message.scoreMetrics.push($root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.decode(reader, reader.uint32())); + break; case 3: + if (!(message.challengeMetrics && message.challengeMetrics.length)) + message.challengeMetrics = []; + message.challengeMetrics.push($root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.decode(reader, reader.uint32())); break; - } - if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) - switch (message.challengeSecurityPreference) { default: - return "challengeSecurityPreference: enum value expected"; - case 0: - case 1: - case 2: - case 3: + reader.skipType(tag & 7); break; } + } + return message; + }; + + /** + * Decodes a Metrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.Metrics} Metrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metrics message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metrics.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.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.scoreMetrics != null && message.hasOwnProperty("scoreMetrics")) { + if (!Array.isArray(message.scoreMetrics)) + return "scoreMetrics: array expected"; + for (var i = 0; i < message.scoreMetrics.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.verify(message.scoreMetrics[i]); + if (error) + return "scoreMetrics." + error; + } + } + if (message.challengeMetrics != null && message.hasOwnProperty("challengeMetrics")) { + if (!Array.isArray(message.challengeMetrics)) + return "challengeMetrics: array expected"; + for (var i = 0; i < message.challengeMetrics.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.verify(message.challengeMetrics[i]); + if (error) + return "challengeMetrics." + error; + } + } return null; }; /** - * Creates a WebKeySettings message from a plain object. Also converts values to their respective internal types. + * Creates a Metrics message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.Metrics * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings + * @returns {google.cloud.recaptchaenterprise.v1.Metrics} Metrics */ - WebKeySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.WebKeySettings) + Metrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.Metrics) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.WebKeySettings(); - if (object.allowAllDomains != null) - message.allowAllDomains = Boolean(object.allowAllDomains); - if (object.allowedDomains) { - if (!Array.isArray(object.allowedDomains)) - throw TypeError(".google.cloud.recaptchaenterprise.v1.WebKeySettings.allowedDomains: array expected"); - message.allowedDomains = []; - for (var i = 0; i < object.allowedDomains.length; ++i) - message.allowedDomains[i] = String(object.allowedDomains[i]); + var message = new $root.google.cloud.recaptchaenterprise.v1.Metrics(); + if (object.name != null) + message.name = String(object.name); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Metrics.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); } - if (object.allowAmpTraffic != null) - message.allowAmpTraffic = Boolean(object.allowAmpTraffic); - switch (object.integrationType) { - case "INTEGRATION_TYPE_UNSPECIFIED": - case 0: - message.integrationType = 0; - break; - case "SCORE": - case 1: - message.integrationType = 1; - break; - case "CHECKBOX": - case 2: - message.integrationType = 2; - break; - case "INVISIBLE": - case 3: - message.integrationType = 3; - break; + if (object.scoreMetrics) { + if (!Array.isArray(object.scoreMetrics)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.Metrics.scoreMetrics: array expected"); + message.scoreMetrics = []; + for (var i = 0; i < object.scoreMetrics.length; ++i) { + if (typeof object.scoreMetrics[i] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Metrics.scoreMetrics: object expected"); + message.scoreMetrics[i] = $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.fromObject(object.scoreMetrics[i]); + } } - switch (object.challengeSecurityPreference) { - case "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED": - case 0: - message.challengeSecurityPreference = 0; - break; - case "USABILITY": - case 1: - message.challengeSecurityPreference = 1; - break; - case "BALANCE": - case 2: - message.challengeSecurityPreference = 2; - break; - case "SECURITY": - case 3: - message.challengeSecurityPreference = 3; - break; + if (object.challengeMetrics) { + if (!Array.isArray(object.challengeMetrics)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.Metrics.challengeMetrics: array expected"); + message.challengeMetrics = []; + for (var i = 0; i < object.challengeMetrics.length; ++i) { + if (typeof object.challengeMetrics[i] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Metrics.challengeMetrics: object expected"); + message.challengeMetrics[i] = $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.fromObject(object.challengeMetrics[i]); + } } return message; }; /** - * Creates a plain object from a WebKeySettings message. Also converts values to other types if specified. + * Creates a plain object from a Metrics message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.Metrics * @static - * @param {google.cloud.recaptchaenterprise.v1.WebKeySettings} message WebKeySettings + * @param {google.cloud.recaptchaenterprise.v1.Metrics} message Metrics * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WebKeySettings.toObject = function toObject(message, options) { + Metrics.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.allowedDomains = []; + if (options.arrays || options.defaults) { + object.scoreMetrics = []; + object.challengeMetrics = []; + } if (options.defaults) { - object.allowAmpTraffic = false; - object.allowAllDomains = false; - object.integrationType = options.enums === String ? "INTEGRATION_TYPE_UNSPECIFIED" : 0; - object.challengeSecurityPreference = options.enums === String ? "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED" : 0; + object.startTime = null; + object.name = ""; } - if (message.allowedDomains && message.allowedDomains.length) { - object.allowedDomains = []; - for (var j = 0; j < message.allowedDomains.length; ++j) - object.allowedDomains[j] = message.allowedDomains[j]; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.scoreMetrics && message.scoreMetrics.length) { + object.scoreMetrics = []; + for (var j = 0; j < message.scoreMetrics.length; ++j) + object.scoreMetrics[j] = $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.toObject(message.scoreMetrics[j], options); + } + if (message.challengeMetrics && message.challengeMetrics.length) { + object.challengeMetrics = []; + for (var j = 0; j < message.challengeMetrics.length; ++j) + object.challengeMetrics[j] = $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.toObject(message.challengeMetrics[j], options); + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this Metrics to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @instance + * @returns {Object.} JSON object + */ + Metrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Metrics; + })(); + + v1.Key = (function() { + + /** + * Properties of a Key. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IKey + * @property {string|null} [name] Key name + * @property {string|null} [displayName] Key displayName + * @property {google.cloud.recaptchaenterprise.v1.IWebKeySettings|null} [webSettings] Key webSettings + * @property {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings|null} [androidSettings] Key androidSettings + * @property {google.cloud.recaptchaenterprise.v1.IIOSKeySettings|null} [iosSettings] Key iosSettings + * @property {Object.|null} [labels] Key labels + * @property {google.protobuf.ITimestamp|null} [createTime] Key createTime + * @property {google.cloud.recaptchaenterprise.v1.ITestingOptions|null} [testingOptions] Key testingOptions + */ + + /** + * Constructs a new Key. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a Key. + * @implements IKey + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IKey=} [properties] Properties to set + */ + function Key(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Key name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.name = ""; + + /** + * Key displayName. + * @member {string} displayName + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.displayName = ""; + + /** + * Key webSettings. + * @member {google.cloud.recaptchaenterprise.v1.IWebKeySettings|null|undefined} webSettings + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.webSettings = null; + + /** + * Key androidSettings. + * @member {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings|null|undefined} androidSettings + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.androidSettings = null; + + /** + * Key iosSettings. + * @member {google.cloud.recaptchaenterprise.v1.IIOSKeySettings|null|undefined} iosSettings + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.iosSettings = null; + + /** + * Key labels. + * @member {Object.} labels + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.labels = $util.emptyObject; + + /** + * Key createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.createTime = null; + + /** + * Key testingOptions. + * @member {google.cloud.recaptchaenterprise.v1.ITestingOptions|null|undefined} testingOptions + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.testingOptions = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Key platformSettings. + * @member {"webSettings"|"androidSettings"|"iosSettings"|undefined} platformSettings + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Object.defineProperty(Key.prototype, "platformSettings", { + get: $util.oneOfGetter($oneOfFields = ["webSettings", "androidSettings", "iosSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {google.cloud.recaptchaenterprise.v1.IKey=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Key.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {google.cloud.recaptchaenterprise.v1.IKey} message Key message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.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.webSettings != null && Object.hasOwnProperty.call(message, "webSettings")) + $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.encode(message.webSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.androidSettings != null && Object.hasOwnProperty.call(message, "androidSettings")) + $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.encode(message.androidSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.iosSettings != null && Object.hasOwnProperty.call(message, "iosSettings")) + $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.encode(message.iosSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.testingOptions != null && Object.hasOwnProperty.call(message, "testingOptions")) + $root.google.cloud.recaptchaenterprise.v1.TestingOptions.encode(message.testingOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Key message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Key.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {google.cloud.recaptchaenterprise.v1.IKey} message Key message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.Key(), 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: + message.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.decode(reader, reader.uint32()); + break; + case 4: + message.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.decode(reader, reader.uint32()); + break; + case 5: + message.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.decode(reader, reader.uint32()); + break; + case 6: + 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 7: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 9: + message.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Key message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Key message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Key.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.webSettings != null && message.hasOwnProperty("webSettings")) { + properties.platformSettings = 1; + { + var error = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.verify(message.webSettings); + if (error) + return "webSettings." + error; + } + } + if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) { + if (properties.platformSettings === 1) + return "platformSettings: multiple values"; + properties.platformSettings = 1; + { + var error = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify(message.androidSettings); + if (error) + return "androidSettings." + error; + } + } + if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) { + if (properties.platformSettings === 1) + return "platformSettings: multiple values"; + properties.platformSettings = 1; + { + var error = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify(message.iosSettings); + if (error) + return "iosSettings." + error; + } + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.testingOptions != null && message.hasOwnProperty("testingOptions")) { + var error = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.verify(message.testingOptions); + if (error) + return "testingOptions." + error; + } + return null; + }; + + /** + * Creates a Key message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.Key} Key + */ + Key.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.Key) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.Key(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.webSettings != null) { + if (typeof object.webSettings !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.webSettings: object expected"); + message.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.fromObject(object.webSettings); + } + if (object.androidSettings != null) { + if (typeof object.androidSettings !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.androidSettings: object expected"); + message.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.fromObject(object.androidSettings); + } + if (object.iosSettings != null) { + if (typeof object.iosSettings !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.iosSettings: object expected"); + message.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.fromObject(object.iosSettings); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.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.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.testingOptions != null) { + if (typeof object.testingOptions !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.testingOptions: object expected"); + message.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.fromObject(object.testingOptions); + } + return message; + }; + + /** + * Creates a plain object from a Key message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {google.cloud.recaptchaenterprise.v1.Key} message Key + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Key.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.createTime = null; + object.testingOptions = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.webSettings != null && message.hasOwnProperty("webSettings")) { + object.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.toObject(message.webSettings, options); + if (options.oneofs) + object.platformSettings = "webSettings"; + } + if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) { + object.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.toObject(message.androidSettings, options); + if (options.oneofs) + object.platformSettings = "androidSettings"; + } + if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) { + object.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.toObject(message.iosSettings, options); + if (options.oneofs) + object.platformSettings = "iosSettings"; + } + 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.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.testingOptions != null && message.hasOwnProperty("testingOptions")) + object.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.toObject(message.testingOptions, options); + return object; + }; + + /** + * Converts this Key to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + * @returns {Object.} JSON object + */ + Key.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Key; + })(); + + v1.TestingOptions = (function() { + + /** + * Properties of a TestingOptions. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface ITestingOptions + * @property {number|null} [testingScore] TestingOptions testingScore + * @property {google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge|null} [testingChallenge] TestingOptions testingChallenge + */ + + /** + * Constructs a new TestingOptions. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a TestingOptions. + * @implements ITestingOptions + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.ITestingOptions=} [properties] Properties to set + */ + function TestingOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestingOptions testingScore. + * @member {number} testingScore + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @instance + */ + TestingOptions.prototype.testingScore = 0; + + /** + * TestingOptions testingChallenge. + * @member {google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge} testingChallenge + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @instance + */ + TestingOptions.prototype.testingChallenge = 0; + + /** + * Creates a new TestingOptions instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {google.cloud.recaptchaenterprise.v1.ITestingOptions=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.TestingOptions} TestingOptions instance + */ + TestingOptions.create = function create(properties) { + return new TestingOptions(properties); + }; + + /** + * Encodes the specified TestingOptions message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TestingOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {google.cloud.recaptchaenterprise.v1.ITestingOptions} message TestingOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestingOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.testingScore != null && Object.hasOwnProperty.call(message, "testingScore")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.testingScore); + if (message.testingChallenge != null && Object.hasOwnProperty.call(message, "testingChallenge")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.testingChallenge); + return writer; + }; + + /** + * Encodes the specified TestingOptions message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TestingOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {google.cloud.recaptchaenterprise.v1.ITestingOptions} message TestingOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestingOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestingOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.TestingOptions} TestingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestingOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.TestingOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.testingScore = reader.float(); + break; + case 2: + message.testingChallenge = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestingOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.TestingOptions} TestingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestingOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestingOptions message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestingOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.testingScore != null && message.hasOwnProperty("testingScore")) + if (typeof message.testingScore !== "number") + return "testingScore: number expected"; + if (message.testingChallenge != null && message.hasOwnProperty("testingChallenge")) + switch (message.testingChallenge) { + default: + return "testingChallenge: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TestingOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.TestingOptions} TestingOptions + */ + TestingOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.TestingOptions) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.TestingOptions(); + if (object.testingScore != null) + message.testingScore = Number(object.testingScore); + switch (object.testingChallenge) { + case "TESTING_CHALLENGE_UNSPECIFIED": + case 0: + message.testingChallenge = 0; + break; + case "NOCAPTCHA": + case 1: + message.testingChallenge = 1; + break; + case "UNSOLVABLE_CHALLENGE": + case 2: + message.testingChallenge = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TestingOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {google.cloud.recaptchaenterprise.v1.TestingOptions} message TestingOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestingOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.testingScore = 0; + object.testingChallenge = options.enums === String ? "TESTING_CHALLENGE_UNSPECIFIED" : 0; + } + if (message.testingScore != null && message.hasOwnProperty("testingScore")) + object.testingScore = options.json && !isFinite(message.testingScore) ? String(message.testingScore) : message.testingScore; + if (message.testingChallenge != null && message.hasOwnProperty("testingChallenge")) + object.testingChallenge = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge[message.testingChallenge] : message.testingChallenge; + return object; + }; + + /** + * Converts this TestingOptions to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @instance + * @returns {Object.} JSON object + */ + TestingOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * TestingChallenge enum. + * @name google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge + * @enum {number} + * @property {number} TESTING_CHALLENGE_UNSPECIFIED=0 TESTING_CHALLENGE_UNSPECIFIED value + * @property {number} NOCAPTCHA=1 NOCAPTCHA value + * @property {number} UNSOLVABLE_CHALLENGE=2 UNSOLVABLE_CHALLENGE value + */ + TestingOptions.TestingChallenge = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TESTING_CHALLENGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NOCAPTCHA"] = 1; + values[valuesById[2] = "UNSOLVABLE_CHALLENGE"] = 2; + return values; + })(); + + return TestingOptions; + })(); + + v1.WebKeySettings = (function() { + + /** + * Properties of a WebKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IWebKeySettings + * @property {boolean|null} [allowAllDomains] WebKeySettings allowAllDomains + * @property {Array.|null} [allowedDomains] WebKeySettings allowedDomains + * @property {boolean|null} [allowAmpTraffic] WebKeySettings allowAmpTraffic + * @property {google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType|null} [integrationType] WebKeySettings integrationType + * @property {google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference|null} [challengeSecurityPreference] WebKeySettings challengeSecurityPreference + */ + + /** + * Constructs a new WebKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a WebKeySettings. + * @implements IWebKeySettings + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings=} [properties] Properties to set + */ + function WebKeySettings(properties) { + this.allowedDomains = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebKeySettings allowAllDomains. + * @member {boolean} allowAllDomains + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.allowAllDomains = false; + + /** + * WebKeySettings allowedDomains. + * @member {Array.} allowedDomains + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.allowedDomains = $util.emptyArray; + + /** + * WebKeySettings allowAmpTraffic. + * @member {boolean} allowAmpTraffic + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.allowAmpTraffic = false; + + /** + * WebKeySettings integrationType. + * @member {google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType} integrationType + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.integrationType = 0; + + /** + * WebKeySettings challengeSecurityPreference. + * @member {google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference} challengeSecurityPreference + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + */ + WebKeySettings.prototype.challengeSecurityPreference = 0; + + /** + * Creates a new WebKeySettings instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings instance + */ + WebKeySettings.create = function create(properties) { + return new WebKeySettings(properties); + }; + + /** + * Encodes the specified WebKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WebKeySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings} message WebKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebKeySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedDomains != null && message.allowedDomains.length) + for (var i = 0; i < message.allowedDomains.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedDomains[i]); + if (message.allowAmpTraffic != null && Object.hasOwnProperty.call(message, "allowAmpTraffic")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAmpTraffic); + if (message.allowAllDomains != null && Object.hasOwnProperty.call(message, "allowAllDomains")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowAllDomains); + if (message.integrationType != null && Object.hasOwnProperty.call(message, "integrationType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.integrationType); + if (message.challengeSecurityPreference != null && Object.hasOwnProperty.call(message, "challengeSecurityPreference")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.challengeSecurityPreference); + return writer; + }; + + /** + * Encodes the specified WebKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WebKeySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IWebKeySettings} message WebKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebKeySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebKeySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebKeySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.WebKeySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.allowAllDomains = reader.bool(); + break; + case 1: + if (!(message.allowedDomains && message.allowedDomains.length)) + message.allowedDomains = []; + message.allowedDomains.push(reader.string()); + break; + case 2: + message.allowAmpTraffic = reader.bool(); + break; + case 4: + message.integrationType = reader.int32(); + break; + case 5: + message.challengeSecurityPreference = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebKeySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebKeySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebKeySettings message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebKeySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAllDomains != null && message.hasOwnProperty("allowAllDomains")) + if (typeof message.allowAllDomains !== "boolean") + return "allowAllDomains: boolean expected"; + if (message.allowedDomains != null && message.hasOwnProperty("allowedDomains")) { + if (!Array.isArray(message.allowedDomains)) + return "allowedDomains: array expected"; + for (var i = 0; i < message.allowedDomains.length; ++i) + if (!$util.isString(message.allowedDomains[i])) + return "allowedDomains: string[] expected"; + } + if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) + if (typeof message.allowAmpTraffic !== "boolean") + return "allowAmpTraffic: boolean expected"; + if (message.integrationType != null && message.hasOwnProperty("integrationType")) + switch (message.integrationType) { + default: + return "integrationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) + switch (message.challengeSecurityPreference) { + default: + return "challengeSecurityPreference: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a WebKeySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.WebKeySettings} WebKeySettings + */ + WebKeySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.WebKeySettings) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.WebKeySettings(); + if (object.allowAllDomains != null) + message.allowAllDomains = Boolean(object.allowAllDomains); + if (object.allowedDomains) { + if (!Array.isArray(object.allowedDomains)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.WebKeySettings.allowedDomains: array expected"); + message.allowedDomains = []; + for (var i = 0; i < object.allowedDomains.length; ++i) + message.allowedDomains[i] = String(object.allowedDomains[i]); + } + if (object.allowAmpTraffic != null) + message.allowAmpTraffic = Boolean(object.allowAmpTraffic); + switch (object.integrationType) { + case "INTEGRATION_TYPE_UNSPECIFIED": + case 0: + message.integrationType = 0; + break; + case "SCORE": + case 1: + message.integrationType = 1; + break; + case "CHECKBOX": + case 2: + message.integrationType = 2; + break; + case "INVISIBLE": + case 3: + message.integrationType = 3; + break; + } + switch (object.challengeSecurityPreference) { + case "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED": + case 0: + message.challengeSecurityPreference = 0; + break; + case "USABILITY": + case 1: + message.challengeSecurityPreference = 1; + break; + case "BALANCE": + case 2: + message.challengeSecurityPreference = 2; + break; + case "SECURITY": + case 3: + message.challengeSecurityPreference = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a WebKeySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.WebKeySettings} message WebKeySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebKeySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedDomains = []; + if (options.defaults) { + object.allowAmpTraffic = false; + object.allowAllDomains = false; + object.integrationType = options.enums === String ? "INTEGRATION_TYPE_UNSPECIFIED" : 0; + object.challengeSecurityPreference = options.enums === String ? "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED" : 0; + } + if (message.allowedDomains && message.allowedDomains.length) { + object.allowedDomains = []; + for (var j = 0; j < message.allowedDomains.length; ++j) + object.allowedDomains[j] = message.allowedDomains[j]; + } + if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) + object.allowAmpTraffic = message.allowAmpTraffic; + if (message.allowAllDomains != null && message.hasOwnProperty("allowAllDomains")) + object.allowAllDomains = message.allowAllDomains; + if (message.integrationType != null && message.hasOwnProperty("integrationType")) + object.integrationType = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType[message.integrationType] : message.integrationType; + if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) + object.challengeSecurityPreference = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference[message.challengeSecurityPreference] : message.challengeSecurityPreference; + return object; + }; + + /** + * Converts this WebKeySettings to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @instance + * @returns {Object.} JSON object + */ + WebKeySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * IntegrationType enum. + * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType + * @enum {number} + * @property {number} INTEGRATION_TYPE_UNSPECIFIED=0 INTEGRATION_TYPE_UNSPECIFIED value + * @property {number} SCORE=1 SCORE value + * @property {number} CHECKBOX=2 CHECKBOX value + * @property {number} INVISIBLE=3 INVISIBLE value + */ + WebKeySettings.IntegrationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTEGRATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCORE"] = 1; + values[valuesById[2] = "CHECKBOX"] = 2; + values[valuesById[3] = "INVISIBLE"] = 3; + return values; + })(); + + /** + * ChallengeSecurityPreference enum. + * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference + * @enum {number} + * @property {number} CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED=0 CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED value + * @property {number} USABILITY=1 USABILITY value + * @property {number} BALANCE=2 BALANCE value + * @property {number} SECURITY=3 SECURITY value + */ + WebKeySettings.ChallengeSecurityPreference = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USABILITY"] = 1; + values[valuesById[2] = "BALANCE"] = 2; + values[valuesById[3] = "SECURITY"] = 3; + return values; + })(); + + return WebKeySettings; + })(); + + v1.AndroidKeySettings = (function() { + + /** + * Properties of an AndroidKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IAndroidKeySettings + * @property {boolean|null} [allowAllPackageNames] AndroidKeySettings allowAllPackageNames + * @property {Array.|null} [allowedPackageNames] AndroidKeySettings allowedPackageNames + */ + + /** + * Constructs a new AndroidKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents an AndroidKeySettings. + * @implements IAndroidKeySettings + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings=} [properties] Properties to set + */ + function AndroidKeySettings(properties) { + this.allowedPackageNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AndroidKeySettings allowAllPackageNames. + * @member {boolean} allowAllPackageNames + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @instance + */ + AndroidKeySettings.prototype.allowAllPackageNames = false; + + /** + * AndroidKeySettings allowedPackageNames. + * @member {Array.} allowedPackageNames + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @instance + */ + AndroidKeySettings.prototype.allowedPackageNames = $util.emptyArray; + + /** + * Creates a new AndroidKeySettings instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings instance + */ + AndroidKeySettings.create = function create(properties) { + return new AndroidKeySettings(properties); + }; + + /** + * Encodes the specified AndroidKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings} message AndroidKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AndroidKeySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedPackageNames != null && message.allowedPackageNames.length) + for (var i = 0; i < message.allowedPackageNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedPackageNames[i]); + if (message.allowAllPackageNames != null && Object.hasOwnProperty.call(message, "allowAllPackageNames")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAllPackageNames); + return writer; + }; + + /** + * Encodes the specified AndroidKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings} message AndroidKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AndroidKeySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AndroidKeySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AndroidKeySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAllPackageNames = reader.bool(); + break; + case 1: + if (!(message.allowedPackageNames && message.allowedPackageNames.length)) + message.allowedPackageNames = []; + message.allowedPackageNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AndroidKeySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AndroidKeySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AndroidKeySettings message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AndroidKeySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAllPackageNames != null && message.hasOwnProperty("allowAllPackageNames")) + if (typeof message.allowAllPackageNames !== "boolean") + return "allowAllPackageNames: boolean expected"; + if (message.allowedPackageNames != null && message.hasOwnProperty("allowedPackageNames")) { + if (!Array.isArray(message.allowedPackageNames)) + return "allowedPackageNames: array expected"; + for (var i = 0; i < message.allowedPackageNames.length; ++i) + if (!$util.isString(message.allowedPackageNames[i])) + return "allowedPackageNames: string[] expected"; + } + return null; + }; + + /** + * Creates an AndroidKeySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings + */ + AndroidKeySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings(); + if (object.allowAllPackageNames != null) + message.allowAllPackageNames = Boolean(object.allowAllPackageNames); + if (object.allowedPackageNames) { + if (!Array.isArray(object.allowedPackageNames)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.AndroidKeySettings.allowedPackageNames: array expected"); + message.allowedPackageNames = []; + for (var i = 0; i < object.allowedPackageNames.length; ++i) + message.allowedPackageNames[i] = String(object.allowedPackageNames[i]); + } + return message; + }; + + /** + * Creates a plain object from an AndroidKeySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} message AndroidKeySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AndroidKeySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedPackageNames = []; + if (options.defaults) + object.allowAllPackageNames = false; + if (message.allowedPackageNames && message.allowedPackageNames.length) { + object.allowedPackageNames = []; + for (var j = 0; j < message.allowedPackageNames.length; ++j) + object.allowedPackageNames[j] = message.allowedPackageNames[j]; + } + if (message.allowAllPackageNames != null && message.hasOwnProperty("allowAllPackageNames")) + object.allowAllPackageNames = message.allowAllPackageNames; + return object; + }; + + /** + * Converts this AndroidKeySettings to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @instance + * @returns {Object.} JSON object + */ + AndroidKeySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AndroidKeySettings; + })(); + + v1.IOSKeySettings = (function() { + + /** + * Properties of a IOSKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IIOSKeySettings + * @property {boolean|null} [allowAllBundleIds] IOSKeySettings allowAllBundleIds + * @property {Array.|null} [allowedBundleIds] IOSKeySettings allowedBundleIds + */ + + /** + * Constructs a new IOSKeySettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a IOSKeySettings. + * @implements IIOSKeySettings + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings=} [properties] Properties to set + */ + function IOSKeySettings(properties) { + this.allowedBundleIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IOSKeySettings allowAllBundleIds. + * @member {boolean} allowAllBundleIds + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @instance + */ + IOSKeySettings.prototype.allowAllBundleIds = false; + + /** + * IOSKeySettings allowedBundleIds. + * @member {Array.} allowedBundleIds + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @instance + */ + IOSKeySettings.prototype.allowedBundleIds = $util.emptyArray; + + /** + * Creates a new IOSKeySettings instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings instance + */ + IOSKeySettings.create = function create(properties) { + return new IOSKeySettings(properties); + }; + + /** + * Encodes the specified IOSKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings} message IOSKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IOSKeySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedBundleIds != null && message.allowedBundleIds.length) + for (var i = 0; i < message.allowedBundleIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedBundleIds[i]); + if (message.allowAllBundleIds != null && Object.hasOwnProperty.call(message, "allowAllBundleIds")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAllBundleIds); + return writer; + }; + + /** + * Encodes the specified IOSKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings} message IOSKeySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IOSKeySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a IOSKeySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IOSKeySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAllBundleIds = reader.bool(); + break; + case 1: + if (!(message.allowedBundleIds && message.allowedBundleIds.length)) + message.allowedBundleIds = []; + message.allowedBundleIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a IOSKeySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IOSKeySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a IOSKeySettings message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IOSKeySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAllBundleIds != null && message.hasOwnProperty("allowAllBundleIds")) + if (typeof message.allowAllBundleIds !== "boolean") + return "allowAllBundleIds: boolean expected"; + if (message.allowedBundleIds != null && message.hasOwnProperty("allowedBundleIds")) { + if (!Array.isArray(message.allowedBundleIds)) + return "allowedBundleIds: array expected"; + for (var i = 0; i < message.allowedBundleIds.length; ++i) + if (!$util.isString(message.allowedBundleIds[i])) + return "allowedBundleIds: string[] expected"; + } + return null; + }; + + /** + * Creates a IOSKeySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings + */ + IOSKeySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings(); + if (object.allowAllBundleIds != null) + message.allowAllBundleIds = Boolean(object.allowAllBundleIds); + if (object.allowedBundleIds) { + if (!Array.isArray(object.allowedBundleIds)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.IOSKeySettings.allowedBundleIds: array expected"); + message.allowedBundleIds = []; + for (var i = 0; i < object.allowedBundleIds.length; ++i) + message.allowedBundleIds[i] = String(object.allowedBundleIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a IOSKeySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IOSKeySettings} message IOSKeySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IOSKeySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedBundleIds = []; + if (options.defaults) + object.allowAllBundleIds = false; + if (message.allowedBundleIds && message.allowedBundleIds.length) { + object.allowedBundleIds = []; + for (var j = 0; j < message.allowedBundleIds.length; ++j) + object.allowedBundleIds[j] = message.allowedBundleIds[j]; + } + if (message.allowAllBundleIds != null && message.hasOwnProperty("allowAllBundleIds")) + object.allowAllBundleIds = message.allowAllBundleIds; + return object; + }; + + /** + * Converts this IOSKeySettings to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @instance + * @returns {Object.} JSON object + */ + IOSKeySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IOSKeySettings; + })(); + + v1.ScoreDistribution = (function() { + + /** + * Properties of a ScoreDistribution. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IScoreDistribution + * @property {Object.|null} [scoreBuckets] ScoreDistribution scoreBuckets + */ + + /** + * Constructs a new ScoreDistribution. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a ScoreDistribution. + * @implements IScoreDistribution + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IScoreDistribution=} [properties] Properties to set + */ + function ScoreDistribution(properties) { + this.scoreBuckets = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScoreDistribution scoreBuckets. + * @member {Object.} scoreBuckets + * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution + * @instance + */ + ScoreDistribution.prototype.scoreBuckets = $util.emptyObject; + + /** + * Creates a new ScoreDistribution instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution + * @static + * @param {google.cloud.recaptchaenterprise.v1.IScoreDistribution=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.ScoreDistribution} ScoreDistribution instance + */ + ScoreDistribution.create = function create(properties) { + return new ScoreDistribution(properties); + }; + + /** + * Encodes the specified ScoreDistribution message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ScoreDistribution.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution + * @static + * @param {google.cloud.recaptchaenterprise.v1.IScoreDistribution} message ScoreDistribution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScoreDistribution.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scoreBuckets != null && Object.hasOwnProperty.call(message, "scoreBuckets")) + for (var keys = Object.keys(message.scoreBuckets), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.scoreBuckets[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScoreDistribution message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ScoreDistribution.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution + * @static + * @param {google.cloud.recaptchaenterprise.v1.IScoreDistribution} message ScoreDistribution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScoreDistribution.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScoreDistribution message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.ScoreDistribution} ScoreDistribution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScoreDistribution.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (message.scoreBuckets === $util.emptyObject) + message.scoreBuckets = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.int32(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.scoreBuckets[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScoreDistribution message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.ScoreDistribution} ScoreDistribution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScoreDistribution.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScoreDistribution message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScoreDistribution.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scoreBuckets != null && message.hasOwnProperty("scoreBuckets")) { + if (!$util.isObject(message.scoreBuckets)) + return "scoreBuckets: object expected"; + var key = Object.keys(message.scoreBuckets); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "scoreBuckets: integer key{k:int32} expected"; + if (!$util.isInteger(message.scoreBuckets[key[i]]) && !(message.scoreBuckets[key[i]] && $util.isInteger(message.scoreBuckets[key[i]].low) && $util.isInteger(message.scoreBuckets[key[i]].high))) + return "scoreBuckets: integer|Long{k:int32} expected"; + } + } + return null; + }; + + /** + * Creates a ScoreDistribution message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.ScoreDistribution} ScoreDistribution + */ + ScoreDistribution.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution(); + if (object.scoreBuckets) { + if (typeof object.scoreBuckets !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.ScoreDistribution.scoreBuckets: object expected"); + message.scoreBuckets = {}; + for (var keys = Object.keys(object.scoreBuckets), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.scoreBuckets[keys[i]] = $util.Long.fromValue(object.scoreBuckets[keys[i]])).unsigned = false; + else if (typeof object.scoreBuckets[keys[i]] === "string") + message.scoreBuckets[keys[i]] = parseInt(object.scoreBuckets[keys[i]], 10); + else if (typeof object.scoreBuckets[keys[i]] === "number") + message.scoreBuckets[keys[i]] = object.scoreBuckets[keys[i]]; + else if (typeof object.scoreBuckets[keys[i]] === "object") + message.scoreBuckets[keys[i]] = new $util.LongBits(object.scoreBuckets[keys[i]].low >>> 0, object.scoreBuckets[keys[i]].high >>> 0).toNumber(); + } + return message; + }; + + /** + * Creates a plain object from a ScoreDistribution message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution + * @static + * @param {google.cloud.recaptchaenterprise.v1.ScoreDistribution} message ScoreDistribution + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScoreDistribution.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.scoreBuckets = {}; + var keys2; + if (message.scoreBuckets && (keys2 = Object.keys(message.scoreBuckets)).length) { + object.scoreBuckets = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.scoreBuckets[keys2[j]] === "number") + object.scoreBuckets[keys2[j]] = options.longs === String ? String(message.scoreBuckets[keys2[j]]) : message.scoreBuckets[keys2[j]]; + else + object.scoreBuckets[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.scoreBuckets[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.scoreBuckets[keys2[j]].low >>> 0, message.scoreBuckets[keys2[j]].high >>> 0).toNumber() : message.scoreBuckets[keys2[j]]; } - if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) - object.allowAmpTraffic = message.allowAmpTraffic; - if (message.allowAllDomains != null && message.hasOwnProperty("allowAllDomains")) - object.allowAllDomains = message.allowAllDomains; - if (message.integrationType != null && message.hasOwnProperty("integrationType")) - object.integrationType = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType[message.integrationType] : message.integrationType; - if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) - object.challengeSecurityPreference = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference[message.challengeSecurityPreference] : message.challengeSecurityPreference; return object; }; /** - * Converts this WebKeySettings to JSON. + * Converts this ScoreDistribution to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution * @instance * @returns {Object.} JSON object */ - WebKeySettings.prototype.toJSON = function toJSON() { + ScoreDistribution.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * IntegrationType enum. - * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType - * @enum {number} - * @property {number} INTEGRATION_TYPE_UNSPECIFIED=0 INTEGRATION_TYPE_UNSPECIFIED value - * @property {number} SCORE=1 SCORE value - * @property {number} CHECKBOX=2 CHECKBOX value - * @property {number} INVISIBLE=3 INVISIBLE value - */ - WebKeySettings.IntegrationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INTEGRATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SCORE"] = 1; - values[valuesById[2] = "CHECKBOX"] = 2; - values[valuesById[3] = "INVISIBLE"] = 3; - return values; - })(); - - /** - * ChallengeSecurityPreference enum. - * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference - * @enum {number} - * @property {number} CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED=0 CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED value - * @property {number} USABILITY=1 USABILITY value - * @property {number} BALANCE=2 BALANCE value - * @property {number} SECURITY=3 SECURITY value - */ - WebKeySettings.ChallengeSecurityPreference = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED"] = 0; - values[valuesById[1] = "USABILITY"] = 1; - values[valuesById[2] = "BALANCE"] = 2; - values[valuesById[3] = "SECURITY"] = 3; - return values; - })(); - - return WebKeySettings; + return ScoreDistribution; })(); - v1.AndroidKeySettings = (function() { + v1.ScoreMetrics = (function() { /** - * Properties of an AndroidKeySettings. + * Properties of a ScoreMetrics. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IAndroidKeySettings - * @property {Array.|null} [allowedPackageNames] AndroidKeySettings allowedPackageNames + * @interface IScoreMetrics + * @property {google.cloud.recaptchaenterprise.v1.IScoreDistribution|null} [overallMetrics] ScoreMetrics overallMetrics + * @property {Object.|null} [actionMetrics] ScoreMetrics actionMetrics */ /** - * Constructs a new AndroidKeySettings. + * Constructs a new ScoreMetrics. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents an AndroidKeySettings. - * @implements IAndroidKeySettings + * @classdesc Represents a ScoreMetrics. + * @implements IScoreMetrics * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IScoreMetrics=} [properties] Properties to set */ - function AndroidKeySettings(properties) { - this.allowedPackageNames = []; + function ScoreMetrics(properties) { + this.actionMetrics = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4220,78 +6047,110 @@ } /** - * AndroidKeySettings allowedPackageNames. - * @member {Array.} allowedPackageNames - * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * ScoreMetrics overallMetrics. + * @member {google.cloud.recaptchaenterprise.v1.IScoreDistribution|null|undefined} overallMetrics + * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics * @instance */ - AndroidKeySettings.prototype.allowedPackageNames = $util.emptyArray; + ScoreMetrics.prototype.overallMetrics = null; /** - * Creates a new AndroidKeySettings instance using the specified properties. + * ScoreMetrics actionMetrics. + * @member {Object.} actionMetrics + * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics + * @instance + */ + ScoreMetrics.prototype.actionMetrics = $util.emptyObject; + + /** + * Creates a new ScoreMetrics instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics * @static - * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings instance + * @param {google.cloud.recaptchaenterprise.v1.IScoreMetrics=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.ScoreMetrics} ScoreMetrics instance */ - AndroidKeySettings.create = function create(properties) { - return new AndroidKeySettings(properties); + ScoreMetrics.create = function create(properties) { + return new ScoreMetrics(properties); }; /** - * Encodes the specified AndroidKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify|verify} messages. + * Encodes the specified ScoreMetrics message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ScoreMetrics.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics * @static - * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings} message AndroidKeySettings message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IScoreMetrics} message ScoreMetrics message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AndroidKeySettings.encode = function encode(message, writer) { + ScoreMetrics.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowedPackageNames != null && message.allowedPackageNames.length) - for (var i = 0; i < message.allowedPackageNames.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedPackageNames[i]); + if (message.overallMetrics != null && Object.hasOwnProperty.call(message, "overallMetrics")) + $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.encode(message.overallMetrics, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.actionMetrics != null && Object.hasOwnProperty.call(message, "actionMetrics")) + for (var keys = Object.keys(message.actionMetrics), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.encode(message.actionMetrics[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; /** - * Encodes the specified AndroidKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AndroidKeySettings.verify|verify} messages. + * Encodes the specified ScoreMetrics message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ScoreMetrics.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics * @static - * @param {google.cloud.recaptchaenterprise.v1.IAndroidKeySettings} message AndroidKeySettings message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IScoreMetrics} message ScoreMetrics message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AndroidKeySettings.encodeDelimited = function encodeDelimited(message, writer) { + ScoreMetrics.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AndroidKeySettings message from the specified reader or buffer. + * Decodes a ScoreMetrics message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings + * @returns {google.cloud.recaptchaenterprise.v1.ScoreMetrics} ScoreMetrics * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AndroidKeySettings.decode = function decode(reader, length) { + ScoreMetrics.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.allowedPackageNames && message.allowedPackageNames.length)) - message.allowedPackageNames = []; - message.allowedPackageNames.push(reader.string()); + message.overallMetrics = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.decode(reader, reader.uint32()); + break; + case 2: + if (message.actionMetrics === $util.emptyObject) + message.actionMetrics = {}; + 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.recaptchaenterprise.v1.ScoreDistribution.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.actionMetrics[key] = value; break; default: reader.skipType(tag & 7); @@ -4302,120 +6161,143 @@ }; /** - * Decodes an AndroidKeySettings message from the specified reader or buffer, length delimited. + * Decodes a ScoreMetrics message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings + * @returns {google.cloud.recaptchaenterprise.v1.ScoreMetrics} ScoreMetrics * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AndroidKeySettings.decodeDelimited = function decodeDelimited(reader) { + ScoreMetrics.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AndroidKeySettings message. + * Verifies a ScoreMetrics message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AndroidKeySettings.verify = function verify(message) { + ScoreMetrics.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.allowedPackageNames != null && message.hasOwnProperty("allowedPackageNames")) { - if (!Array.isArray(message.allowedPackageNames)) - return "allowedPackageNames: array expected"; - for (var i = 0; i < message.allowedPackageNames.length; ++i) - if (!$util.isString(message.allowedPackageNames[i])) - return "allowedPackageNames: string[] expected"; + if (message.overallMetrics != null && message.hasOwnProperty("overallMetrics")) { + var error = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.verify(message.overallMetrics); + if (error) + return "overallMetrics." + error; + } + if (message.actionMetrics != null && message.hasOwnProperty("actionMetrics")) { + if (!$util.isObject(message.actionMetrics)) + return "actionMetrics: object expected"; + var key = Object.keys(message.actionMetrics); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.verify(message.actionMetrics[key[i]]); + if (error) + return "actionMetrics." + error; + } } return null; }; /** - * Creates an AndroidKeySettings message from a plain object. Also converts values to their respective internal types. + * Creates a ScoreMetrics message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} AndroidKeySettings + * @returns {google.cloud.recaptchaenterprise.v1.ScoreMetrics} ScoreMetrics */ - AndroidKeySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings) + ScoreMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings(); - if (object.allowedPackageNames) { - if (!Array.isArray(object.allowedPackageNames)) - throw TypeError(".google.cloud.recaptchaenterprise.v1.AndroidKeySettings.allowedPackageNames: array expected"); - message.allowedPackageNames = []; - for (var i = 0; i < object.allowedPackageNames.length; ++i) - message.allowedPackageNames[i] = String(object.allowedPackageNames[i]); + var message = new $root.google.cloud.recaptchaenterprise.v1.ScoreMetrics(); + if (object.overallMetrics != null) { + if (typeof object.overallMetrics !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.ScoreMetrics.overallMetrics: object expected"); + message.overallMetrics = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.fromObject(object.overallMetrics); + } + if (object.actionMetrics) { + if (typeof object.actionMetrics !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.ScoreMetrics.actionMetrics: object expected"); + message.actionMetrics = {}; + for (var keys = Object.keys(object.actionMetrics), i = 0; i < keys.length; ++i) { + if (typeof object.actionMetrics[keys[i]] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.ScoreMetrics.actionMetrics: object expected"); + message.actionMetrics[keys[i]] = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.fromObject(object.actionMetrics[keys[i]]); + } } return message; }; /** - * Creates a plain object from an AndroidKeySettings message. Also converts values to other types if specified. + * Creates a plain object from a ScoreMetrics message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics * @static - * @param {google.cloud.recaptchaenterprise.v1.AndroidKeySettings} message AndroidKeySettings + * @param {google.cloud.recaptchaenterprise.v1.ScoreMetrics} message ScoreMetrics * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AndroidKeySettings.toObject = function toObject(message, options) { + ScoreMetrics.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.allowedPackageNames = []; - if (message.allowedPackageNames && message.allowedPackageNames.length) { - object.allowedPackageNames = []; - for (var j = 0; j < message.allowedPackageNames.length; ++j) - object.allowedPackageNames[j] = message.allowedPackageNames[j]; + if (options.objects || options.defaults) + object.actionMetrics = {}; + if (options.defaults) + object.overallMetrics = null; + if (message.overallMetrics != null && message.hasOwnProperty("overallMetrics")) + object.overallMetrics = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.toObject(message.overallMetrics, options); + var keys2; + if (message.actionMetrics && (keys2 = Object.keys(message.actionMetrics)).length) { + object.actionMetrics = {}; + for (var j = 0; j < keys2.length; ++j) + object.actionMetrics[keys2[j]] = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.toObject(message.actionMetrics[keys2[j]], options); } return object; }; /** - * Converts this AndroidKeySettings to JSON. + * Converts this ScoreMetrics to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics * @instance * @returns {Object.} JSON object */ - AndroidKeySettings.prototype.toJSON = function toJSON() { + ScoreMetrics.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AndroidKeySettings; + return ScoreMetrics; })(); - v1.IOSKeySettings = (function() { + v1.ChallengeMetrics = (function() { /** - * Properties of a IOSKeySettings. + * Properties of a ChallengeMetrics. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IIOSKeySettings - * @property {Array.|null} [allowedBundleIds] IOSKeySettings allowedBundleIds + * @interface IChallengeMetrics + * @property {number|Long|null} [pageloadCount] ChallengeMetrics pageloadCount + * @property {number|Long|null} [nocaptchaCount] ChallengeMetrics nocaptchaCount + * @property {number|Long|null} [failedCount] ChallengeMetrics failedCount + * @property {number|Long|null} [passedCount] ChallengeMetrics passedCount */ /** - * Constructs a new IOSKeySettings. + * Constructs a new ChallengeMetrics. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a IOSKeySettings. - * @implements IIOSKeySettings + * @classdesc Represents a ChallengeMetrics. + * @implements IChallengeMetrics * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IChallengeMetrics=} [properties] Properties to set */ - function IOSKeySettings(properties) { - this.allowedBundleIds = []; + function ChallengeMetrics(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4423,78 +6305,114 @@ } /** - * IOSKeySettings allowedBundleIds. - * @member {Array.} allowedBundleIds - * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * ChallengeMetrics pageloadCount. + * @member {number|Long} pageloadCount + * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics * @instance */ - IOSKeySettings.prototype.allowedBundleIds = $util.emptyArray; + ChallengeMetrics.prototype.pageloadCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new IOSKeySettings instance using the specified properties. + * ChallengeMetrics nocaptchaCount. + * @member {number|Long} nocaptchaCount + * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics + * @instance + */ + ChallengeMetrics.prototype.nocaptchaCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ChallengeMetrics failedCount. + * @member {number|Long} failedCount + * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics + * @instance + */ + ChallengeMetrics.prototype.failedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ChallengeMetrics passedCount. + * @member {number|Long} passedCount + * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics + * @instance + */ + ChallengeMetrics.prototype.passedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ChallengeMetrics instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics * @static - * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings instance + * @param {google.cloud.recaptchaenterprise.v1.IChallengeMetrics=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.ChallengeMetrics} ChallengeMetrics instance */ - IOSKeySettings.create = function create(properties) { - return new IOSKeySettings(properties); + ChallengeMetrics.create = function create(properties) { + return new ChallengeMetrics(properties); }; /** - * Encodes the specified IOSKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify|verify} messages. + * Encodes the specified ChallengeMetrics message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ChallengeMetrics.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics * @static - * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings} message IOSKeySettings message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IChallengeMetrics} message ChallengeMetrics message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IOSKeySettings.encode = function encode(message, writer) { + ChallengeMetrics.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowedBundleIds != null && message.allowedBundleIds.length) - for (var i = 0; i < message.allowedBundleIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedBundleIds[i]); + if (message.pageloadCount != null && Object.hasOwnProperty.call(message, "pageloadCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.pageloadCount); + if (message.nocaptchaCount != null && Object.hasOwnProperty.call(message, "nocaptchaCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.nocaptchaCount); + if (message.failedCount != null && Object.hasOwnProperty.call(message, "failedCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedCount); + if (message.passedCount != null && Object.hasOwnProperty.call(message, "passedCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.passedCount); return writer; }; /** - * Encodes the specified IOSKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.IOSKeySettings.verify|verify} messages. + * Encodes the specified ChallengeMetrics message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ChallengeMetrics.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics * @static - * @param {google.cloud.recaptchaenterprise.v1.IIOSKeySettings} message IOSKeySettings message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IChallengeMetrics} message ChallengeMetrics message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IOSKeySettings.encodeDelimited = function encodeDelimited(message, writer) { + ChallengeMetrics.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a IOSKeySettings message from the specified reader or buffer. + * Decodes a ChallengeMetrics message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings + * @returns {google.cloud.recaptchaenterprise.v1.ChallengeMetrics} ChallengeMetrics * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IOSKeySettings.decode = function decode(reader, length) { + ChallengeMetrics.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.allowedBundleIds && message.allowedBundleIds.length)) - message.allowedBundleIds = []; - message.allowedBundleIds.push(reader.string()); + message.pageloadCount = reader.int64(); + break; + case 2: + message.nocaptchaCount = reader.int64(); + break; + case 3: + message.failedCount = reader.int64(); + break; + case 4: + message.passedCount = reader.int64(); break; default: reader.skipType(tag & 7); @@ -4505,99 +6423,168 @@ }; /** - * Decodes a IOSKeySettings message from the specified reader or buffer, length delimited. + * Decodes a ChallengeMetrics message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings + * @returns {google.cloud.recaptchaenterprise.v1.ChallengeMetrics} ChallengeMetrics * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IOSKeySettings.decodeDelimited = function decodeDelimited(reader) { + ChallengeMetrics.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a IOSKeySettings message. + * Verifies a ChallengeMetrics message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IOSKeySettings.verify = function verify(message) { + ChallengeMetrics.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.allowedBundleIds != null && message.hasOwnProperty("allowedBundleIds")) { - if (!Array.isArray(message.allowedBundleIds)) - return "allowedBundleIds: array expected"; - for (var i = 0; i < message.allowedBundleIds.length; ++i) - if (!$util.isString(message.allowedBundleIds[i])) - return "allowedBundleIds: string[] expected"; - } + if (message.pageloadCount != null && message.hasOwnProperty("pageloadCount")) + if (!$util.isInteger(message.pageloadCount) && !(message.pageloadCount && $util.isInteger(message.pageloadCount.low) && $util.isInteger(message.pageloadCount.high))) + return "pageloadCount: integer|Long expected"; + if (message.nocaptchaCount != null && message.hasOwnProperty("nocaptchaCount")) + if (!$util.isInteger(message.nocaptchaCount) && !(message.nocaptchaCount && $util.isInteger(message.nocaptchaCount.low) && $util.isInteger(message.nocaptchaCount.high))) + return "nocaptchaCount: integer|Long expected"; + if (message.failedCount != null && message.hasOwnProperty("failedCount")) + if (!$util.isInteger(message.failedCount) && !(message.failedCount && $util.isInteger(message.failedCount.low) && $util.isInteger(message.failedCount.high))) + return "failedCount: integer|Long expected"; + if (message.passedCount != null && message.hasOwnProperty("passedCount")) + if (!$util.isInteger(message.passedCount) && !(message.passedCount && $util.isInteger(message.passedCount.low) && $util.isInteger(message.passedCount.high))) + return "passedCount: integer|Long expected"; return null; }; /** - * Creates a IOSKeySettings message from a plain object. Also converts values to their respective internal types. + * Creates a ChallengeMetrics message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.IOSKeySettings} IOSKeySettings + * @returns {google.cloud.recaptchaenterprise.v1.ChallengeMetrics} ChallengeMetrics */ - IOSKeySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings) + ChallengeMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings(); - if (object.allowedBundleIds) { - if (!Array.isArray(object.allowedBundleIds)) - throw TypeError(".google.cloud.recaptchaenterprise.v1.IOSKeySettings.allowedBundleIds: array expected"); - message.allowedBundleIds = []; - for (var i = 0; i < object.allowedBundleIds.length; ++i) - message.allowedBundleIds[i] = String(object.allowedBundleIds[i]); - } + var message = new $root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics(); + if (object.pageloadCount != null) + if ($util.Long) + (message.pageloadCount = $util.Long.fromValue(object.pageloadCount)).unsigned = false; + else if (typeof object.pageloadCount === "string") + message.pageloadCount = parseInt(object.pageloadCount, 10); + else if (typeof object.pageloadCount === "number") + message.pageloadCount = object.pageloadCount; + else if (typeof object.pageloadCount === "object") + message.pageloadCount = new $util.LongBits(object.pageloadCount.low >>> 0, object.pageloadCount.high >>> 0).toNumber(); + if (object.nocaptchaCount != null) + if ($util.Long) + (message.nocaptchaCount = $util.Long.fromValue(object.nocaptchaCount)).unsigned = false; + else if (typeof object.nocaptchaCount === "string") + message.nocaptchaCount = parseInt(object.nocaptchaCount, 10); + else if (typeof object.nocaptchaCount === "number") + message.nocaptchaCount = object.nocaptchaCount; + else if (typeof object.nocaptchaCount === "object") + message.nocaptchaCount = new $util.LongBits(object.nocaptchaCount.low >>> 0, object.nocaptchaCount.high >>> 0).toNumber(); + if (object.failedCount != null) + if ($util.Long) + (message.failedCount = $util.Long.fromValue(object.failedCount)).unsigned = false; + else if (typeof object.failedCount === "string") + message.failedCount = parseInt(object.failedCount, 10); + else if (typeof object.failedCount === "number") + message.failedCount = object.failedCount; + else if (typeof object.failedCount === "object") + message.failedCount = new $util.LongBits(object.failedCount.low >>> 0, object.failedCount.high >>> 0).toNumber(); + if (object.passedCount != null) + if ($util.Long) + (message.passedCount = $util.Long.fromValue(object.passedCount)).unsigned = false; + else if (typeof object.passedCount === "string") + message.passedCount = parseInt(object.passedCount, 10); + else if (typeof object.passedCount === "number") + message.passedCount = object.passedCount; + else if (typeof object.passedCount === "object") + message.passedCount = new $util.LongBits(object.passedCount.low >>> 0, object.passedCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a IOSKeySettings message. Also converts values to other types if specified. + * Creates a plain object from a ChallengeMetrics message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics * @static - * @param {google.cloud.recaptchaenterprise.v1.IOSKeySettings} message IOSKeySettings + * @param {google.cloud.recaptchaenterprise.v1.ChallengeMetrics} message ChallengeMetrics * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IOSKeySettings.toObject = function toObject(message, options) { + ChallengeMetrics.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.allowedBundleIds = []; - if (message.allowedBundleIds && message.allowedBundleIds.length) { - object.allowedBundleIds = []; - for (var j = 0; j < message.allowedBundleIds.length; ++j) - object.allowedBundleIds[j] = message.allowedBundleIds[j]; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.pageloadCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.pageloadCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.nocaptchaCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nocaptchaCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.passedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.passedCount = options.longs === String ? "0" : 0; } + if (message.pageloadCount != null && message.hasOwnProperty("pageloadCount")) + if (typeof message.pageloadCount === "number") + object.pageloadCount = options.longs === String ? String(message.pageloadCount) : message.pageloadCount; + else + object.pageloadCount = options.longs === String ? $util.Long.prototype.toString.call(message.pageloadCount) : options.longs === Number ? new $util.LongBits(message.pageloadCount.low >>> 0, message.pageloadCount.high >>> 0).toNumber() : message.pageloadCount; + if (message.nocaptchaCount != null && message.hasOwnProperty("nocaptchaCount")) + if (typeof message.nocaptchaCount === "number") + object.nocaptchaCount = options.longs === String ? String(message.nocaptchaCount) : message.nocaptchaCount; + else + object.nocaptchaCount = options.longs === String ? $util.Long.prototype.toString.call(message.nocaptchaCount) : options.longs === Number ? new $util.LongBits(message.nocaptchaCount.low >>> 0, message.nocaptchaCount.high >>> 0).toNumber() : message.nocaptchaCount; + if (message.failedCount != null && message.hasOwnProperty("failedCount")) + if (typeof message.failedCount === "number") + object.failedCount = options.longs === String ? String(message.failedCount) : message.failedCount; + else + object.failedCount = options.longs === String ? $util.Long.prototype.toString.call(message.failedCount) : options.longs === Number ? new $util.LongBits(message.failedCount.low >>> 0, message.failedCount.high >>> 0).toNumber() : message.failedCount; + if (message.passedCount != null && message.hasOwnProperty("passedCount")) + if (typeof message.passedCount === "number") + object.passedCount = options.longs === String ? String(message.passedCount) : message.passedCount; + else + object.passedCount = options.longs === String ? $util.Long.prototype.toString.call(message.passedCount) : options.longs === Number ? new $util.LongBits(message.passedCount.low >>> 0, message.passedCount.high >>> 0).toNumber() : message.passedCount; return object; }; /** - * Converts this IOSKeySettings to JSON. + * Converts this ChallengeMetrics to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics * @instance * @returns {Object.} JSON object */ - IOSKeySettings.prototype.toJSON = function toJSON() { + ChallengeMetrics.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return IOSKeySettings; + return ChallengeMetrics; })(); return v1; diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index cfe679b002b..a5dc952cb66 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -137,6 +137,40 @@ } } ] + }, + "MigrateKey": { + "requestType": "MigrateKeyRequest", + "responseType": "Key", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/keys/*}:migrate", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/keys/*}:migrate", + "body": "*" + } + } + ] + }, + "GetMetrics": { + "requestType": "GetMetricsRequest", + "responseType": "Metrics", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/keys/*/metrics}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/keys/*/metrics}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] } } }, @@ -173,7 +207,15 @@ "type": "Annotation", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "reasons": { + "rule": "repeated", + "type": "Reason", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } }, @@ -186,6 +228,18 @@ "PASSWORD_CORRECT": 3, "PASSWORD_INCORRECT": 4 } + }, + "Reason": { + "values": { + "REASON_UNSPECIFIED": 0, + "CHARGEBACK": 1, + "PAYMENT_HEURISTICS": 2, + "INITIATED_TWO_FACTOR": 7, + "PASSED_TWO_FACTOR": 3, + "FAILED_TWO_FACTOR": 4, + "CORRECT_PASSWORD": 5, + "INCORRECT_PASSWORD": 6 + } } } }, @@ -320,7 +374,8 @@ "MALFORMED": 2, "EXPIRED": 3, "DUPE": 4, - "MISSING": 5 + "MISSING": 5, + "BROWSER_ERROR": 6 } } } @@ -425,6 +480,59 @@ } } }, + "MigrateKeyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/Key" + } + } + } + }, + "GetMetricsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/Metrics" + } + } + } + }, + "Metrics": { + "options": { + "(google.api.resource).type": "recaptchaenterprise.googleapis.com/Metrics", + "(google.api.resource).pattern": "projects/{project}/keys/{key}/metrics" + }, + "fields": { + "name": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "scoreMetrics": { + "rule": "repeated", + "type": "ScoreMetrics", + "id": 2 + }, + "challengeMetrics": { + "rule": "repeated", + "type": "ChallengeMetrics", + "id": 3 + } + } + }, "Key": { "options": { "(google.api.resource).type": "recaptchaenterprise.googleapis.com/Key", @@ -463,14 +571,36 @@ "labels": { "keyType": "string", "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "id": 6 }, "createTime": { "type": "google.protobuf.Timestamp", "id": 7 + }, + "testingOptions": { + "type": "TestingOptions", + "id": 9 + } + } + }, + "TestingOptions": { + "fields": { + "testingScore": { + "type": "float", + "id": 1 + }, + "testingChallenge": { + "type": "TestingChallenge", + "id": 2 + } + }, + "nested": { + "TestingChallenge": { + "values": { + "TESTING_CHALLENGE_UNSPECIFIED": 0, + "NOCAPTCHA": 1, + "UNSOLVABLE_CHALLENGE": 2 + } } } }, @@ -525,6 +655,10 @@ }, "AndroidKeySettings": { "fields": { + "allowAllPackageNames": { + "type": "bool", + "id": 2 + }, "allowedPackageNames": { "rule": "repeated", "type": "string", @@ -534,12 +668,58 @@ }, "IOSKeySettings": { "fields": { + "allowAllBundleIds": { + "type": "bool", + "id": 2 + }, "allowedBundleIds": { "rule": "repeated", "type": "string", "id": 1 } } + }, + "ScoreDistribution": { + "fields": { + "scoreBuckets": { + "keyType": "int32", + "type": "int64", + "id": 1 + } + } + }, + "ScoreMetrics": { + "fields": { + "overallMetrics": { + "type": "ScoreDistribution", + "id": 1 + }, + "actionMetrics": { + "keyType": "string", + "type": "ScoreDistribution", + "id": 2 + } + } + }, + "ChallengeMetrics": { + "fields": { + "pageloadCount": { + "type": "int64", + "id": 1 + }, + "nocaptchaCount": { + "type": "int64", + "id": 2 + }, + "failedCount": { + "type": "int64", + "id": 3 + }, + "passedCount": { + "type": "int64", + "id": 4 + } + } } } }, diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json b/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json index 182faf09e97..1663f2533fe 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json +++ b/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json @@ -40,6 +40,16 @@ "deleteKey" ] }, + "MigrateKey": { + "methods": [ + "migrateKey" + ] + }, + "GetMetrics": { + "methods": [ + "getMetrics" + ] + }, "ListKeys": { "methods": [ "listKeys", @@ -82,6 +92,16 @@ "deleteKey" ] }, + "MigrateKey": { + "methods": [ + "migrateKey" + ] + }, + "GetMetrics": { + "methods": [ + "getMetrics" + ] + }, "ListKeys": { "methods": [ "listKeys", diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index ce4b941794a..92215b8f2f3 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -171,6 +171,9 @@ export class RecaptchaEnterpriseServiceClient { keyPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/keys/{key}' ), + metricsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/keys/{key}/metrics' + ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), @@ -245,6 +248,8 @@ export class RecaptchaEnterpriseServiceClient { 'getKey', 'updateKey', 'deleteKey', + 'migrateKey', + 'getMetrics', ]; for (const methodName of recaptchaEnterpriseServiceStubMethods) { const callPromise = this.recaptchaEnterpriseServiceStub.then( @@ -463,15 +468,19 @@ export class RecaptchaEnterpriseServiceClient { ): void; /** * Annotates a previously created Assessment to provide additional information - * on whether the event turned out to be authentic or fradulent. + * on whether the event turned out to be authentic or fraudulent. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The resource name of the Assessment, in the format * "projects/{project}/assessments/{assessment}". - * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} request.annotation - * Required. The annotation that will be assigned to the Event. + * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} [request.annotation] + * Optional. The annotation that will be assigned to the Event. This field can be left + * empty to provide reasons that apply to an event without concluding whether + * the event is legitimate or fraudulent. + * @param {number[]} [request.reasons] + * Optional. Optional reasons for the annotation that will be assigned to the Event. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -753,7 +762,7 @@ export class RecaptchaEnterpriseServiceClient { * @param {google.cloud.recaptchaenterprise.v1.Key} request.key * Required. The key to update. * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The mask to control which field of the key get updated. If the mask is not + * Optional. The mask to control which fields of the key get updated. If the mask is not * present, all fields will be updated. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -900,6 +909,196 @@ export class RecaptchaEnterpriseServiceClient { this.initialize(); return this.innerApiCalls.deleteKey(request, options, callback); } + migrateKey( + request?: protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest | undefined, + {} | undefined + ] + >; + migrateKey( + request: protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + migrateKey( + request: protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. + * Once a key is migrated, it can be used from either product. SiteVerify + * requests are billed as CreateAssessment calls. You must be + * authenticated as one of the current owners of the reCAPTCHA Site Key, and + * your user must have the reCAPTCHA Enterprise Admin IAM role in the + * destination project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the key to be migrated, in the format + * "projects/{project}/keys/{key}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * 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.migrateKey(request); + */ + migrateKey( + request?: protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1.IKey, + | protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IKey, + protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest | 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.migrateKey(request, options, callback); + } + getMetrics( + request?: protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IMetrics, + protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest | undefined, + {} | undefined + ] + >; + getMetrics( + request: protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IMetrics, + | protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getMetrics( + request: protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IMetrics, + | protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Get some aggregated metrics for a Key. This data can be used to build + * dashboards. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the requested metrics, in the format + * "projects/{project}/keys/{key}/metrics". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Metrics]{@link google.cloud.recaptchaenterprise.v1.Metrics}. + * 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.getMetrics(request); + */ + getMetrics( + request?: protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.recaptchaenterprise.v1.IMetrics, + | protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1.IMetrics, + | protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IMetrics, + protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest | 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.getMetrics(request, options, callback); + } listKeys( request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, @@ -1179,6 +1378,42 @@ export class RecaptchaEnterpriseServiceClient { return this.pathTemplates.keyPathTemplate.match(keyName).key; } + /** + * Return a fully-qualified metrics resource name string. + * + * @param {string} project + * @param {string} key + * @returns {string} Resource name string. + */ + metricsPath(project: string, key: string) { + return this.pathTemplates.metricsPathTemplate.render({ + project: project, + key: key, + }); + } + + /** + * Parse the project from Metrics resource. + * + * @param {string} metricsName + * A fully-qualified path representing Metrics resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetricsName(metricsName: string) { + return this.pathTemplates.metricsPathTemplate.match(metricsName).project; + } + + /** + * Parse the key from Metrics resource. + * + * @param {string} metricsName + * A fully-qualified path representing Metrics resource. + * @returns {string} A string representing the key. + */ + matchKeyFromMetricsName(metricsName: string) { + return this.pathTemplates.metricsPathTemplate.match(metricsName).key; + } + /** * Return a fully-qualified project resource name string. * diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json index 20e3110145b..ec264c59f16 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json @@ -54,6 +54,14 @@ "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "MigrateKey": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMetrics": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index 634f3810699..e2f0967740f 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -916,6 +916,246 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); }); + describe('migrateKey', () => { + it('invokes migrateKey without error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ); + client.innerApiCalls.migrateKey = stubSimpleCall(expectedResponse); + const [response] = await client.migrateKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.migrateKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes migrateKey without error using callback', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Key() + ); + client.innerApiCalls.migrateKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.migrateKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1.IKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.migrateKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes migrateKey with error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.migrateKey = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.migrateKey(request), expectedError); + assert( + (client.innerApiCalls.migrateKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getMetrics', () => { + it('invokes getMetrics without error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.GetMetricsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Metrics() + ); + client.innerApiCalls.getMetrics = stubSimpleCall(expectedResponse); + const [response] = await client.getMetrics(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getMetrics as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getMetrics without error using callback', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.GetMetricsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.Metrics() + ); + client.innerApiCalls.getMetrics = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMetrics( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1.IMetrics | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getMetrics as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getMetrics with error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.GetMetricsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getMetrics = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getMetrics(request), expectedError); + assert( + (client.innerApiCalls.getMetrics as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listKeys', () => { it('invokes listKeys without error', async () => { const client = @@ -1342,6 +1582,58 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); }); + describe('metrics', () => { + const fakePath = '/rendered/path/metrics'; + const expectedParameters = { + project: 'projectValue', + key: 'keyValue', + }; + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.metricsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metricsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metricsPath', () => { + const result = client.metricsPath('projectValue', 'keyValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metricsPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetricsName', () => { + const result = client.matchProjectFromMetricsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metricsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKeyFromMetricsName', () => { + const result = client.matchKeyFromMetricsName(fakePath); + assert.strictEqual(result, 'keyValue'); + assert( + (client.pathTemplates.metricsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('project', () => { const fakePath = '/rendered/path/project'; const expectedParameters = { From 23268da529103a1184228d3cf838df266b4a458c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 16 Sep 2021 14:16:26 +0000 Subject: [PATCH 197/253] chore: release 2.3.0 (#319) :robot: I have created a release \*beep\* \*boop\* --- ## [2.3.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.2.1...v2.3.0) (2021-09-16) ### Features * add GetMetrics and MigrateKey methods to reCAPTCHA enterprise API ([#318](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/318)) ([55b1adc](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/55b1adc261879db1b073f3ad9cd3453c09d1e8d8)) --- 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-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index bc09af2ead2..2e9cfdcc6cb 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [2.3.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.2.1...v2.3.0) (2021-09-16) + + +### Features + +* add GetMetrics and MigrateKey methods to reCAPTCHA enterprise API ([#318](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/318)) ([55b1adc](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/55b1adc261879db1b073f3ad9cd3453c09d1e8d8)) + ### [2.2.1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.2.0...v2.2.1) (2021-09-09) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index ec4efaf17a7..bd2863d72e4 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.2.1", + "version": "2.3.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index c47841fa77d..6da8f225f2f 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.2.1" + "@google-cloud/recaptcha-enterprise": "^2.3.0" }, "devDependencies": { "chai": "^4.2.0", From 5e38c393349375e3a6d56263a87edaf203f0d965 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Tue, 21 Sep 2021 07:16:37 -0700 Subject: [PATCH 198/253] chore: relocate owl bot post processor (#321) chore: relocate owl bot post processor --- packages/google-cloud-recaptchaenterprise/.github/.OwlBot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/.github/.OwlBot.yaml b/packages/google-cloud-recaptchaenterprise/.github/.OwlBot.yaml index 4c123611662..890be06bca1 100644 --- a/packages/google-cloud-recaptchaenterprise/.github/.OwlBot.yaml +++ b/packages/google-cloud-recaptchaenterprise/.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 6ceb5f9943fbdcd24cf514d15aefacce0668bcab Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 14 Oct 2021 00:48:24 +0000 Subject: [PATCH 199/253] build(node): update deps used during postprocessing (#1243) (#326) --- .../protos/protos.d.ts | 3 ++- .../protos/protos.js | 7 +++++++ .../protos/protos.json | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 95e5c6bcce3..41b0006fecd 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -4905,7 +4905,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-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index c667be10859..17c66f5c58c 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -11782,6 +11782,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); @@ -11792,6 +11793,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; })(); @@ -17960,6 +17962,7 @@ case 4: case 5: case 6: + case 7: break; } } @@ -18064,6 +18067,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-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index a5dc952cb66..22c3cee08c0 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -1370,7 +1370,8 @@ "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, "IMMUTABLE": 5, - "UNORDERED_LIST": 6 + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 } }, "resourceReference": { @@ -2013,6 +2014,18 @@ ] ], "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], [ 8, 8 From a92f88e9ff4a4f4fce60d386b5ae332077defc5c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 26 Oct 2021 23:19:13 +0200 Subject: [PATCH 200/253] chore(deps): update dependency @types/node to v16 (#327) 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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index bd2863d72e4..9d7db45b30c 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -29,7 +29,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^14.0.0", + "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.0.0", "gts": "^2.0.0", From 03a35e59e271906f606754540007e84b3fce88c6 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Thu, 4 Nov 2021 11:52:16 -0400 Subject: [PATCH 201/253] chore(cloud-rad): delete api-extractor config (#330) --- .../api-extractor.json | 369 ------------------ 1 file changed, 369 deletions(-) delete mode 100644 packages/google-cloud-recaptchaenterprise/api-extractor.json diff --git a/packages/google-cloud-recaptchaenterprise/api-extractor.json b/packages/google-cloud-recaptchaenterprise/api-extractor.json deleted file mode 100644 index de228294b23..00000000000 --- a/packages/google-cloud-recaptchaenterprise/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 1b3764b51b20a607b53376e21c89d2c6647c0e2d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 4 Nov 2021 20:40:15 +0100 Subject: [PATCH 202/253] chore(deps): update dependency sinon to v12 (#329) 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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 9d7db45b30c..43c8b2d7daf 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -40,7 +40,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 e51fe589f0bfd000e80541d4ef6a1c014fe33e1f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:55:26 -0800 Subject: [PATCH 203/253] feat: add reCAPTCHA Enterprise account defender API methods (#328) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add reCAPTCHA Enterprise account defender API methods This cl adds the following API methods to support the Preview release of reCAPTCHA Enterprise account defender: ListRelatedAccountGroups, ListRelatedAccountGroupMemberships, and SearchRelatedAccountGroupMemberships. Additionally it modifies the existing createAssessment API method to add a new hashed_account_id parameter along with AccountDefenderAssessment return value. PiperOrigin-RevId: 407130991 Source-Link: https://github.com/googleapis/googleapis/commit/d58e602ed8a92b8d21da92543528fa5980be6811 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d1b97bf27608e42b5324f65916b16986d855e1b9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDFiOTdiZjI3NjA4ZTQyYjUzMjRmNjU5MTZiMTY5ODZkODU1ZTFiOSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: change supported node version Co-authored-by: Owl Bot Co-authored-by: Takashi Matsuo --- .../v1/recaptchaenterprise.proto | 235 +- .../protos/protos.d.ts | 969 +++++++ .../protos/protos.js | 2275 +++++++++++++++++ .../protos/protos.json | 259 +- ..._enterprise_service.annotate_assessment.js | 74 + ...ha_enterprise_service.create_assessment.js | 59 + ...recaptcha_enterprise_service.create_key.js | 59 + ...recaptcha_enterprise_service.delete_key.js | 54 + .../recaptcha_enterprise_service.get_key.js | 54 + ...ecaptcha_enterprise_service.get_metrics.js | 54 + .../recaptcha_enterprise_service.list_keys.js | 66 + ....list_related_account_group_memberships.js | 74 + ...ise_service.list_related_account_groups.js | 72 + ...ecaptcha_enterprise_service.migrate_key.js | 54 + ...earch_related_account_group_memberships.js | 81 + ...recaptcha_enterprise_service.update_key.js | 58 + ...se_service_v1_beta1.annotate_assessment.js | 62 + ...rise_service_v1_beta1.create_assessment.js | 60 + ..._enterprise_service_v1_beta1.create_key.js | 60 + ..._enterprise_service_v1_beta1.delete_key.js | 55 + ...cha_enterprise_service_v1_beta1.get_key.js | 55 + ...a_enterprise_service_v1_beta1.list_keys.js | 67 + ..._enterprise_service_v1_beta1.update_key.js | 59 + .../samples/package.json | 2 +- .../src/v1/gapic_metadata.json | 42 + .../v1/recaptcha_enterprise_service_client.ts | 835 +++++- ...tcha_enterprise_service_client_config.json | 12 + ...tcha_enterprise_service_v1_beta1_client.ts | 6 +- .../gapic_recaptcha_enterprise_service_v1.ts | 1219 +++++++++ 29 files changed, 7015 insertions(+), 16 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index c28fbde79e3..a2dd1ba2040 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -115,6 +115,31 @@ service RecaptchaEnterpriseService { }; option (google.api.method_signature) = "name"; } + + // List groups of related accounts. + rpc ListRelatedAccountGroups(ListRelatedAccountGroupsRequest) returns (ListRelatedAccountGroupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/relatedaccountgroups" + }; + option (google.api.method_signature) = "parent"; + } + + // Get the memberships in a group of related accounts. + rpc ListRelatedAccountGroupMemberships(ListRelatedAccountGroupMembershipsRequest) returns (ListRelatedAccountGroupMembershipsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/relatedaccountgroups/*}/memberships" + }; + option (google.api.method_signature) = "parent"; + } + + // Search group memberships related to a given account. + rpc SearchRelatedAccountGroupMemberships(SearchRelatedAccountGroupMembershipsRequest) returns (SearchRelatedAccountGroupMembershipsResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/relatedaccountgroupmemberships:search" + body: "*" + }; + option (google.api.method_signature) = "parent,hashed_account_id"; + } } // The create assessment request message. @@ -205,6 +230,13 @@ message AnnotateAssessmentRequest { // Optional. Optional reasons for the annotation that will be assigned to the Event. repeated Reason reasons = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional unique stable hashed user identifier to apply to the assessment. + // This is an alternative to setting the hashed_account_id in + // CreateAssessment, for example when the account identifier is not yet known + // in the initial request. It is recommended that the identifier is hashed + // using hmac-sha256 with stable secret. + bytes hashed_account_id = 4 [(google.api.field_behavior) = OPTIONAL]; } // Empty response for AnnotateAssessment. @@ -231,6 +263,10 @@ message Assessment { // Output only. Properties of the provided event token. TokenProperties token_properties = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Assessment returned by Account Defender when a hashed_account_id is + // provided. + AccountDefenderAssessment account_defender_assessment = 6; } message Event { @@ -253,6 +289,10 @@ message Event { // provided at token generation time on client-side platforms already // integrated with recaptcha enterprise. string expected_action = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional unique stable hashed user identifier for the request. The + // identifier should ideally be hashed using sha256 with stable secret. + bytes hashed_account_id = 6 [(google.api.field_behavior) = OPTIONAL]; } // Risk analysis result for an event. @@ -335,6 +375,34 @@ message TokenProperties { string action = 5; } +// Account Defender risk assessment. +message AccountDefenderAssessment { + // Labels returned by Account Defender for this request. + enum AccountDefenderLabel { + // Default unspecified type. + ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0; + + // The request matches a known good profile for the user. + PROFILE_MATCH = 1; + + // The request is potentially a suspicious login event and should be further + // verified either via multi-factor authentication or another system. + SUSPICIOUS_LOGIN_ACTIVITY = 2; + + // The request matched a profile that previously had suspicious account + // creation behavior. This could mean this is a fake account. + SUSPICIOUS_ACCOUNT_CREATION = 3; + + // The account in the request has a high number of related accounts. It does + // not necessarily imply that the account is bad but could require + // investigating. + RELATED_ACCOUNTS_NUMBER_HIGH = 4; + } + + // Labels for this request. + repeated AccountDefenderLabel labels = 1; +} + // The create key request message. message CreateKeyRequest { // Required. The name of the project in which the key will be created, in the @@ -510,11 +578,11 @@ message TestingOptions { // challenge depending on risk and trust factors. TESTING_CHALLENGE_UNSPECIFIED = 0; - // Challenge requests for this key will always return a nocaptcha, which + // Challenge requests for this key always return a nocaptcha, which // does not require a solution. NOCAPTCHA = 1; - // Challenge requests for this key will always return an unsolvable + // Challenge requests for this key always return an unsolvable // challenge. UNSOLVABLE_CHALLENGE = 2; } @@ -576,9 +644,9 @@ message WebKeySettings { // Examples: 'example.com' or 'subdomain.example.com' repeated string allowed_domains = 1; - // Required. Whether this key can be used on AMP (Accelerated Mobile Pages) websites. - // This can only be set for the SCORE integration type. - bool allow_amp_traffic = 2 [(google.api.field_behavior) = REQUIRED]; + // If set to true, the key can be used on AMP (Accelerated Mobile Pages) + // websites. This is supported only for the SCORE integration type. + bool allow_amp_traffic = 2; // Required. Describes how this key is integrated with the website. IntegrationType integration_type = 4 [(google.api.field_behavior) = REQUIRED]; @@ -591,7 +659,7 @@ message WebKeySettings { // Settings specific to keys that can be used by Android apps. message AndroidKeySettings { - // If set to true, it means allowed_package_names will not be enforced. + // If set to true, allowed_package_names are not enforced. bool allow_all_package_names = 2; // Android package names of apps allowed to use the key. @@ -601,7 +669,7 @@ message AndroidKeySettings { // Settings specific to keys that can be used by iOS apps. message IOSKeySettings { - // If set to true, it means allowed_bundle_ids will not be enforced. + // If set to true, allowed_bundle_ids are not enforced. bool allow_all_bundle_ids = 2; // iOS bundle ids of apps allowed to use the key. @@ -646,3 +714,156 @@ message ChallengeMetrics { // verification. int64 passed_count = 4; } + +// The request message to list memberships in a related account group. +message ListRelatedAccountGroupMembershipsRequest { + // Required. The resource name for the related account group in the format + // `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership" + } + ]; + + // Optional. The maximum number of accounts to return. The service may return fewer than + // this value. + // If unspecified, at most 50 accounts will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` + // call. + // + // When paginating, all other parameters provided to + // `ListRelatedAccountGroupMemberships` must match the call that provided the + // page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response to a `ListRelatedAccountGroupMemberships` call. +message ListRelatedAccountGroupMembershipsResponse { + // The memberships listed by the query. + repeated RelatedAccountGroupMembership related_account_group_memberships = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The request message to list related account groups. +message ListRelatedAccountGroupsRequest { + // Required. The name of the project to list related account groups from, in the format + // "projects/{project}". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "recaptchaenterprise.googleapis.com/RelatedAccountGroup" + } + ]; + + // Optional. The maximum number of groups to return. The service may return fewer than + // this value. + // If unspecified, at most 50 groups will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListRelatedAccountGroups` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListRelatedAccountGroups` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response to a `ListRelatedAccountGroups` call. +message ListRelatedAccountGroupsResponse { + // The groups of related accounts listed by the query. + repeated RelatedAccountGroup related_account_groups = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The request message to search related account group memberships. +message SearchRelatedAccountGroupMembershipsRequest { + // Required. The name of the project to search related account group memberships from, + // in the format "projects/{project}". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership" + } + ]; + + // Optional. The unique stable hashed user identifier we should search connections to. + // The identifier should correspond to a `hashed_account_id` provided in a + // previous CreateAssessment or AnnotateAssessment call. + bytes hashed_account_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of groups to return. The service may return fewer than + // this value. + // If unspecified, at most 50 groups will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the + // subsequent page. + // + // When paginating, all other parameters provided to + // `SearchRelatedAccountGroupMemberships` must match the call that provided + // the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response to a `SearchRelatedAccountGroupMemberships` call. +message SearchRelatedAccountGroupMembershipsResponse { + // The queried memberships. + repeated RelatedAccountGroupMembership related_account_group_memberships = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// A membership in a group of related accounts. +message RelatedAccountGroupMembership { + option (google.api.resource) = { + type: "recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership" + pattern: "projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}" + }; + + // Required. The resource name for this membership in the format + // `projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership" + } + ]; + + // The unique stable hashed user identifier of the member. The identifier + // corresponds to a `hashed_account_id` provided in a previous + // CreateAssessment or AnnotateAssessment call. + bytes hashed_account_id = 2; +} + +// A group of related accounts. +message RelatedAccountGroup { + option (google.api.resource) = { + type: "recaptchaenterprise.googleapis.com/RelatedAccountGroup" + pattern: "projects/{project}/relatedaccountgroups/{relatedaccountgroup}" + }; + + // Required. The resource name for the related account group in the format + // `projects/{project}/relatedaccountgroups/{related_account_group}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/RelatedAccountGroup" + } + ]; +} diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 41b0006fecd..5f2fd7b03af 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -171,6 +171,48 @@ export namespace google { * @returns Promise */ public getMetrics(request: google.cloud.recaptchaenterprise.v1.IGetMetricsRequest): Promise; + + /** + * Calls ListRelatedAccountGroups. + * @param request ListRelatedAccountGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRelatedAccountGroupsResponse + */ + public listRelatedAccountGroups(request: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, callback: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroupsCallback): void; + + /** + * Calls ListRelatedAccountGroups. + * @param request ListRelatedAccountGroupsRequest message or plain object + * @returns Promise + */ + public listRelatedAccountGroups(request: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest): Promise; + + /** + * Calls ListRelatedAccountGroupMemberships. + * @param request ListRelatedAccountGroupMembershipsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRelatedAccountGroupMembershipsResponse + */ + public listRelatedAccountGroupMemberships(request: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, callback: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroupMembershipsCallback): void; + + /** + * Calls ListRelatedAccountGroupMemberships. + * @param request ListRelatedAccountGroupMembershipsRequest message or plain object + * @returns Promise + */ + public listRelatedAccountGroupMemberships(request: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest): Promise; + + /** + * Calls SearchRelatedAccountGroupMemberships. + * @param request SearchRelatedAccountGroupMembershipsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchRelatedAccountGroupMembershipsResponse + */ + public searchRelatedAccountGroupMemberships(request: google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, callback: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.SearchRelatedAccountGroupMembershipsCallback): void; + + /** + * Calls SearchRelatedAccountGroupMemberships. + * @param request SearchRelatedAccountGroupMembershipsRequest message or plain object + * @returns Promise + */ + public searchRelatedAccountGroupMemberships(request: google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest): Promise; } namespace RecaptchaEnterpriseService { @@ -237,6 +279,27 @@ export namespace google { * @param [response] Metrics */ type GetMetricsCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.Metrics) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#listRelatedAccountGroups}. + * @param error Error, if any + * @param [response] ListRelatedAccountGroupsResponse + */ + type ListRelatedAccountGroupsCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#listRelatedAccountGroupMemberships}. + * @param error Error, if any + * @param [response] ListRelatedAccountGroupMembershipsResponse + */ + type ListRelatedAccountGroupMembershipsCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse) => void; + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#searchRelatedAccountGroupMemberships}. + * @param error Error, if any + * @param [response] SearchRelatedAccountGroupMembershipsResponse + */ + type SearchRelatedAccountGroupMembershipsCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse) => void; } /** Properties of a CreateAssessmentRequest. */ @@ -346,6 +409,9 @@ export namespace google { /** AnnotateAssessmentRequest reasons */ reasons?: (google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason[]|null); + + /** AnnotateAssessmentRequest hashedAccountId */ + hashedAccountId?: (Uint8Array|string|null); } /** Represents an AnnotateAssessmentRequest. */ @@ -366,6 +432,9 @@ export namespace google { /** AnnotateAssessmentRequest reasons. */ public reasons: google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason[]; + /** AnnotateAssessmentRequest hashedAccountId. */ + public hashedAccountId: (Uint8Array|string); + /** * Creates a new AnnotateAssessmentRequest instance using the specified properties. * @param [properties] Properties to set @@ -559,6 +628,9 @@ export namespace google { /** Assessment tokenProperties */ tokenProperties?: (google.cloud.recaptchaenterprise.v1.ITokenProperties|null); + + /** Assessment accountDefenderAssessment */ + accountDefenderAssessment?: (google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment|null); } /** Represents an Assessment. */ @@ -582,6 +654,9 @@ export namespace google { /** Assessment tokenProperties. */ public tokenProperties?: (google.cloud.recaptchaenterprise.v1.ITokenProperties|null); + /** Assessment accountDefenderAssessment. */ + public accountDefenderAssessment?: (google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment|null); + /** * Creates a new Assessment instance using the specified properties. * @param [properties] Properties to set @@ -670,6 +745,9 @@ export namespace google { /** Event expectedAction */ expectedAction?: (string|null); + + /** Event hashedAccountId */ + hashedAccountId?: (Uint8Array|string|null); } /** Represents an Event. */ @@ -696,6 +774,9 @@ export namespace google { /** Event expectedAction. */ public expectedAction: string; + /** Event hashedAccountId. */ + public hashedAccountId: (Uint8Array|string); + /** * Creates a new Event instance using the specified properties. * @param [properties] Properties to set @@ -1004,6 +1085,108 @@ export namespace google { } } + /** Properties of an AccountDefenderAssessment. */ + interface IAccountDefenderAssessment { + + /** AccountDefenderAssessment labels */ + labels?: (google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel[]|null); + } + + /** Represents an AccountDefenderAssessment. */ + class AccountDefenderAssessment implements IAccountDefenderAssessment { + + /** + * Constructs a new AccountDefenderAssessment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment); + + /** AccountDefenderAssessment labels. */ + public labels: google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel[]; + + /** + * Creates a new AccountDefenderAssessment instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountDefenderAssessment instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment): google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment; + + /** + * Encodes the specified AccountDefenderAssessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify|verify} messages. + * @param message AccountDefenderAssessment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccountDefenderAssessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify|verify} messages. + * @param message AccountDefenderAssessment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountDefenderAssessment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccountDefenderAssessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment; + + /** + * Decodes an AccountDefenderAssessment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccountDefenderAssessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment; + + /** + * Verifies an AccountDefenderAssessment message. + * @param message Plain 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 AccountDefenderAssessment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccountDefenderAssessment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment; + + /** + * Creates a plain object from an AccountDefenderAssessment message. Also converts values to other types if specified. + * @param message AccountDefenderAssessment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccountDefenderAssessment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AccountDefenderAssessment { + + /** AccountDefenderLabel enum. */ + enum AccountDefenderLabel { + ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0, + PROFILE_MATCH = 1, + SUSPICIOUS_LOGIN_ACTIVITY = 2, + SUSPICIOUS_ACCOUNT_CREATION = 3, + RELATED_ACCOUNTS_NUMBER_HIGH = 4 + } + } + /** Properties of a CreateKeyRequest. */ interface ICreateKeyRequest { @@ -2721,6 +2904,792 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Properties of a ListRelatedAccountGroupMembershipsRequest. */ + interface IListRelatedAccountGroupMembershipsRequest { + + /** ListRelatedAccountGroupMembershipsRequest parent */ + parent?: (string|null); + + /** ListRelatedAccountGroupMembershipsRequest pageSize */ + pageSize?: (number|null); + + /** ListRelatedAccountGroupMembershipsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListRelatedAccountGroupMembershipsRequest. */ + class ListRelatedAccountGroupMembershipsRequest implements IListRelatedAccountGroupMembershipsRequest { + + /** + * Constructs a new ListRelatedAccountGroupMembershipsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest); + + /** ListRelatedAccountGroupMembershipsRequest parent. */ + public parent: string; + + /** ListRelatedAccountGroupMembershipsRequest pageSize. */ + public pageSize: number; + + /** ListRelatedAccountGroupMembershipsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListRelatedAccountGroupMembershipsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRelatedAccountGroupMembershipsRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest): google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest; + + /** + * Encodes the specified ListRelatedAccountGroupMembershipsRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest.verify|verify} messages. + * @param message ListRelatedAccountGroupMembershipsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRelatedAccountGroupMembershipsRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest.verify|verify} messages. + * @param message ListRelatedAccountGroupMembershipsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRelatedAccountGroupMembershipsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRelatedAccountGroupMembershipsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest; + + /** + * Decodes a ListRelatedAccountGroupMembershipsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRelatedAccountGroupMembershipsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest; + + /** + * Verifies a ListRelatedAccountGroupMembershipsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRelatedAccountGroupMembershipsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRelatedAccountGroupMembershipsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest; + + /** + * Creates a plain object from a ListRelatedAccountGroupMembershipsRequest message. Also converts values to other types if specified. + * @param message ListRelatedAccountGroupMembershipsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRelatedAccountGroupMembershipsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRelatedAccountGroupMembershipsResponse. */ + interface IListRelatedAccountGroupMembershipsResponse { + + /** ListRelatedAccountGroupMembershipsResponse relatedAccountGroupMemberships */ + relatedAccountGroupMemberships?: (google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[]|null); + + /** ListRelatedAccountGroupMembershipsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListRelatedAccountGroupMembershipsResponse. */ + class ListRelatedAccountGroupMembershipsResponse implements IListRelatedAccountGroupMembershipsResponse { + + /** + * Constructs a new ListRelatedAccountGroupMembershipsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse); + + /** ListRelatedAccountGroupMembershipsResponse relatedAccountGroupMemberships. */ + public relatedAccountGroupMemberships: google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[]; + + /** ListRelatedAccountGroupMembershipsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListRelatedAccountGroupMembershipsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRelatedAccountGroupMembershipsResponse instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse): google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse; + + /** + * Encodes the specified ListRelatedAccountGroupMembershipsResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse.verify|verify} messages. + * @param message ListRelatedAccountGroupMembershipsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRelatedAccountGroupMembershipsResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse.verify|verify} messages. + * @param message ListRelatedAccountGroupMembershipsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRelatedAccountGroupMembershipsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRelatedAccountGroupMembershipsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse; + + /** + * Decodes a ListRelatedAccountGroupMembershipsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRelatedAccountGroupMembershipsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse; + + /** + * Verifies a ListRelatedAccountGroupMembershipsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRelatedAccountGroupMembershipsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRelatedAccountGroupMembershipsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse; + + /** + * Creates a plain object from a ListRelatedAccountGroupMembershipsResponse message. Also converts values to other types if specified. + * @param message ListRelatedAccountGroupMembershipsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRelatedAccountGroupMembershipsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRelatedAccountGroupsRequest. */ + interface IListRelatedAccountGroupsRequest { + + /** ListRelatedAccountGroupsRequest parent */ + parent?: (string|null); + + /** ListRelatedAccountGroupsRequest pageSize */ + pageSize?: (number|null); + + /** ListRelatedAccountGroupsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListRelatedAccountGroupsRequest. */ + class ListRelatedAccountGroupsRequest implements IListRelatedAccountGroupsRequest { + + /** + * Constructs a new ListRelatedAccountGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest); + + /** ListRelatedAccountGroupsRequest parent. */ + public parent: string; + + /** ListRelatedAccountGroupsRequest pageSize. */ + public pageSize: number; + + /** ListRelatedAccountGroupsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListRelatedAccountGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRelatedAccountGroupsRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest): google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest; + + /** + * Encodes the specified ListRelatedAccountGroupsRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest.verify|verify} messages. + * @param message ListRelatedAccountGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRelatedAccountGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest.verify|verify} messages. + * @param message ListRelatedAccountGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRelatedAccountGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRelatedAccountGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest; + + /** + * Decodes a ListRelatedAccountGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRelatedAccountGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest; + + /** + * Verifies a ListRelatedAccountGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRelatedAccountGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRelatedAccountGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest; + + /** + * Creates a plain object from a ListRelatedAccountGroupsRequest message. Also converts values to other types if specified. + * @param message ListRelatedAccountGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRelatedAccountGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRelatedAccountGroupsResponse. */ + interface IListRelatedAccountGroupsResponse { + + /** ListRelatedAccountGroupsResponse relatedAccountGroups */ + relatedAccountGroups?: (google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup[]|null); + + /** ListRelatedAccountGroupsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListRelatedAccountGroupsResponse. */ + class ListRelatedAccountGroupsResponse implements IListRelatedAccountGroupsResponse { + + /** + * Constructs a new ListRelatedAccountGroupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse); + + /** ListRelatedAccountGroupsResponse relatedAccountGroups. */ + public relatedAccountGroups: google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup[]; + + /** ListRelatedAccountGroupsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListRelatedAccountGroupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRelatedAccountGroupsResponse instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse): google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse; + + /** + * Encodes the specified ListRelatedAccountGroupsResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse.verify|verify} messages. + * @param message ListRelatedAccountGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRelatedAccountGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse.verify|verify} messages. + * @param message ListRelatedAccountGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRelatedAccountGroupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRelatedAccountGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse; + + /** + * Decodes a ListRelatedAccountGroupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRelatedAccountGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse; + + /** + * Verifies a ListRelatedAccountGroupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRelatedAccountGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRelatedAccountGroupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse; + + /** + * Creates a plain object from a ListRelatedAccountGroupsResponse message. Also converts values to other types if specified. + * @param message ListRelatedAccountGroupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRelatedAccountGroupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SearchRelatedAccountGroupMembershipsRequest. */ + interface ISearchRelatedAccountGroupMembershipsRequest { + + /** SearchRelatedAccountGroupMembershipsRequest parent */ + parent?: (string|null); + + /** SearchRelatedAccountGroupMembershipsRequest hashedAccountId */ + hashedAccountId?: (Uint8Array|string|null); + + /** SearchRelatedAccountGroupMembershipsRequest pageSize */ + pageSize?: (number|null); + + /** SearchRelatedAccountGroupMembershipsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a SearchRelatedAccountGroupMembershipsRequest. */ + class SearchRelatedAccountGroupMembershipsRequest implements ISearchRelatedAccountGroupMembershipsRequest { + + /** + * Constructs a new SearchRelatedAccountGroupMembershipsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest); + + /** SearchRelatedAccountGroupMembershipsRequest parent. */ + public parent: string; + + /** SearchRelatedAccountGroupMembershipsRequest hashedAccountId. */ + public hashedAccountId: (Uint8Array|string); + + /** SearchRelatedAccountGroupMembershipsRequest pageSize. */ + public pageSize: number; + + /** SearchRelatedAccountGroupMembershipsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new SearchRelatedAccountGroupMembershipsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchRelatedAccountGroupMembershipsRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest): google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest; + + /** + * Encodes the specified SearchRelatedAccountGroupMembershipsRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest.verify|verify} messages. + * @param message SearchRelatedAccountGroupMembershipsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchRelatedAccountGroupMembershipsRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest.verify|verify} messages. + * @param message SearchRelatedAccountGroupMembershipsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchRelatedAccountGroupMembershipsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchRelatedAccountGroupMembershipsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest; + + /** + * Decodes a SearchRelatedAccountGroupMembershipsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchRelatedAccountGroupMembershipsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest; + + /** + * Verifies a SearchRelatedAccountGroupMembershipsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchRelatedAccountGroupMembershipsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchRelatedAccountGroupMembershipsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest; + + /** + * Creates a plain object from a SearchRelatedAccountGroupMembershipsRequest message. Also converts values to other types if specified. + * @param message SearchRelatedAccountGroupMembershipsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchRelatedAccountGroupMembershipsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SearchRelatedAccountGroupMembershipsResponse. */ + interface ISearchRelatedAccountGroupMembershipsResponse { + + /** SearchRelatedAccountGroupMembershipsResponse relatedAccountGroupMemberships */ + relatedAccountGroupMemberships?: (google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[]|null); + + /** SearchRelatedAccountGroupMembershipsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchRelatedAccountGroupMembershipsResponse. */ + class SearchRelatedAccountGroupMembershipsResponse implements ISearchRelatedAccountGroupMembershipsResponse { + + /** + * Constructs a new SearchRelatedAccountGroupMembershipsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse); + + /** SearchRelatedAccountGroupMembershipsResponse relatedAccountGroupMemberships. */ + public relatedAccountGroupMemberships: google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[]; + + /** SearchRelatedAccountGroupMembershipsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchRelatedAccountGroupMembershipsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchRelatedAccountGroupMembershipsResponse instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse): google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse; + + /** + * Encodes the specified SearchRelatedAccountGroupMembershipsResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse.verify|verify} messages. + * @param message SearchRelatedAccountGroupMembershipsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchRelatedAccountGroupMembershipsResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse.verify|verify} messages. + * @param message SearchRelatedAccountGroupMembershipsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchRelatedAccountGroupMembershipsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchRelatedAccountGroupMembershipsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse; + + /** + * Decodes a SearchRelatedAccountGroupMembershipsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchRelatedAccountGroupMembershipsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse; + + /** + * Verifies a SearchRelatedAccountGroupMembershipsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchRelatedAccountGroupMembershipsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchRelatedAccountGroupMembershipsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse; + + /** + * Creates a plain object from a SearchRelatedAccountGroupMembershipsResponse message. Also converts values to other types if specified. + * @param message SearchRelatedAccountGroupMembershipsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchRelatedAccountGroupMembershipsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RelatedAccountGroupMembership. */ + interface IRelatedAccountGroupMembership { + + /** RelatedAccountGroupMembership name */ + name?: (string|null); + + /** RelatedAccountGroupMembership hashedAccountId */ + hashedAccountId?: (Uint8Array|string|null); + } + + /** Represents a RelatedAccountGroupMembership. */ + class RelatedAccountGroupMembership implements IRelatedAccountGroupMembership { + + /** + * Constructs a new RelatedAccountGroupMembership. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership); + + /** RelatedAccountGroupMembership name. */ + public name: string; + + /** RelatedAccountGroupMembership hashedAccountId. */ + public hashedAccountId: (Uint8Array|string); + + /** + * Creates a new RelatedAccountGroupMembership instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedAccountGroupMembership instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership): google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership; + + /** + * Encodes the specified RelatedAccountGroupMembership message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.verify|verify} messages. + * @param message RelatedAccountGroupMembership message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedAccountGroupMembership message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.verify|verify} messages. + * @param message RelatedAccountGroupMembership message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedAccountGroupMembership message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedAccountGroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership; + + /** + * Decodes a RelatedAccountGroupMembership message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedAccountGroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership; + + /** + * Verifies a RelatedAccountGroupMembership message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RelatedAccountGroupMembership message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedAccountGroupMembership + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership; + + /** + * Creates a plain object from a RelatedAccountGroupMembership message. Also converts values to other types if specified. + * @param message RelatedAccountGroupMembership + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedAccountGroupMembership to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RelatedAccountGroup. */ + interface IRelatedAccountGroup { + + /** RelatedAccountGroup name */ + name?: (string|null); + } + + /** Represents a RelatedAccountGroup. */ + class RelatedAccountGroup implements IRelatedAccountGroup { + + /** + * Constructs a new RelatedAccountGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup); + + /** RelatedAccountGroup name. */ + public name: string; + + /** + * Creates a new RelatedAccountGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedAccountGroup instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup): google.cloud.recaptchaenterprise.v1.RelatedAccountGroup; + + /** + * Encodes the specified RelatedAccountGroup message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroup.verify|verify} messages. + * @param message RelatedAccountGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedAccountGroup message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroup.verify|verify} messages. + * @param message RelatedAccountGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedAccountGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedAccountGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.RelatedAccountGroup; + + /** + * Decodes a RelatedAccountGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedAccountGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.RelatedAccountGroup; + + /** + * Verifies a RelatedAccountGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RelatedAccountGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedAccountGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.RelatedAccountGroup; + + /** + * Creates a plain object from a RelatedAccountGroup message. Also converts values to other types if specified. + * @param message RelatedAccountGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.RelatedAccountGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedAccountGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } /** Namespace v1beta1. */ diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 17c66f5c58c..b415fed0ab7 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -395,6 +395,105 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#listRelatedAccountGroups}. + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @typedef ListRelatedAccountGroupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse} [response] ListRelatedAccountGroupsResponse + */ + + /** + * Calls ListRelatedAccountGroups. + * @function listRelatedAccountGroups + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest} request ListRelatedAccountGroupsRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroupsCallback} callback Node-style callback called with the error, if any, and ListRelatedAccountGroupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseService.prototype.listRelatedAccountGroups = function listRelatedAccountGroups(request, callback) { + return this.rpcCall(listRelatedAccountGroups, $root.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest, $root.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse, request, callback); + }, "name", { value: "ListRelatedAccountGroups" }); + + /** + * Calls ListRelatedAccountGroups. + * @function listRelatedAccountGroups + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest} request ListRelatedAccountGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#listRelatedAccountGroupMemberships}. + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @typedef ListRelatedAccountGroupMembershipsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse} [response] ListRelatedAccountGroupMembershipsResponse + */ + + /** + * Calls ListRelatedAccountGroupMemberships. + * @function listRelatedAccountGroupMemberships + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest} request ListRelatedAccountGroupMembershipsRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroupMembershipsCallback} callback Node-style callback called with the error, if any, and ListRelatedAccountGroupMembershipsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseService.prototype.listRelatedAccountGroupMemberships = function listRelatedAccountGroupMemberships(request, callback) { + return this.rpcCall(listRelatedAccountGroupMemberships, $root.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest, $root.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse, request, callback); + }, "name", { value: "ListRelatedAccountGroupMemberships" }); + + /** + * Calls ListRelatedAccountGroupMemberships. + * @function listRelatedAccountGroupMemberships + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest} request ListRelatedAccountGroupMembershipsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#searchRelatedAccountGroupMemberships}. + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @typedef SearchRelatedAccountGroupMembershipsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse} [response] SearchRelatedAccountGroupMembershipsResponse + */ + + /** + * Calls SearchRelatedAccountGroupMemberships. + * @function searchRelatedAccountGroupMemberships + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest} request SearchRelatedAccountGroupMembershipsRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.SearchRelatedAccountGroupMembershipsCallback} callback Node-style callback called with the error, if any, and SearchRelatedAccountGroupMembershipsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseService.prototype.searchRelatedAccountGroupMemberships = function searchRelatedAccountGroupMemberships(request, callback) { + return this.rpcCall(searchRelatedAccountGroupMemberships, $root.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest, $root.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse, request, callback); + }, "name", { value: "SearchRelatedAccountGroupMemberships" }); + + /** + * Calls SearchRelatedAccountGroupMemberships. + * @function searchRelatedAccountGroupMemberships + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest} request SearchRelatedAccountGroupMembershipsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return RecaptchaEnterpriseService; })(); @@ -622,6 +721,7 @@ * @property {string|null} [name] AnnotateAssessmentRequest name * @property {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation|null} [annotation] AnnotateAssessmentRequest annotation * @property {Array.|null} [reasons] AnnotateAssessmentRequest reasons + * @property {Uint8Array|null} [hashedAccountId] AnnotateAssessmentRequest hashedAccountId */ /** @@ -664,6 +764,14 @@ */ AnnotateAssessmentRequest.prototype.reasons = $util.emptyArray; + /** + * AnnotateAssessmentRequest hashedAccountId. + * @member {Uint8Array} hashedAccountId + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest + * @instance + */ + AnnotateAssessmentRequest.prototype.hashedAccountId = $util.newBuffer([]); + /** * Creates a new AnnotateAssessmentRequest instance using the specified properties. * @function create @@ -698,6 +806,8 @@ writer.int32(message.reasons[i]); writer.ldelim(); } + if (message.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hashedAccountId); return writer; }; @@ -748,6 +858,9 @@ } else message.reasons.push(reader.int32()); break; + case 4: + message.hashedAccountId = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -815,6 +928,9 @@ break; } } + if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) + return "hashedAccountId: buffer expected"; return null; }; @@ -895,6 +1011,11 @@ break; } } + if (object.hashedAccountId != null) + if (typeof object.hashedAccountId === "string") + $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); + else if (object.hashedAccountId.length) + message.hashedAccountId = object.hashedAccountId; return message; }; @@ -916,6 +1037,13 @@ if (options.defaults) { object.name = ""; object.annotation = options.enums === String ? "ANNOTATION_UNSPECIFIED" : 0; + if (options.bytes === String) + object.hashedAccountId = ""; + else { + object.hashedAccountId = []; + if (options.bytes !== Array) + object.hashedAccountId = $util.newBuffer(object.hashedAccountId); + } } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -926,6 +1054,8 @@ for (var j = 0; j < message.reasons.length; ++j) object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason[message.reasons[j]] : message.reasons[j]; } + if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; return object; }; @@ -1159,6 +1289,7 @@ * @property {google.cloud.recaptchaenterprise.v1.IEvent|null} [event] Assessment event * @property {google.cloud.recaptchaenterprise.v1.IRiskAnalysis|null} [riskAnalysis] Assessment riskAnalysis * @property {google.cloud.recaptchaenterprise.v1.ITokenProperties|null} [tokenProperties] Assessment tokenProperties + * @property {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment|null} [accountDefenderAssessment] Assessment accountDefenderAssessment */ /** @@ -1208,6 +1339,14 @@ */ Assessment.prototype.tokenProperties = null; + /** + * Assessment accountDefenderAssessment. + * @member {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment|null|undefined} accountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @instance + */ + Assessment.prototype.accountDefenderAssessment = null; + /** * Creates a new Assessment instance using the specified properties. * @function create @@ -1240,6 +1379,8 @@ $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.encode(message.riskAnalysis, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.tokenProperties != null && Object.hasOwnProperty.call(message, "tokenProperties")) $root.google.cloud.recaptchaenterprise.v1.TokenProperties.encode(message.tokenProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.accountDefenderAssessment != null && Object.hasOwnProperty.call(message, "accountDefenderAssessment")) + $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.encode(message.accountDefenderAssessment, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -1286,6 +1427,9 @@ case 4: message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.decode(reader, reader.uint32()); break; + case 6: + message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1339,6 +1483,11 @@ if (error) return "tokenProperties." + error; } + if (message.accountDefenderAssessment != null && message.hasOwnProperty("accountDefenderAssessment")) { + var error = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify(message.accountDefenderAssessment); + if (error) + return "accountDefenderAssessment." + error; + } return null; }; @@ -1371,6 +1520,11 @@ throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.tokenProperties: object expected"); message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.fromObject(object.tokenProperties); } + if (object.accountDefenderAssessment != null) { + if (typeof object.accountDefenderAssessment !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.accountDefenderAssessment: object expected"); + message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.fromObject(object.accountDefenderAssessment); + } return message; }; @@ -1392,6 +1546,7 @@ object.event = null; object.riskAnalysis = null; object.tokenProperties = null; + object.accountDefenderAssessment = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1401,6 +1556,8 @@ object.riskAnalysis = $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.toObject(message.riskAnalysis, options); if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) object.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.toObject(message.tokenProperties, options); + if (message.accountDefenderAssessment != null && message.hasOwnProperty("accountDefenderAssessment")) + object.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.toObject(message.accountDefenderAssessment, options); return object; }; @@ -1429,6 +1586,7 @@ * @property {string|null} [userAgent] Event userAgent * @property {string|null} [userIpAddress] Event userIpAddress * @property {string|null} [expectedAction] Event expectedAction + * @property {Uint8Array|null} [hashedAccountId] Event hashedAccountId */ /** @@ -1486,6 +1644,14 @@ */ Event.prototype.expectedAction = ""; + /** + * Event hashedAccountId. + * @member {Uint8Array} hashedAccountId + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @instance + */ + Event.prototype.hashedAccountId = $util.newBuffer([]); + /** * Creates a new Event instance using the specified properties. * @function create @@ -1520,6 +1686,8 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.userIpAddress); if (message.expectedAction != null && Object.hasOwnProperty.call(message, "expectedAction")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.expectedAction); + if (message.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.hashedAccountId); return writer; }; @@ -1569,6 +1737,9 @@ case 5: message.expectedAction = reader.string(); break; + case 6: + message.hashedAccountId = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -1619,6 +1790,9 @@ if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) if (!$util.isString(message.expectedAction)) return "expectedAction: string expected"; + if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) + return "hashedAccountId: buffer expected"; return null; }; @@ -1644,6 +1818,11 @@ message.userIpAddress = String(object.userIpAddress); if (object.expectedAction != null) message.expectedAction = String(object.expectedAction); + if (object.hashedAccountId != null) + if (typeof object.hashedAccountId === "string") + $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); + else if (object.hashedAccountId.length) + message.hashedAccountId = object.hashedAccountId; return message; }; @@ -1666,6 +1845,13 @@ object.userAgent = ""; object.userIpAddress = ""; object.expectedAction = ""; + if (options.bytes === String) + object.hashedAccountId = ""; + else { + object.hashedAccountId = []; + if (options.bytes !== Array) + object.hashedAccountId = $util.newBuffer(object.hashedAccountId); + } } if (message.token != null && message.hasOwnProperty("token")) object.token = message.token; @@ -1677,6 +1863,8 @@ object.userIpAddress = message.userIpAddress; if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) object.expectedAction = message.expectedAction; + if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; return object; }; @@ -2328,6 +2516,267 @@ return TokenProperties; })(); + v1.AccountDefenderAssessment = (function() { + + /** + * Properties of an AccountDefenderAssessment. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IAccountDefenderAssessment + * @property {Array.|null} [labels] AccountDefenderAssessment labels + */ + + /** + * Constructs a new AccountDefenderAssessment. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents an AccountDefenderAssessment. + * @implements IAccountDefenderAssessment + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment=} [properties] Properties to set + */ + function AccountDefenderAssessment(properties) { + this.labels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccountDefenderAssessment labels. + * @member {Array.} labels + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @instance + */ + AccountDefenderAssessment.prototype.labels = $util.emptyArray; + + /** + * Creates a new AccountDefenderAssessment instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment instance + */ + AccountDefenderAssessment.create = function create(properties) { + return new AccountDefenderAssessment(properties); + }; + + /** + * Encodes the specified AccountDefenderAssessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment} message AccountDefenderAssessment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountDefenderAssessment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labels != null && message.labels.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.labels.length; ++i) + writer.int32(message.labels[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified AccountDefenderAssessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @static + * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment} message AccountDefenderAssessment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountDefenderAssessment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccountDefenderAssessment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountDefenderAssessment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.labels && message.labels.length)) + message.labels = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.labels.push(reader.int32()); + } else + message.labels.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccountDefenderAssessment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountDefenderAssessment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccountDefenderAssessment message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccountDefenderAssessment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) + switch (message.labels[i]) { + default: + return "labels: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + return null; + }; + + /** + * Creates an AccountDefenderAssessment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment + */ + AccountDefenderAssessment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment(); + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) + switch (object.labels[i]) { + default: + case "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED": + case 0: + message.labels[i] = 0; + break; + case "PROFILE_MATCH": + case 1: + message.labels[i] = 1; + break; + case "SUSPICIOUS_LOGIN_ACTIVITY": + case 2: + message.labels[i] = 2; + break; + case "SUSPICIOUS_ACCOUNT_CREATION": + case 3: + message.labels[i] = 3; + break; + case "RELATED_ACCOUNTS_NUMBER_HIGH": + case 4: + message.labels[i] = 4; + break; + } + } + return message; + }; + + /** + * Creates a plain object from an AccountDefenderAssessment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @static + * @param {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} message AccountDefenderAssessment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccountDefenderAssessment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.labels = []; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel[message.labels[j]] : message.labels[j]; + } + return object; + }; + + /** + * Converts this AccountDefenderAssessment to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @instance + * @returns {Object.} JSON object + */ + AccountDefenderAssessment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AccountDefenderLabel enum. + * @name google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel + * @enum {number} + * @property {number} ACCOUNT_DEFENDER_LABEL_UNSPECIFIED=0 ACCOUNT_DEFENDER_LABEL_UNSPECIFIED value + * @property {number} PROFILE_MATCH=1 PROFILE_MATCH value + * @property {number} SUSPICIOUS_LOGIN_ACTIVITY=2 SUSPICIOUS_LOGIN_ACTIVITY value + * @property {number} SUSPICIOUS_ACCOUNT_CREATION=3 SUSPICIOUS_ACCOUNT_CREATION value + * @property {number} RELATED_ACCOUNTS_NUMBER_HIGH=4 RELATED_ACCOUNTS_NUMBER_HIGH value + */ + AccountDefenderAssessment.AccountDefenderLabel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROFILE_MATCH"] = 1; + values[valuesById[2] = "SUSPICIOUS_LOGIN_ACTIVITY"] = 2; + values[valuesById[3] = "SUSPICIOUS_ACCOUNT_CREATION"] = 3; + values[valuesById[4] = "RELATED_ACCOUNTS_NUMBER_HIGH"] = 4; + return values; + })(); + + return AccountDefenderAssessment; + })(); + v1.CreateKeyRequest = (function() { /** @@ -6587,6 +7036,1832 @@ return ChallengeMetrics; })(); + v1.ListRelatedAccountGroupMembershipsRequest = (function() { + + /** + * Properties of a ListRelatedAccountGroupMembershipsRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IListRelatedAccountGroupMembershipsRequest + * @property {string|null} [parent] ListRelatedAccountGroupMembershipsRequest parent + * @property {number|null} [pageSize] ListRelatedAccountGroupMembershipsRequest pageSize + * @property {string|null} [pageToken] ListRelatedAccountGroupMembershipsRequest pageToken + */ + + /** + * Constructs a new ListRelatedAccountGroupMembershipsRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a ListRelatedAccountGroupMembershipsRequest. + * @implements IListRelatedAccountGroupMembershipsRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest=} [properties] Properties to set + */ + function ListRelatedAccountGroupMembershipsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRelatedAccountGroupMembershipsRequest parent. + * @member {string} parent + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest + * @instance + */ + ListRelatedAccountGroupMembershipsRequest.prototype.parent = ""; + + /** + * ListRelatedAccountGroupMembershipsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest + * @instance + */ + ListRelatedAccountGroupMembershipsRequest.prototype.pageSize = 0; + + /** + * ListRelatedAccountGroupMembershipsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest + * @instance + */ + ListRelatedAccountGroupMembershipsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListRelatedAccountGroupMembershipsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest} ListRelatedAccountGroupMembershipsRequest instance + */ + ListRelatedAccountGroupMembershipsRequest.create = function create(properties) { + return new ListRelatedAccountGroupMembershipsRequest(properties); + }; + + /** + * Encodes the specified ListRelatedAccountGroupMembershipsRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest} message ListRelatedAccountGroupMembershipsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRelatedAccountGroupMembershipsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListRelatedAccountGroupMembershipsRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest} message ListRelatedAccountGroupMembershipsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRelatedAccountGroupMembershipsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRelatedAccountGroupMembershipsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest} ListRelatedAccountGroupMembershipsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRelatedAccountGroupMembershipsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRelatedAccountGroupMembershipsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest} ListRelatedAccountGroupMembershipsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRelatedAccountGroupMembershipsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRelatedAccountGroupMembershipsRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRelatedAccountGroupMembershipsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListRelatedAccountGroupMembershipsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest} ListRelatedAccountGroupMembershipsRequest + */ + ListRelatedAccountGroupMembershipsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListRelatedAccountGroupMembershipsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest} message ListRelatedAccountGroupMembershipsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRelatedAccountGroupMembershipsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListRelatedAccountGroupMembershipsRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRelatedAccountGroupMembershipsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRelatedAccountGroupMembershipsRequest; + })(); + + v1.ListRelatedAccountGroupMembershipsResponse = (function() { + + /** + * Properties of a ListRelatedAccountGroupMembershipsResponse. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IListRelatedAccountGroupMembershipsResponse + * @property {Array.|null} [relatedAccountGroupMemberships] ListRelatedAccountGroupMembershipsResponse relatedAccountGroupMemberships + * @property {string|null} [nextPageToken] ListRelatedAccountGroupMembershipsResponse nextPageToken + */ + + /** + * Constructs a new ListRelatedAccountGroupMembershipsResponse. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a ListRelatedAccountGroupMembershipsResponse. + * @implements IListRelatedAccountGroupMembershipsResponse + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse=} [properties] Properties to set + */ + function ListRelatedAccountGroupMembershipsResponse(properties) { + this.relatedAccountGroupMemberships = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRelatedAccountGroupMembershipsResponse relatedAccountGroupMemberships. + * @member {Array.} relatedAccountGroupMemberships + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse + * @instance + */ + ListRelatedAccountGroupMembershipsResponse.prototype.relatedAccountGroupMemberships = $util.emptyArray; + + /** + * ListRelatedAccountGroupMembershipsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse + * @instance + */ + ListRelatedAccountGroupMembershipsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRelatedAccountGroupMembershipsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse} ListRelatedAccountGroupMembershipsResponse instance + */ + ListRelatedAccountGroupMembershipsResponse.create = function create(properties) { + return new ListRelatedAccountGroupMembershipsResponse(properties); + }; + + /** + * Encodes the specified ListRelatedAccountGroupMembershipsResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse} message ListRelatedAccountGroupMembershipsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRelatedAccountGroupMembershipsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relatedAccountGroupMemberships != null && message.relatedAccountGroupMemberships.length) + for (var i = 0; i < message.relatedAccountGroupMemberships.length; ++i) + $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.encode(message.relatedAccountGroupMemberships[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListRelatedAccountGroupMembershipsResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse} message ListRelatedAccountGroupMembershipsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRelatedAccountGroupMembershipsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRelatedAccountGroupMembershipsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse} ListRelatedAccountGroupMembershipsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRelatedAccountGroupMembershipsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.relatedAccountGroupMemberships && message.relatedAccountGroupMemberships.length)) + message.relatedAccountGroupMemberships = []; + message.relatedAccountGroupMemberships.push($root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRelatedAccountGroupMembershipsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse} ListRelatedAccountGroupMembershipsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRelatedAccountGroupMembershipsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRelatedAccountGroupMembershipsResponse message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRelatedAccountGroupMembershipsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relatedAccountGroupMemberships != null && message.hasOwnProperty("relatedAccountGroupMemberships")) { + if (!Array.isArray(message.relatedAccountGroupMemberships)) + return "relatedAccountGroupMemberships: array expected"; + for (var i = 0; i < message.relatedAccountGroupMemberships.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.verify(message.relatedAccountGroupMemberships[i]); + if (error) + return "relatedAccountGroupMemberships." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListRelatedAccountGroupMembershipsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse} ListRelatedAccountGroupMembershipsResponse + */ + ListRelatedAccountGroupMembershipsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse(); + if (object.relatedAccountGroupMemberships) { + if (!Array.isArray(object.relatedAccountGroupMemberships)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse.relatedAccountGroupMemberships: array expected"); + message.relatedAccountGroupMemberships = []; + for (var i = 0; i < object.relatedAccountGroupMemberships.length; ++i) { + if (typeof object.relatedAccountGroupMemberships[i] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse.relatedAccountGroupMemberships: object expected"); + message.relatedAccountGroupMemberships[i] = $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.fromObject(object.relatedAccountGroupMemberships[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListRelatedAccountGroupMembershipsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse} message ListRelatedAccountGroupMembershipsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRelatedAccountGroupMembershipsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.relatedAccountGroupMemberships = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.relatedAccountGroupMemberships && message.relatedAccountGroupMemberships.length) { + object.relatedAccountGroupMemberships = []; + for (var j = 0; j < message.relatedAccountGroupMemberships.length; ++j) + object.relatedAccountGroupMemberships[j] = $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.toObject(message.relatedAccountGroupMemberships[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListRelatedAccountGroupMembershipsResponse to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse + * @instance + * @returns {Object.} JSON object + */ + ListRelatedAccountGroupMembershipsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRelatedAccountGroupMembershipsResponse; + })(); + + v1.ListRelatedAccountGroupsRequest = (function() { + + /** + * Properties of a ListRelatedAccountGroupsRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IListRelatedAccountGroupsRequest + * @property {string|null} [parent] ListRelatedAccountGroupsRequest parent + * @property {number|null} [pageSize] ListRelatedAccountGroupsRequest pageSize + * @property {string|null} [pageToken] ListRelatedAccountGroupsRequest pageToken + */ + + /** + * Constructs a new ListRelatedAccountGroupsRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a ListRelatedAccountGroupsRequest. + * @implements IListRelatedAccountGroupsRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest=} [properties] Properties to set + */ + function ListRelatedAccountGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRelatedAccountGroupsRequest parent. + * @member {string} parent + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest + * @instance + */ + ListRelatedAccountGroupsRequest.prototype.parent = ""; + + /** + * ListRelatedAccountGroupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest + * @instance + */ + ListRelatedAccountGroupsRequest.prototype.pageSize = 0; + + /** + * ListRelatedAccountGroupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest + * @instance + */ + ListRelatedAccountGroupsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListRelatedAccountGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest} ListRelatedAccountGroupsRequest instance + */ + ListRelatedAccountGroupsRequest.create = function create(properties) { + return new ListRelatedAccountGroupsRequest(properties); + }; + + /** + * Encodes the specified ListRelatedAccountGroupsRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest} message ListRelatedAccountGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRelatedAccountGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListRelatedAccountGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest} message ListRelatedAccountGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRelatedAccountGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRelatedAccountGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest} ListRelatedAccountGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRelatedAccountGroupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRelatedAccountGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest} ListRelatedAccountGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRelatedAccountGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRelatedAccountGroupsRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRelatedAccountGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListRelatedAccountGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest} ListRelatedAccountGroupsRequest + */ + ListRelatedAccountGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListRelatedAccountGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest} message ListRelatedAccountGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRelatedAccountGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListRelatedAccountGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRelatedAccountGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRelatedAccountGroupsRequest; + })(); + + v1.ListRelatedAccountGroupsResponse = (function() { + + /** + * Properties of a ListRelatedAccountGroupsResponse. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IListRelatedAccountGroupsResponse + * @property {Array.|null} [relatedAccountGroups] ListRelatedAccountGroupsResponse relatedAccountGroups + * @property {string|null} [nextPageToken] ListRelatedAccountGroupsResponse nextPageToken + */ + + /** + * Constructs a new ListRelatedAccountGroupsResponse. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a ListRelatedAccountGroupsResponse. + * @implements IListRelatedAccountGroupsResponse + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse=} [properties] Properties to set + */ + function ListRelatedAccountGroupsResponse(properties) { + this.relatedAccountGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRelatedAccountGroupsResponse relatedAccountGroups. + * @member {Array.} relatedAccountGroups + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse + * @instance + */ + ListRelatedAccountGroupsResponse.prototype.relatedAccountGroups = $util.emptyArray; + + /** + * ListRelatedAccountGroupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse + * @instance + */ + ListRelatedAccountGroupsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRelatedAccountGroupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse} ListRelatedAccountGroupsResponse instance + */ + ListRelatedAccountGroupsResponse.create = function create(properties) { + return new ListRelatedAccountGroupsResponse(properties); + }; + + /** + * Encodes the specified ListRelatedAccountGroupsResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse} message ListRelatedAccountGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRelatedAccountGroupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relatedAccountGroups != null && message.relatedAccountGroups.length) + for (var i = 0; i < message.relatedAccountGroups.length; ++i) + $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup.encode(message.relatedAccountGroups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListRelatedAccountGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse} message ListRelatedAccountGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRelatedAccountGroupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRelatedAccountGroupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse} ListRelatedAccountGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRelatedAccountGroupsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.relatedAccountGroups && message.relatedAccountGroups.length)) + message.relatedAccountGroups = []; + message.relatedAccountGroups.push($root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRelatedAccountGroupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse} ListRelatedAccountGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRelatedAccountGroupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRelatedAccountGroupsResponse message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRelatedAccountGroupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relatedAccountGroups != null && message.hasOwnProperty("relatedAccountGroups")) { + if (!Array.isArray(message.relatedAccountGroups)) + return "relatedAccountGroups: array expected"; + for (var i = 0; i < message.relatedAccountGroups.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup.verify(message.relatedAccountGroups[i]); + if (error) + return "relatedAccountGroups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListRelatedAccountGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse} ListRelatedAccountGroupsResponse + */ + ListRelatedAccountGroupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse(); + if (object.relatedAccountGroups) { + if (!Array.isArray(object.relatedAccountGroups)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse.relatedAccountGroups: array expected"); + message.relatedAccountGroups = []; + for (var i = 0; i < object.relatedAccountGroups.length; ++i) { + if (typeof object.relatedAccountGroups[i] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse.relatedAccountGroups: object expected"); + message.relatedAccountGroups[i] = $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup.fromObject(object.relatedAccountGroups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListRelatedAccountGroupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse} message ListRelatedAccountGroupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRelatedAccountGroupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.relatedAccountGroups = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.relatedAccountGroups && message.relatedAccountGroups.length) { + object.relatedAccountGroups = []; + for (var j = 0; j < message.relatedAccountGroups.length; ++j) + object.relatedAccountGroups[j] = $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup.toObject(message.relatedAccountGroups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListRelatedAccountGroupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListRelatedAccountGroupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRelatedAccountGroupsResponse; + })(); + + v1.SearchRelatedAccountGroupMembershipsRequest = (function() { + + /** + * Properties of a SearchRelatedAccountGroupMembershipsRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface ISearchRelatedAccountGroupMembershipsRequest + * @property {string|null} [parent] SearchRelatedAccountGroupMembershipsRequest parent + * @property {Uint8Array|null} [hashedAccountId] SearchRelatedAccountGroupMembershipsRequest hashedAccountId + * @property {number|null} [pageSize] SearchRelatedAccountGroupMembershipsRequest pageSize + * @property {string|null} [pageToken] SearchRelatedAccountGroupMembershipsRequest pageToken + */ + + /** + * Constructs a new SearchRelatedAccountGroupMembershipsRequest. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a SearchRelatedAccountGroupMembershipsRequest. + * @implements ISearchRelatedAccountGroupMembershipsRequest + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest=} [properties] Properties to set + */ + function SearchRelatedAccountGroupMembershipsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchRelatedAccountGroupMembershipsRequest parent. + * @member {string} parent + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest + * @instance + */ + SearchRelatedAccountGroupMembershipsRequest.prototype.parent = ""; + + /** + * SearchRelatedAccountGroupMembershipsRequest hashedAccountId. + * @member {Uint8Array} hashedAccountId + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest + * @instance + */ + SearchRelatedAccountGroupMembershipsRequest.prototype.hashedAccountId = $util.newBuffer([]); + + /** + * SearchRelatedAccountGroupMembershipsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest + * @instance + */ + SearchRelatedAccountGroupMembershipsRequest.prototype.pageSize = 0; + + /** + * SearchRelatedAccountGroupMembershipsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest + * @instance + */ + SearchRelatedAccountGroupMembershipsRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchRelatedAccountGroupMembershipsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest} SearchRelatedAccountGroupMembershipsRequest instance + */ + SearchRelatedAccountGroupMembershipsRequest.create = function create(properties) { + return new SearchRelatedAccountGroupMembershipsRequest(properties); + }; + + /** + * Encodes the specified SearchRelatedAccountGroupMembershipsRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest} message SearchRelatedAccountGroupMembershipsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchRelatedAccountGroupMembershipsRequest.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.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hashedAccountId); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified SearchRelatedAccountGroupMembershipsRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest} message SearchRelatedAccountGroupMembershipsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchRelatedAccountGroupMembershipsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchRelatedAccountGroupMembershipsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest} SearchRelatedAccountGroupMembershipsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchRelatedAccountGroupMembershipsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.hashedAccountId = reader.bytes(); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchRelatedAccountGroupMembershipsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest} SearchRelatedAccountGroupMembershipsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchRelatedAccountGroupMembershipsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchRelatedAccountGroupMembershipsRequest message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchRelatedAccountGroupMembershipsRequest.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.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) + return "hashedAccountId: buffer 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 SearchRelatedAccountGroupMembershipsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest} SearchRelatedAccountGroupMembershipsRequest + */ + SearchRelatedAccountGroupMembershipsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.hashedAccountId != null) + if (typeof object.hashedAccountId === "string") + $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); + else if (object.hashedAccountId.length) + message.hashedAccountId = object.hashedAccountId; + 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 SearchRelatedAccountGroupMembershipsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest + * @static + * @param {google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest} message SearchRelatedAccountGroupMembershipsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchRelatedAccountGroupMembershipsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + if (options.bytes === String) + object.hashedAccountId = ""; + else { + object.hashedAccountId = []; + if (options.bytes !== Array) + object.hashedAccountId = $util.newBuffer(object.hashedAccountId); + } + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this SearchRelatedAccountGroupMembershipsRequest to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchRelatedAccountGroupMembershipsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SearchRelatedAccountGroupMembershipsRequest; + })(); + + v1.SearchRelatedAccountGroupMembershipsResponse = (function() { + + /** + * Properties of a SearchRelatedAccountGroupMembershipsResponse. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface ISearchRelatedAccountGroupMembershipsResponse + * @property {Array.|null} [relatedAccountGroupMemberships] SearchRelatedAccountGroupMembershipsResponse relatedAccountGroupMemberships + * @property {string|null} [nextPageToken] SearchRelatedAccountGroupMembershipsResponse nextPageToken + */ + + /** + * Constructs a new SearchRelatedAccountGroupMembershipsResponse. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a SearchRelatedAccountGroupMembershipsResponse. + * @implements ISearchRelatedAccountGroupMembershipsResponse + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse=} [properties] Properties to set + */ + function SearchRelatedAccountGroupMembershipsResponse(properties) { + this.relatedAccountGroupMemberships = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchRelatedAccountGroupMembershipsResponse relatedAccountGroupMemberships. + * @member {Array.} relatedAccountGroupMemberships + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse + * @instance + */ + SearchRelatedAccountGroupMembershipsResponse.prototype.relatedAccountGroupMemberships = $util.emptyArray; + + /** + * SearchRelatedAccountGroupMembershipsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse + * @instance + */ + SearchRelatedAccountGroupMembershipsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchRelatedAccountGroupMembershipsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse} SearchRelatedAccountGroupMembershipsResponse instance + */ + SearchRelatedAccountGroupMembershipsResponse.create = function create(properties) { + return new SearchRelatedAccountGroupMembershipsResponse(properties); + }; + + /** + * Encodes the specified SearchRelatedAccountGroupMembershipsResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse} message SearchRelatedAccountGroupMembershipsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchRelatedAccountGroupMembershipsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relatedAccountGroupMemberships != null && message.relatedAccountGroupMemberships.length) + for (var i = 0; i < message.relatedAccountGroupMemberships.length; ++i) + $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.encode(message.relatedAccountGroupMemberships[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified SearchRelatedAccountGroupMembershipsResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse} message SearchRelatedAccountGroupMembershipsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchRelatedAccountGroupMembershipsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchRelatedAccountGroupMembershipsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse} SearchRelatedAccountGroupMembershipsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchRelatedAccountGroupMembershipsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.relatedAccountGroupMemberships && message.relatedAccountGroupMemberships.length)) + message.relatedAccountGroupMemberships = []; + message.relatedAccountGroupMemberships.push($root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchRelatedAccountGroupMembershipsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse} SearchRelatedAccountGroupMembershipsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchRelatedAccountGroupMembershipsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchRelatedAccountGroupMembershipsResponse message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchRelatedAccountGroupMembershipsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relatedAccountGroupMemberships != null && message.hasOwnProperty("relatedAccountGroupMemberships")) { + if (!Array.isArray(message.relatedAccountGroupMemberships)) + return "relatedAccountGroupMemberships: array expected"; + for (var i = 0; i < message.relatedAccountGroupMemberships.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.verify(message.relatedAccountGroupMemberships[i]); + if (error) + return "relatedAccountGroupMemberships." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchRelatedAccountGroupMembershipsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse} SearchRelatedAccountGroupMembershipsResponse + */ + SearchRelatedAccountGroupMembershipsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse(); + if (object.relatedAccountGroupMemberships) { + if (!Array.isArray(object.relatedAccountGroupMemberships)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse.relatedAccountGroupMemberships: array expected"); + message.relatedAccountGroupMemberships = []; + for (var i = 0; i < object.relatedAccountGroupMemberships.length; ++i) { + if (typeof object.relatedAccountGroupMemberships[i] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse.relatedAccountGroupMemberships: object expected"); + message.relatedAccountGroupMemberships[i] = $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.fromObject(object.relatedAccountGroupMemberships[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchRelatedAccountGroupMembershipsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse} message SearchRelatedAccountGroupMembershipsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchRelatedAccountGroupMembershipsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.relatedAccountGroupMemberships = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.relatedAccountGroupMemberships && message.relatedAccountGroupMemberships.length) { + object.relatedAccountGroupMemberships = []; + for (var j = 0; j < message.relatedAccountGroupMemberships.length; ++j) + object.relatedAccountGroupMemberships[j] = $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.toObject(message.relatedAccountGroupMemberships[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchRelatedAccountGroupMembershipsResponse to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchRelatedAccountGroupMembershipsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SearchRelatedAccountGroupMembershipsResponse; + })(); + + v1.RelatedAccountGroupMembership = (function() { + + /** + * Properties of a RelatedAccountGroupMembership. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IRelatedAccountGroupMembership + * @property {string|null} [name] RelatedAccountGroupMembership name + * @property {Uint8Array|null} [hashedAccountId] RelatedAccountGroupMembership hashedAccountId + */ + + /** + * Constructs a new RelatedAccountGroupMembership. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a RelatedAccountGroupMembership. + * @implements IRelatedAccountGroupMembership + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership=} [properties] Properties to set + */ + function RelatedAccountGroupMembership(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RelatedAccountGroupMembership name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @instance + */ + RelatedAccountGroupMembership.prototype.name = ""; + + /** + * RelatedAccountGroupMembership hashedAccountId. + * @member {Uint8Array} hashedAccountId + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @instance + */ + RelatedAccountGroupMembership.prototype.hashedAccountId = $util.newBuffer([]); + + /** + * Creates a new RelatedAccountGroupMembership instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} RelatedAccountGroupMembership instance + */ + RelatedAccountGroupMembership.create = function create(properties) { + return new RelatedAccountGroupMembership(properties); + }; + + /** + * Encodes the specified RelatedAccountGroupMembership message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership} message RelatedAccountGroupMembership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAccountGroupMembership.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.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hashedAccountId); + return writer; + }; + + /** + * Encodes the specified RelatedAccountGroupMembership message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership} message RelatedAccountGroupMembership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAccountGroupMembership.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelatedAccountGroupMembership message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} RelatedAccountGroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAccountGroupMembership.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.hashedAccountId = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelatedAccountGroupMembership message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} RelatedAccountGroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAccountGroupMembership.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelatedAccountGroupMembership message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelatedAccountGroupMembership.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.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) + return "hashedAccountId: buffer expected"; + return null; + }; + + /** + * Creates a RelatedAccountGroupMembership message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} RelatedAccountGroupMembership + */ + RelatedAccountGroupMembership.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership(); + if (object.name != null) + message.name = String(object.name); + if (object.hashedAccountId != null) + if (typeof object.hashedAccountId === "string") + $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); + else if (object.hashedAccountId.length) + message.hashedAccountId = object.hashedAccountId; + return message; + }; + + /** + * Creates a plain object from a RelatedAccountGroupMembership message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} message RelatedAccountGroupMembership + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelatedAccountGroupMembership.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if (options.bytes === String) + object.hashedAccountId = ""; + else { + object.hashedAccountId = []; + if (options.bytes !== Array) + object.hashedAccountId = $util.newBuffer(object.hashedAccountId); + } + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; + return object; + }; + + /** + * Converts this RelatedAccountGroupMembership to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @instance + * @returns {Object.} JSON object + */ + RelatedAccountGroupMembership.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RelatedAccountGroupMembership; + })(); + + v1.RelatedAccountGroup = (function() { + + /** + * Properties of a RelatedAccountGroup. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IRelatedAccountGroup + * @property {string|null} [name] RelatedAccountGroup name + */ + + /** + * Constructs a new RelatedAccountGroup. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a RelatedAccountGroup. + * @implements IRelatedAccountGroup + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup=} [properties] Properties to set + */ + function RelatedAccountGroup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RelatedAccountGroup name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroup + * @instance + */ + RelatedAccountGroup.prototype.name = ""; + + /** + * Creates a new RelatedAccountGroup instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroup + * @static + * @param {google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.RelatedAccountGroup} RelatedAccountGroup instance + */ + RelatedAccountGroup.create = function create(properties) { + return new RelatedAccountGroup(properties); + }; + + /** + * Encodes the specified RelatedAccountGroup message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroup + * @static + * @param {google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup} message RelatedAccountGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAccountGroup.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 RelatedAccountGroup message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroup + * @static + * @param {google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup} message RelatedAccountGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAccountGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelatedAccountGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.RelatedAccountGroup} RelatedAccountGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAccountGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup(); + 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 RelatedAccountGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.RelatedAccountGroup} RelatedAccountGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAccountGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelatedAccountGroup message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelatedAccountGroup.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 RelatedAccountGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.RelatedAccountGroup} RelatedAccountGroup + */ + RelatedAccountGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RelatedAccountGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroup + * @static + * @param {google.cloud.recaptchaenterprise.v1.RelatedAccountGroup} message RelatedAccountGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelatedAccountGroup.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 RelatedAccountGroup to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroup + * @instance + * @returns {Object.} JSON object + */ + RelatedAccountGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RelatedAccountGroup; + })(); + return v1; })(); diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index 22c3cee08c0..c9911f0f010 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -171,6 +171,62 @@ "(google.api.method_signature)": "name" } ] + }, + "ListRelatedAccountGroups": { + "requestType": "ListRelatedAccountGroupsRequest", + "responseType": "ListRelatedAccountGroupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/relatedaccountgroups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/relatedaccountgroups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListRelatedAccountGroupMemberships": { + "requestType": "ListRelatedAccountGroupMembershipsRequest", + "responseType": "ListRelatedAccountGroupMembershipsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/relatedaccountgroups/*}/memberships", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/relatedaccountgroups/*}/memberships" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "SearchRelatedAccountGroupMemberships": { + "requestType": "SearchRelatedAccountGroupMembershipsRequest", + "responseType": "SearchRelatedAccountGroupMembershipsResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/relatedaccountgroupmemberships:search", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,hashed_account_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/relatedaccountgroupmemberships:search", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,hashed_account_id" + } + ] } } }, @@ -217,6 +273,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "hashedAccountId": { + "type": "bytes", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -276,6 +339,10 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "accountDefenderAssessment": { + "type": "AccountDefenderAssessment", + "id": 6 } } }, @@ -315,6 +382,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "hashedAccountId": { + "type": "bytes", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -380,6 +454,26 @@ } } }, + "AccountDefenderAssessment": { + "fields": { + "labels": { + "rule": "repeated", + "type": "AccountDefenderLabel", + "id": 1 + } + }, + "nested": { + "AccountDefenderLabel": { + "values": { + "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED": 0, + "PROFILE_MATCH": 1, + "SUSPICIOUS_LOGIN_ACTIVITY": 2, + "SUSPICIOUS_ACCOUNT_CREATION": 3, + "RELATED_ACCOUNTS_NUMBER_HIGH": 4 + } + } + } + }, "CreateKeyRequest": { "fields": { "parent": { @@ -617,10 +711,7 @@ }, "allowAmpTraffic": { "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "id": 2 }, "integrationType": { "type": "IntegrationType", @@ -720,6 +811,166 @@ "id": 4 } } + }, + "ListRelatedAccountGroupMembershipsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListRelatedAccountGroupMembershipsResponse": { + "fields": { + "relatedAccountGroupMemberships": { + "rule": "repeated", + "type": "RelatedAccountGroupMembership", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListRelatedAccountGroupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "recaptchaenterprise.googleapis.com/RelatedAccountGroup" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListRelatedAccountGroupsResponse": { + "fields": { + "relatedAccountGroups": { + "rule": "repeated", + "type": "RelatedAccountGroup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchRelatedAccountGroupMembershipsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership" + } + }, + "hashedAccountId": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchRelatedAccountGroupMembershipsResponse": { + "fields": { + "relatedAccountGroupMemberships": { + "rule": "repeated", + "type": "RelatedAccountGroupMembership", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "RelatedAccountGroupMembership": { + "options": { + "(google.api.resource).type": "recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership", + "(google.api.resource).pattern": "projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership" + } + }, + "hashedAccountId": { + "type": "bytes", + "id": 2 + } + } + }, + "RelatedAccountGroup": { + "options": { + "(google.api.resource).type": "recaptchaenterprise.googleapis.com/RelatedAccountGroup", + "(google.api.resource).pattern": "projects/{project}/relatedaccountgroups/{relatedaccountgroup}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/RelatedAccountGroup" + } + } + } } } }, diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js new file mode 100644 index 00000000000..2779787863e --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js @@ -0,0 +1,74 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Assessment, in the format + * "projects/{project}/assessments/{assessment}". + */ + // const name = 'abc123' + /** + * Optional. The annotation that will be assigned to the Event. This field can be left + * empty to provide reasons that apply to an event without concluding whether + * the event is legitimate or fraudulent. + */ + // const annotation = '' + /** + * Optional. Optional reasons for the annotation that will be assigned to the Event. + */ + // const reasons = 1234 + /** + * Optional. Optional unique stable hashed user identifier to apply to the assessment. + * This is an alternative to setting the hashed_account_id in + * CreateAssessment, for example when the account identifier is not yet known + * in the initial request. It is recommended that the identifier is hashed + * using hmac-sha256 with stable secret. + */ + // const hashedAccountId = 'Buffer.from('string')' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceClient} = + require('@google-cloud/recaptcha-enterprise').v1; + + // Instantiates a client + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); + + async function annotateAssessment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await recaptchaenterpriseClient.annotateAssessment( + request + ); + console.log(response); + } + + annotateAssessment(); + // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js new file mode 100644 index 00000000000..5fb3cae509f --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent, assessment) { + // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project in which the assessment will be created, + * in the format "projects/{project}". + */ + // const parent = 'abc123' + /** + * Required. The assessment details. + */ + // const assessment = '' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceClient} = + require('@google-cloud/recaptcha-enterprise').v1; + + // Instantiates a client + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); + + async function createAssessment() { + // Construct request + const request = { + parent, + assessment, + }; + + // Run request + const response = await recaptchaenterpriseClient.createAssessment(request); + console.log(response); + } + + createAssessment(); + // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js new file mode 100644 index 00000000000..971ccdb90aa --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent, key) { + // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project in which the key will be created, in the + * format "projects/{project}". + */ + // const parent = 'abc123' + /** + * Required. Information to create a reCAPTCHA Enterprise key. + */ + // const key = '' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceClient} = + require('@google-cloud/recaptcha-enterprise').v1; + + // Instantiates a client + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); + + async function createKey() { + // Construct request + const request = { + parent, + key, + }; + + // Run request + const response = await recaptchaenterpriseClient.createKey(request); + console.log(response); + } + + createKey(); + // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js new file mode 100644 index 00000000000..db974b2e554 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the key to be deleted, in the format + * "projects/{project}/keys/{key}". + */ + // const name = 'abc123' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceClient} = + require('@google-cloud/recaptcha-enterprise').v1; + + // Instantiates a client + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); + + async function deleteKey() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await recaptchaenterpriseClient.deleteKey(request); + console.log(response); + } + + deleteKey(); + // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js new file mode 100644 index 00000000000..dec6da8097e --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the requested key, in the format + * "projects/{project}/keys/{key}". + */ + // const name = 'abc123' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceClient} = + require('@google-cloud/recaptcha-enterprise').v1; + + // Instantiates a client + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); + + async function getKey() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await recaptchaenterpriseClient.getKey(request); + console.log(response); + } + + getKey(); + // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js new file mode 100644 index 00000000000..9227d511010 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the requested metrics, in the format + * "projects/{project}/keys/{key}/metrics". + */ + // const name = 'abc123' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceClient} = + require('@google-cloud/recaptcha-enterprise').v1; + + // Instantiates a client + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); + + async function getMetrics() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await recaptchaenterpriseClient.getMetrics(request); + console.log(response); + } + + getMetrics(); + // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js new file mode 100644 index 00000000000..e1dc8b321fd --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js @@ -0,0 +1,66 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project that contains the keys that will be + * listed, in the format "projects/{project}". + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + */ + // const pageToken = 'abc123' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceClient} = + require('@google-cloud/recaptcha-enterprise').v1; + + // Instantiates a client + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); + + async function listKeys() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await recaptchaenterpriseClient.listKeysAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listKeys(); + // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js new file mode 100644 index 00000000000..f747a9b6077 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js @@ -0,0 +1,74 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for the related account group in the format + * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of accounts to return. The service may return fewer than + * this value. + * If unspecified, at most 50 accounts will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` + * call. + * When paginating, all other parameters provided to + * `ListRelatedAccountGroupMemberships` must match the call that provided the + * page token. + */ + // const pageToken = 'abc123' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceClient} = + require('@google-cloud/recaptcha-enterprise').v1; + + // Instantiates a client + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); + + async function listRelatedAccountGroupMemberships() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = + await recaptchaenterpriseClient.listRelatedAccountGroupMembershipsAsync( + request + ); + for await (const response of iterable) { + console.log(response); + } + } + + listRelatedAccountGroupMemberships(); + // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js new file mode 100644 index 00000000000..f5180d65a86 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.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) { + // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project to list related account groups from, in the format + * "projects/{project}". + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of groups to return. The service may return fewer than + * this value. + * If unspecified, at most 50 groups will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListRelatedAccountGroups` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListRelatedAccountGroups` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceClient} = + require('@google-cloud/recaptcha-enterprise').v1; + + // Instantiates a client + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); + + async function listRelatedAccountGroups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = + await recaptchaenterpriseClient.listRelatedAccountGroupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listRelatedAccountGroups(); + // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js new file mode 100644 index 00000000000..08046692fc2 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the key to be migrated, in the format + * "projects/{project}/keys/{key}". + */ + // const name = 'abc123' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceClient} = + require('@google-cloud/recaptcha-enterprise').v1; + + // Instantiates a client + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); + + async function migrateKey() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await recaptchaenterpriseClient.migrateKey(request); + console.log(response); + } + + migrateKey(); + // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js new file mode 100644 index 00000000000..febe66f6c51 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js @@ -0,0 +1,81 @@ +// 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 recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project to search related account group memberships from, + * in the format "projects/{project}". + */ + // const parent = 'abc123' + /** + * Optional. The unique stable hashed user identifier we should search connections to. + * The identifier should correspond to a `hashed_account_id` provided in a + * previous CreateAssessment or AnnotateAssessment call. + */ + // const hashedAccountId = 'Buffer.from('string')' + /** + * Optional. The maximum number of groups to return. The service may return fewer than + * this value. + * If unspecified, at most 50 groups will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous + * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the + * subsequent page. + * When paginating, all other parameters provided to + * `SearchRelatedAccountGroupMemberships` must match the call that provided + * the page token. + */ + // const pageToken = 'abc123' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceClient} = + require('@google-cloud/recaptcha-enterprise').v1; + + // Instantiates a client + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); + + async function searchRelatedAccountGroupMemberships() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = + await recaptchaenterpriseClient.searchRelatedAccountGroupMembershipsAsync( + request + ); + for await (const response of iterable) { + console.log(response); + } + } + + searchRelatedAccountGroupMemberships(); + // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js new file mode 100644 index 00000000000..eba40fd8665 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js @@ -0,0 +1,58 @@ +// 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(key) { + // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The key to update. + */ + // const key = '' + /** + * Optional. The mask to control which fields of the key get updated. If the mask is not + * present, all fields will be updated. + */ + // const updateMask = '' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceClient} = + require('@google-cloud/recaptcha-enterprise').v1; + + // Instantiates a client + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); + + async function updateKey() { + // Construct request + const request = { + key, + }; + + // Run request + const response = await recaptchaenterpriseClient.updateKey(request); + console.log(response); + } + + updateKey(); + // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js new file mode 100644 index 00000000000..65d244cffc3 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js @@ -0,0 +1,62 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name, annotation) { + // [START recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_AnnotateAssessment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Assessment, in the format + * "projects/{project_number}/assessments/{assessment_id}". + */ + // const name = 'abc123' + /** + * Required. The annotation that will be assigned to the Event. + */ + // const annotation = '' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceV1Beta1Client} = + require('@google-cloud/recaptcha-enterprise').v1beta1; + + // Instantiates a client + const recaptchaenterpriseClient = + new RecaptchaEnterpriseServiceV1Beta1Client(); + + async function annotateAssessment() { + // Construct request + const request = { + name, + annotation, + }; + + // Run request + const response = await recaptchaenterpriseClient.annotateAssessment( + request + ); + console.log(response); + } + + annotateAssessment(); + // [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_AnnotateAssessment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js new file mode 100644 index 00000000000..0bc42ac63a5 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.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(parent, assessment) { + // [START recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateAssessment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project in which the assessment will be created, + * in the format "projects/{project_number}". + */ + // const parent = 'abc123' + /** + * Required. The assessment details. + */ + // const assessment = '' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceV1Beta1Client} = + require('@google-cloud/recaptcha-enterprise').v1beta1; + + // Instantiates a client + const recaptchaenterpriseClient = + new RecaptchaEnterpriseServiceV1Beta1Client(); + + async function createAssessment() { + // Construct request + const request = { + parent, + assessment, + }; + + // Run request + const response = await recaptchaenterpriseClient.createAssessment(request); + console.log(response); + } + + createAssessment(); + // [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateAssessment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.js new file mode 100644 index 00000000000..adcbe964af6 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.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(parent, key) { + // [START recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateKey_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project in which the key will be created, in the + * format "projects/{project_number}". + */ + // const parent = 'abc123' + /** + * Required. Information to create a reCAPTCHA Enterprise key. + */ + // const key = '' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceV1Beta1Client} = + require('@google-cloud/recaptcha-enterprise').v1beta1; + + // Instantiates a client + const recaptchaenterpriseClient = + new RecaptchaEnterpriseServiceV1Beta1Client(); + + async function createKey() { + // Construct request + const request = { + parent, + key, + }; + + // Run request + const response = await recaptchaenterpriseClient.createKey(request); + console.log(response); + } + + createKey(); + // [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.js new file mode 100644 index 00000000000..d850d9b5571 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.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 recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_DeleteKey_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the key to be deleted, in the format + * "projects/{project_number}/keys/{key_id}". + */ + // const name = 'abc123' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceV1Beta1Client} = + require('@google-cloud/recaptcha-enterprise').v1beta1; + + // Instantiates a client + const recaptchaenterpriseClient = + new RecaptchaEnterpriseServiceV1Beta1Client(); + + async function deleteKey() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await recaptchaenterpriseClient.deleteKey(request); + console.log(response); + } + + deleteKey(); + // [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_DeleteKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.js new file mode 100644 index 00000000000..d6769ad7c10 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.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 recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_GetKey_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the requested key, in the format + * "projects/{project_number}/keys/{key_id}". + */ + // const name = 'abc123' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceV1Beta1Client} = + require('@google-cloud/recaptcha-enterprise').v1beta1; + + // Instantiates a client + const recaptchaenterpriseClient = + new RecaptchaEnterpriseServiceV1Beta1Client(); + + async function getKey() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await recaptchaenterpriseClient.getKey(request); + console.log(response); + } + + getKey(); + // [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_GetKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js new file mode 100644 index 00000000000..4685241568b --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js @@ -0,0 +1,67 @@ +// 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 recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_ListKeys_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project that contains the keys that will be + * listed, in the format "projects/{project_number}". + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + */ + // const pageToken = 'abc123' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceV1Beta1Client} = + require('@google-cloud/recaptcha-enterprise').v1beta1; + + // Instantiates a client + const recaptchaenterpriseClient = + new RecaptchaEnterpriseServiceV1Beta1Client(); + + async function listKeys() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await recaptchaenterpriseClient.listKeysAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listKeys(); + // [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_ListKeys_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js new file mode 100644 index 00000000000..b1188d41234 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(key) { + // [START recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_UpdateKey_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The key to update. + */ + // const key = '' + /** + * Optional. The mask to control which field of the key get updated. If the mask is not + * present, all fields will be updated. + */ + // const updateMask = '' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceV1Beta1Client} = + require('@google-cloud/recaptcha-enterprise').v1beta1; + + // Instantiates a client + const recaptchaenterpriseClient = + new RecaptchaEnterpriseServiceV1Beta1Client(); + + async function updateKey() { + // Construct request + const request = { + key, + }; + + // Run request + const response = await recaptchaenterpriseClient.updateKey(request); + console.log(response); + } + + updateKey(); + // [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_UpdateKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 6da8f225f2f..b83d4d68feb 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/src/v1/gapic_metadata.json b/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json index 1663f2533fe..09321f22a15 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json +++ b/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json @@ -56,6 +56,27 @@ "listKeysStream", "listKeysAsync" ] + }, + "ListRelatedAccountGroups": { + "methods": [ + "listRelatedAccountGroups", + "listRelatedAccountGroupsStream", + "listRelatedAccountGroupsAsync" + ] + }, + "ListRelatedAccountGroupMemberships": { + "methods": [ + "listRelatedAccountGroupMemberships", + "listRelatedAccountGroupMembershipsStream", + "listRelatedAccountGroupMembershipsAsync" + ] + }, + "SearchRelatedAccountGroupMemberships": { + "methods": [ + "searchRelatedAccountGroupMemberships", + "searchRelatedAccountGroupMembershipsStream", + "searchRelatedAccountGroupMembershipsAsync" + ] } } }, @@ -108,6 +129,27 @@ "listKeysStream", "listKeysAsync" ] + }, + "ListRelatedAccountGroups": { + "methods": [ + "listRelatedAccountGroups", + "listRelatedAccountGroupsStream", + "listRelatedAccountGroupsAsync" + ] + }, + "ListRelatedAccountGroupMemberships": { + "methods": [ + "listRelatedAccountGroupMemberships", + "listRelatedAccountGroupMembershipsStream", + "listRelatedAccountGroupMembershipsAsync" + ] + }, + "SearchRelatedAccountGroupMemberships": { + "methods": [ + "searchRelatedAccountGroupMemberships", + "searchRelatedAccountGroupMembershipsStream", + "searchRelatedAccountGroupMembershipsAsync" + ] } } } diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index 92215b8f2f3..68d28ae4c74 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -177,6 +177,13 @@ export class RecaptchaEnterpriseServiceClient { projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), + relatedAccountGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/relatedaccountgroups/{relatedaccountgroup}' + ), + relatedAccountGroupMembershipPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/relatedaccountgroups/{relatedaccountgroup}/memberships/{membership}' + ), }; // Some of the methods on this service return "paged" results, @@ -188,6 +195,21 @@ export class RecaptchaEnterpriseServiceClient { 'nextPageToken', 'keys' ), + listRelatedAccountGroups: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'relatedAccountGroups' + ), + listRelatedAccountGroupMemberships: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'relatedAccountGroupMemberships' + ), + searchRelatedAccountGroupMemberships: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'relatedAccountGroupMemberships' + ), }; // Put together the default options sent with requests. @@ -250,6 +272,9 @@ export class RecaptchaEnterpriseServiceClient { 'deleteKey', 'migrateKey', 'getMetrics', + 'listRelatedAccountGroups', + 'listRelatedAccountGroupMemberships', + 'searchRelatedAccountGroupMemberships', ]; for (const methodName of recaptchaEnterpriseServiceStubMethods) { const callPromise = this.recaptchaEnterpriseServiceStub.then( @@ -481,6 +506,12 @@ export class RecaptchaEnterpriseServiceClient { * the event is legitimate or fraudulent. * @param {number[]} [request.reasons] * Optional. Optional reasons for the annotation that will be assigned to the Event. + * @param {Buffer} [request.hashedAccountId] + * Optional. Optional unique stable hashed user identifier to apply to the assessment. + * This is an alternative to setting the hashed_account_id in + * CreateAssessment, for example when the account identifier is not yet known + * in the initial request. It is recommended that the identifier is hashed + * using hmac-sha256 with stable secret. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1239,7 +1270,8 @@ export class RecaptchaEnterpriseServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listKeys']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listKeys.createStream( this.innerApiCalls.listKeys as gax.GaxCall, @@ -1292,7 +1324,8 @@ export class RecaptchaEnterpriseServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listKeys']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listKeys.asyncIterate( this.innerApiCalls['listKeys'] as GaxCall, @@ -1300,6 +1333,697 @@ export class RecaptchaEnterpriseServiceClient { callSettings ) as AsyncIterable; } + listRelatedAccountGroups( + request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup[], + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest | null, + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse + ] + >; + listRelatedAccountGroups( + request: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup + > + ): void; + listRelatedAccountGroups( + request: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup + > + ): void; + /** + * List groups of related accounts. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project to list related account groups from, in the format + * "projects/{project}". + * @param {number} [request.pageSize] + * Optional. The maximum number of groups to return. The service may return fewer than + * this value. + * If unspecified, at most 50 groups will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListRelatedAccountGroups` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListRelatedAccountGroups` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [RelatedAccountGroup]{@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroup}. + * 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 `listRelatedAccountGroupsAsync()` + * 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. + */ + listRelatedAccountGroups( + request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup + >, + callback?: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup[], + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest | null, + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse + ] + > | 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.listRelatedAccountGroups( + 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 name of the project to list related account groups from, in the format + * "projects/{project}". + * @param {number} [request.pageSize] + * Optional. The maximum number of groups to return. The service may return fewer than + * this value. + * If unspecified, at most 50 groups will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListRelatedAccountGroups` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListRelatedAccountGroups` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [RelatedAccountGroup]{@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroup} 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 `listRelatedAccountGroupsAsync()` + * 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. + */ + listRelatedAccountGroupsStream( + request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const defaultCallSettings = this._defaults['listRelatedAccountGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRelatedAccountGroups.createStream( + this.innerApiCalls.listRelatedAccountGroups as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listRelatedAccountGroups`, 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 name of the project to list related account groups from, in the format + * "projects/{project}". + * @param {number} [request.pageSize] + * Optional. The maximum number of groups to return. The service may return fewer than + * this value. + * If unspecified, at most 50 groups will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListRelatedAccountGroups` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListRelatedAccountGroups` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [RelatedAccountGroup]{@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroup}. 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.listRelatedAccountGroupsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listRelatedAccountGroupsAsync( + request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const defaultCallSettings = this._defaults['listRelatedAccountGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRelatedAccountGroups.asyncIterate( + this.innerApiCalls['listRelatedAccountGroups'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listRelatedAccountGroupMemberships( + request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[], + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest | null, + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse + ] + >; + listRelatedAccountGroupMemberships( + request: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership + > + ): void; + listRelatedAccountGroupMemberships( + request: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership + > + ): void; + /** + * Get the memberships in a group of related accounts. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name for the related account group in the format + * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of accounts to return. The service may return fewer than + * this value. + * If unspecified, at most 50 accounts will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` + * call. + * + * When paginating, all other parameters provided to + * `ListRelatedAccountGroupMemberships` must match the call that provided the + * page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [RelatedAccountGroupMembership]{@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership}. + * 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 `listRelatedAccountGroupMembershipsAsync()` + * 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. + */ + listRelatedAccountGroupMemberships( + request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership + >, + callback?: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[], + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest | null, + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse + ] + > | 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.listRelatedAccountGroupMemberships( + 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 for the related account group in the format + * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of accounts to return. The service may return fewer than + * this value. + * If unspecified, at most 50 accounts will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` + * call. + * + * When paginating, all other parameters provided to + * `ListRelatedAccountGroupMemberships` must match the call that provided the + * page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [RelatedAccountGroupMembership]{@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} 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 `listRelatedAccountGroupMembershipsAsync()` + * 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. + */ + listRelatedAccountGroupMembershipsStream( + request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const defaultCallSettings = + this._defaults['listRelatedAccountGroupMemberships']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRelatedAccountGroupMemberships.createStream( + this.innerApiCalls.listRelatedAccountGroupMemberships as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listRelatedAccountGroupMemberships`, 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 for the related account group in the format + * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of accounts to return. The service may return fewer than + * this value. + * If unspecified, at most 50 accounts will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` + * call. + * + * When paginating, all other parameters provided to + * `ListRelatedAccountGroupMemberships` must match the call that provided the + * page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [RelatedAccountGroupMembership]{@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership}. 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.listRelatedAccountGroupMembershipsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listRelatedAccountGroupMembershipsAsync( + request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const defaultCallSettings = + this._defaults['listRelatedAccountGroupMemberships']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRelatedAccountGroupMemberships.asyncIterate( + this.innerApiCalls['listRelatedAccountGroupMemberships'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + searchRelatedAccountGroupMemberships( + request?: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[], + protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest | null, + protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse + ] + >; + searchRelatedAccountGroupMemberships( + request: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, + | protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership + > + ): void; + searchRelatedAccountGroupMemberships( + request: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, + | protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership + > + ): void; + /** + * Search group memberships related to a given account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project to search related account group memberships from, + * in the format "projects/{project}". + * @param {Buffer} [request.hashedAccountId] + * Optional. The unique stable hashed user identifier we should search connections to. + * The identifier should correspond to a `hashed_account_id` provided in a + * previous CreateAssessment or AnnotateAssessment call. + * @param {number} [request.pageSize] + * Optional. The maximum number of groups to return. The service may return fewer than + * this value. + * If unspecified, at most 50 groups will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters provided to + * `SearchRelatedAccountGroupMemberships` must match the call that provided + * the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [RelatedAccountGroupMembership]{@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership}. + * 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 `searchRelatedAccountGroupMembershipsAsync()` + * 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. + */ + searchRelatedAccountGroupMemberships( + request?: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, + | protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership + >, + callback?: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, + | protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[], + protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest | null, + protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse + ] + > | 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.searchRelatedAccountGroupMemberships( + 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 name of the project to search related account group memberships from, + * in the format "projects/{project}". + * @param {Buffer} [request.hashedAccountId] + * Optional. The unique stable hashed user identifier we should search connections to. + * The identifier should correspond to a `hashed_account_id` provided in a + * previous CreateAssessment or AnnotateAssessment call. + * @param {number} [request.pageSize] + * Optional. The maximum number of groups to return. The service may return fewer than + * this value. + * If unspecified, at most 50 groups will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters provided to + * `SearchRelatedAccountGroupMemberships` must match the call that provided + * the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [RelatedAccountGroupMembership]{@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership} 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 `searchRelatedAccountGroupMembershipsAsync()` + * 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. + */ + searchRelatedAccountGroupMembershipsStream( + request?: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const defaultCallSettings = + this._defaults['searchRelatedAccountGroupMemberships']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchRelatedAccountGroupMemberships.createStream( + this.innerApiCalls.searchRelatedAccountGroupMemberships as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `searchRelatedAccountGroupMemberships`, 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 name of the project to search related account group memberships from, + * in the format "projects/{project}". + * @param {Buffer} [request.hashedAccountId] + * Optional. The unique stable hashed user identifier we should search connections to. + * The identifier should correspond to a `hashed_account_id` provided in a + * previous CreateAssessment or AnnotateAssessment call. + * @param {number} [request.pageSize] + * Optional. The maximum number of groups to return. The service may return fewer than + * this value. + * If unspecified, at most 50 groups will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters provided to + * `SearchRelatedAccountGroupMemberships` must match the call that provided + * the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [RelatedAccountGroupMembership]{@link google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership}. 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.searchRelatedAccountGroupMembershipsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + searchRelatedAccountGroupMembershipsAsync( + request?: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const defaultCallSettings = + this._defaults['searchRelatedAccountGroupMemberships']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchRelatedAccountGroupMemberships.asyncIterate( + this.innerApiCalls['searchRelatedAccountGroupMemberships'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- @@ -1437,6 +2161,113 @@ export class RecaptchaEnterpriseServiceClient { return this.pathTemplates.projectPathTemplate.match(projectName).project; } + /** + * Return a fully-qualified relatedAccountGroup resource name string. + * + * @param {string} project + * @param {string} relatedaccountgroup + * @returns {string} Resource name string. + */ + relatedAccountGroupPath(project: string, relatedaccountgroup: string) { + return this.pathTemplates.relatedAccountGroupPathTemplate.render({ + project: project, + relatedaccountgroup: relatedaccountgroup, + }); + } + + /** + * Parse the project from RelatedAccountGroup resource. + * + * @param {string} relatedAccountGroupName + * A fully-qualified path representing RelatedAccountGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRelatedAccountGroupName(relatedAccountGroupName: string) { + return this.pathTemplates.relatedAccountGroupPathTemplate.match( + relatedAccountGroupName + ).project; + } + + /** + * Parse the relatedaccountgroup from RelatedAccountGroup resource. + * + * @param {string} relatedAccountGroupName + * A fully-qualified path representing RelatedAccountGroup resource. + * @returns {string} A string representing the relatedaccountgroup. + */ + matchRelatedaccountgroupFromRelatedAccountGroupName( + relatedAccountGroupName: string + ) { + return this.pathTemplates.relatedAccountGroupPathTemplate.match( + relatedAccountGroupName + ).relatedaccountgroup; + } + + /** + * Return a fully-qualified relatedAccountGroupMembership resource name string. + * + * @param {string} project + * @param {string} relatedaccountgroup + * @param {string} membership + * @returns {string} Resource name string. + */ + relatedAccountGroupMembershipPath( + project: string, + relatedaccountgroup: string, + membership: string + ) { + return this.pathTemplates.relatedAccountGroupMembershipPathTemplate.render({ + project: project, + relatedaccountgroup: relatedaccountgroup, + membership: membership, + }); + } + + /** + * Parse the project from RelatedAccountGroupMembership resource. + * + * @param {string} relatedAccountGroupMembershipName + * A fully-qualified path representing RelatedAccountGroupMembership resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRelatedAccountGroupMembershipName( + relatedAccountGroupMembershipName: string + ) { + return this.pathTemplates.relatedAccountGroupMembershipPathTemplate.match( + relatedAccountGroupMembershipName + ).project; + } + + /** + * Parse the relatedaccountgroup from RelatedAccountGroupMembership resource. + * + * @param {string} relatedAccountGroupMembershipName + * A fully-qualified path representing RelatedAccountGroupMembership resource. + * @returns {string} A string representing the relatedaccountgroup. + */ + matchRelatedaccountgroupFromRelatedAccountGroupMembershipName( + relatedAccountGroupMembershipName: string + ) { + return this.pathTemplates.relatedAccountGroupMembershipPathTemplate.match( + relatedAccountGroupMembershipName + ).relatedaccountgroup; + } + + /** + * Parse the membership from RelatedAccountGroupMembership resource. + * + * @param {string} relatedAccountGroupMembershipName + * A fully-qualified path representing RelatedAccountGroupMembership resource. + * @returns {string} A string representing the membership. + */ + matchMembershipFromRelatedAccountGroupMembershipName( + relatedAccountGroupMembershipName: string + ) { + return this.pathTemplates.relatedAccountGroupMembershipPathTemplate.match( + relatedAccountGroupMembershipName + ).membership; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json index ec264c59f16..66fe297cf6f 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json @@ -62,6 +62,18 @@ "GetMetrics": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "ListRelatedAccountGroups": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListRelatedAccountGroupMemberships": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchRelatedAccountGroupMemberships": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 886beb80ec4..23abb64c4ca 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -1064,7 +1064,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listKeys']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listKeys.createStream( this.innerApiCalls.listKeys as gax.GaxCall, @@ -1117,7 +1118,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listKeys']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listKeys.asyncIterate( this.innerApiCalls['listKeys'] as GaxCall, diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index e2f0967740f..38bb157033c 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -1477,6 +1477,1078 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); }); + describe('listRelatedAccountGroups', () => { + it('invokes listRelatedAccountGroups without error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup() + ), + ]; + client.innerApiCalls.listRelatedAccountGroups = + stubSimpleCall(expectedResponse); + const [response] = await client.listRelatedAccountGroups(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listRelatedAccountGroups as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listRelatedAccountGroups without error using callback', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup() + ), + ]; + client.innerApiCalls.listRelatedAccountGroups = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRelatedAccountGroups( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listRelatedAccountGroups as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listRelatedAccountGroups with error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listRelatedAccountGroups = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listRelatedAccountGroups(request), + expectedError + ); + assert( + (client.innerApiCalls.listRelatedAccountGroups as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listRelatedAccountGroupsStream without error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup() + ), + ]; + client.descriptors.page.listRelatedAccountGroups.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRelatedAccountGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup + ) => { + 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.listRelatedAccountGroups + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listRelatedAccountGroups, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listRelatedAccountGroups + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listRelatedAccountGroupsStream with error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listRelatedAccountGroups.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listRelatedAccountGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listRelatedAccountGroups + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listRelatedAccountGroups, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listRelatedAccountGroups + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listRelatedAccountGroups without error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup() + ), + ]; + client.descriptors.page.listRelatedAccountGroups.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup[] = + []; + const iterable = client.listRelatedAccountGroupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listRelatedAccountGroups + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listRelatedAccountGroups + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listRelatedAccountGroups with error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listRelatedAccountGroups.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRelatedAccountGroupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listRelatedAccountGroups + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listRelatedAccountGroups + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listRelatedAccountGroupMemberships', () => { + it('invokes listRelatedAccountGroupMemberships without error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + ]; + client.innerApiCalls.listRelatedAccountGroupMemberships = + stubSimpleCall(expectedResponse); + const [response] = await client.listRelatedAccountGroupMemberships( + request + ); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listRelatedAccountGroupMemberships as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listRelatedAccountGroupMemberships without error using callback', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + ]; + client.innerApiCalls.listRelatedAccountGroupMemberships = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRelatedAccountGroupMemberships( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listRelatedAccountGroupMemberships as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listRelatedAccountGroupMemberships with error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listRelatedAccountGroupMemberships = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listRelatedAccountGroupMemberships(request), + expectedError + ); + assert( + (client.innerApiCalls.listRelatedAccountGroupMemberships as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listRelatedAccountGroupMembershipsStream without error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + ]; + client.descriptors.page.listRelatedAccountGroupMemberships.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRelatedAccountGroupMembershipsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + ) => { + 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.listRelatedAccountGroupMemberships + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listRelatedAccountGroupMemberships, + request + ) + ); + assert.strictEqual( + ( + client.descriptors.page.listRelatedAccountGroupMemberships + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listRelatedAccountGroupMembershipsStream with error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listRelatedAccountGroupMemberships.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listRelatedAccountGroupMembershipsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listRelatedAccountGroupMemberships + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listRelatedAccountGroupMemberships, + request + ) + ); + assert.strictEqual( + ( + client.descriptors.page.listRelatedAccountGroupMemberships + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listRelatedAccountGroupMemberships without error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + ]; + client.descriptors.page.listRelatedAccountGroupMemberships.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[] = + []; + const iterable = client.listRelatedAccountGroupMembershipsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listRelatedAccountGroupMemberships + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listRelatedAccountGroupMemberships + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listRelatedAccountGroupMemberships with error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listRelatedAccountGroupMemberships.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRelatedAccountGroupMembershipsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listRelatedAccountGroupMemberships + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listRelatedAccountGroupMemberships + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('searchRelatedAccountGroupMemberships', () => { + it('invokes searchRelatedAccountGroupMemberships without error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + ]; + client.innerApiCalls.searchRelatedAccountGroupMemberships = + stubSimpleCall(expectedResponse); + const [response] = await client.searchRelatedAccountGroupMemberships( + request + ); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchRelatedAccountGroupMemberships as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchRelatedAccountGroupMemberships without error using callback', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + ]; + client.innerApiCalls.searchRelatedAccountGroupMemberships = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchRelatedAccountGroupMemberships( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchRelatedAccountGroupMemberships as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes searchRelatedAccountGroupMemberships with error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.searchRelatedAccountGroupMemberships = + stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.searchRelatedAccountGroupMemberships(request), + expectedError + ); + assert( + (client.innerApiCalls.searchRelatedAccountGroupMemberships as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchRelatedAccountGroupMembershipsStream without error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + ]; + client.descriptors.page.searchRelatedAccountGroupMemberships.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.searchRelatedAccountGroupMembershipsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + ) => { + 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.searchRelatedAccountGroupMemberships + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.searchRelatedAccountGroupMemberships, + request + ) + ); + assert.strictEqual( + ( + client.descriptors.page.searchRelatedAccountGroupMemberships + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes searchRelatedAccountGroupMembershipsStream with error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.searchRelatedAccountGroupMemberships.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.searchRelatedAccountGroupMembershipsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.searchRelatedAccountGroupMemberships + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.searchRelatedAccountGroupMemberships, + request + ) + ); + assert.strictEqual( + ( + client.descriptors.page.searchRelatedAccountGroupMemberships + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchRelatedAccountGroupMemberships without error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() + ), + ]; + client.descriptors.page.searchRelatedAccountGroupMemberships.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[] = + []; + const iterable = + client.searchRelatedAccountGroupMembershipsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.searchRelatedAccountGroupMemberships + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.searchRelatedAccountGroupMemberships + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchRelatedAccountGroupMemberships with error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.searchRelatedAccountGroupMemberships.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = + client.searchRelatedAccountGroupMembershipsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.searchRelatedAccountGroupMemberships + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.searchRelatedAccountGroupMemberships + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + describe('Path templates', () => { describe('assessment', () => { const fakePath = '/rendered/path/assessment'; @@ -1674,5 +2746,152 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { ); }); }); + + describe('relatedAccountGroup', () => { + const fakePath = '/rendered/path/relatedAccountGroup'; + const expectedParameters = { + project: 'projectValue', + relatedaccountgroup: 'relatedaccountgroupValue', + }; + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.relatedAccountGroupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.relatedAccountGroupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('relatedAccountGroupPath', () => { + const result = client.relatedAccountGroupPath( + 'projectValue', + 'relatedaccountgroupValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.relatedAccountGroupPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRelatedAccountGroupName', () => { + const result = client.matchProjectFromRelatedAccountGroupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.relatedAccountGroupPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRelatedaccountgroupFromRelatedAccountGroupName', () => { + const result = + client.matchRelatedaccountgroupFromRelatedAccountGroupName(fakePath); + assert.strictEqual(result, 'relatedaccountgroupValue'); + assert( + ( + client.pathTemplates.relatedAccountGroupPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('relatedAccountGroupMembership', () => { + const fakePath = '/rendered/path/relatedAccountGroupMembership'; + const expectedParameters = { + project: 'projectValue', + relatedaccountgroup: 'relatedaccountgroupValue', + membership: 'membershipValue', + }; + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.relatedAccountGroupMembershipPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.relatedAccountGroupMembershipPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('relatedAccountGroupMembershipPath', () => { + const result = client.relatedAccountGroupMembershipPath( + 'projectValue', + 'relatedaccountgroupValue', + 'membershipValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.relatedAccountGroupMembershipPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRelatedAccountGroupMembershipName', () => { + const result = + client.matchProjectFromRelatedAccountGroupMembershipName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.relatedAccountGroupMembershipPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRelatedaccountgroupFromRelatedAccountGroupMembershipName', () => { + const result = + client.matchRelatedaccountgroupFromRelatedAccountGroupMembershipName( + fakePath + ); + assert.strictEqual(result, 'relatedaccountgroupValue'); + assert( + ( + client.pathTemplates.relatedAccountGroupMembershipPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMembershipFromRelatedAccountGroupMembershipName', () => { + const result = + client.matchMembershipFromRelatedAccountGroupMembershipName(fakePath); + assert.strictEqual(result, 'membershipValue'); + assert( + ( + client.pathTemplates.relatedAccountGroupMembershipPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); From 1c1c13147230e9661aa75b3a961dc198cae0c1c8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 9 Nov 2021 20:00:18 +0000 Subject: [PATCH 204/253] chore: release 2.4.0 (#332) :robot: I have created a release \*beep\* \*boop\* --- ## [2.4.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.3.0...v2.4.0) (2021-11-09) ### Features * add reCAPTCHA Enterprise account defender API methods ([#328](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/328)) ([2099c50](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/2099c503c2bb91347761b083140c66f22b042a0d)) --- 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-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 2e9cfdcc6cb..a0c26763286 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [2.4.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.3.0...v2.4.0) (2021-11-09) + + +### Features + +* add reCAPTCHA Enterprise account defender API methods ([#328](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/328)) ([2099c50](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/2099c503c2bb91347761b083140c66f22b042a0d)) + ## [2.3.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.2.1...v2.3.0) (2021-09-16) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 43c8b2d7daf..ce03c684c42 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.3.0", + "version": "2.4.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index b83d4d68feb..6f85a189a31 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.3.0" + "@google-cloud/recaptcha-enterprise": "^2.4.0" }, "devDependencies": { "chai": "^4.2.0", From be902c81342c3f7b56e6b5cc426492dd46ea2271 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 10 Nov 2021 21:38:33 +0000 Subject: [PATCH 205/253] docs(samples): add example tags to generated samples (#333) - [ ] Regenerate this pull request now. 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 --- .../linkinator.config.json | 2 +- ..._enterprise_service.annotate_assessment.js | 6 +- ...ha_enterprise_service.create_assessment.js | 6 +- ...recaptcha_enterprise_service.create_key.js | 6 +- ...recaptcha_enterprise_service.delete_key.js | 4 +- .../recaptcha_enterprise_service.get_key.js | 4 +- ...ecaptcha_enterprise_service.get_metrics.js | 4 +- .../recaptcha_enterprise_service.list_keys.js | 4 +- ....list_related_account_group_memberships.js | 4 +- ...ise_service.list_related_account_groups.js | 4 +- ...ecaptcha_enterprise_service.migrate_key.js | 4 +- ...earch_related_account_group_memberships.js | 4 +- ...recaptcha_enterprise_service.update_key.js | 8 +- ...se_service_v1_beta1.annotate_assessment.js | 6 +- ...rise_service_v1_beta1.create_assessment.js | 6 +- ..._enterprise_service_v1_beta1.create_key.js | 6 +- ..._enterprise_service_v1_beta1.delete_key.js | 4 +- ...cha_enterprise_service_v1_beta1.get_key.js | 4 +- ...a_enterprise_service_v1_beta1.list_keys.js | 4 +- ..._enterprise_service_v1_beta1.update_key.js | 8 +- .../v1/recaptcha_enterprise_service_client.ts | 634 +++++++++--------- ...tcha_enterprise_service_v1_beta1_client.ts | 296 ++++---- 22 files changed, 504 insertions(+), 524 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/linkinator.config.json b/packages/google-cloud-recaptchaenterprise/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-recaptchaenterprise/linkinator.config.json +++ b/packages/google-cloud-recaptchaenterprise/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js index 2779787863e..de80459b976 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js @@ -29,7 +29,7 @@ function main(name) { * empty to provide reasons that apply to an event without concluding whether * the event is legitimate or fraudulent. */ - // const annotation = '' + // const annotation = {} /** * Optional. Optional reasons for the annotation that will be assigned to the Event. */ @@ -50,7 +50,7 @@ function main(name) { // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); - async function annotateAssessment() { + async function callAnnotateAssessment() { // Construct request const request = { name, @@ -63,7 +63,7 @@ function main(name) { console.log(response); } - annotateAssessment(); + callAnnotateAssessment(); // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js index 5fb3cae509f..1dd499e5a6d 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js @@ -27,7 +27,7 @@ function main(parent, assessment) { /** * Required. The assessment details. */ - // const assessment = '' + // const assessment = {} // Imports the Recaptchaenterprise library const {RecaptchaEnterpriseServiceClient} = @@ -36,7 +36,7 @@ function main(parent, assessment) { // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); - async function createAssessment() { + async function callCreateAssessment() { // Construct request const request = { parent, @@ -48,7 +48,7 @@ function main(parent, assessment) { console.log(response); } - createAssessment(); + callCreateAssessment(); // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js index 971ccdb90aa..d883945baa9 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js @@ -27,7 +27,7 @@ function main(parent, key) { /** * Required. Information to create a reCAPTCHA Enterprise key. */ - // const key = '' + // const key = {} // Imports the Recaptchaenterprise library const {RecaptchaEnterpriseServiceClient} = @@ -36,7 +36,7 @@ function main(parent, key) { // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); - async function createKey() { + async function callCreateKey() { // Construct request const request = { parent, @@ -48,7 +48,7 @@ function main(parent, key) { console.log(response); } - createKey(); + callCreateKey(); // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js index db974b2e554..3610ef02ae5 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); - async function deleteKey() { + async function callDeleteKey() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - deleteKey(); + callDeleteKey(); // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js index dec6da8097e..6addf324246 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); - async function getKey() { + async function callGetKey() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getKey(); + callGetKey(); // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js index 9227d511010..fa09740a230 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); - async function getMetrics() { + async function callGetMetrics() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getMetrics(); + callGetMetrics(); // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js index e1dc8b321fd..5e257c6d6c7 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js @@ -42,7 +42,7 @@ function main(parent) { // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); - async function listKeys() { + async function callListKeys() { // Construct request const request = { parent, @@ -55,7 +55,7 @@ function main(parent) { } } - listKeys(); + callListKeys(); // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js index f747a9b6077..67ab03b7b48 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js @@ -47,7 +47,7 @@ function main(parent) { // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); - async function listRelatedAccountGroupMemberships() { + async function callListRelatedAccountGroupMemberships() { // Construct request const request = { parent, @@ -63,7 +63,7 @@ function main(parent) { } } - listRelatedAccountGroupMemberships(); + callListRelatedAccountGroupMemberships(); // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js index f5180d65a86..b450287957b 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js @@ -47,7 +47,7 @@ function main(parent) { // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); - async function listRelatedAccountGroups() { + async function callListRelatedAccountGroups() { // Construct request const request = { parent, @@ -61,7 +61,7 @@ function main(parent) { } } - listRelatedAccountGroups(); + callListRelatedAccountGroups(); // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js index 08046692fc2..14c61391cc9 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); - async function migrateKey() { + async function callMigrateKey() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - migrateKey(); + callMigrateKey(); // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js index febe66f6c51..367a18164b3 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js @@ -54,7 +54,7 @@ function main(parent) { // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); - async function searchRelatedAccountGroupMemberships() { + async function callSearchRelatedAccountGroupMemberships() { // Construct request const request = { parent, @@ -70,7 +70,7 @@ function main(parent) { } } - searchRelatedAccountGroupMemberships(); + callSearchRelatedAccountGroupMemberships(); // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js index eba40fd8665..064f58125f9 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js @@ -22,12 +22,12 @@ function main(key) { /** * Required. The key to update. */ - // const key = '' + // const key = {} /** * Optional. The mask to control which fields of the key get updated. If the mask is not * present, all fields will be updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Recaptchaenterprise library const {RecaptchaEnterpriseServiceClient} = @@ -36,7 +36,7 @@ function main(key) { // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); - async function updateKey() { + async function callUpdateKey() { // Construct request const request = { key, @@ -47,7 +47,7 @@ function main(key) { console.log(response); } - updateKey(); + callUpdateKey(); // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js index 65d244cffc3..ae540704812 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js @@ -27,7 +27,7 @@ function main(name, annotation) { /** * Required. The annotation that will be assigned to the Event. */ - // const annotation = '' + // const annotation = {} // Imports the Recaptchaenterprise library const {RecaptchaEnterpriseServiceV1Beta1Client} = @@ -37,7 +37,7 @@ function main(name, annotation) { const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceV1Beta1Client(); - async function annotateAssessment() { + async function callAnnotateAssessment() { // Construct request const request = { name, @@ -51,7 +51,7 @@ function main(name, annotation) { console.log(response); } - annotateAssessment(); + callAnnotateAssessment(); // [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_AnnotateAssessment_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js index 0bc42ac63a5..3f0b47ba831 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js @@ -27,7 +27,7 @@ function main(parent, assessment) { /** * Required. The assessment details. */ - // const assessment = '' + // const assessment = {} // Imports the Recaptchaenterprise library const {RecaptchaEnterpriseServiceV1Beta1Client} = @@ -37,7 +37,7 @@ function main(parent, assessment) { const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceV1Beta1Client(); - async function createAssessment() { + async function callCreateAssessment() { // Construct request const request = { parent, @@ -49,7 +49,7 @@ function main(parent, assessment) { console.log(response); } - createAssessment(); + callCreateAssessment(); // [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateAssessment_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.js index adcbe964af6..42874d11eb0 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.js @@ -27,7 +27,7 @@ function main(parent, key) { /** * Required. Information to create a reCAPTCHA Enterprise key. */ - // const key = '' + // const key = {} // Imports the Recaptchaenterprise library const {RecaptchaEnterpriseServiceV1Beta1Client} = @@ -37,7 +37,7 @@ function main(parent, key) { const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceV1Beta1Client(); - async function createKey() { + async function callCreateKey() { // Construct request const request = { parent, @@ -49,7 +49,7 @@ function main(parent, key) { console.log(response); } - createKey(); + callCreateKey(); // [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateKey_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.js index d850d9b5571..fd95e3a279b 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.js @@ -33,7 +33,7 @@ function main(name) { const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceV1Beta1Client(); - async function deleteKey() { + async function callDeleteKey() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - deleteKey(); + callDeleteKey(); // [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_DeleteKey_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.js index d6769ad7c10..5975fdfbf8f 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.js @@ -33,7 +33,7 @@ function main(name) { const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceV1Beta1Client(); - async function getKey() { + async function callGetKey() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - getKey(); + callGetKey(); // [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_GetKey_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js index 4685241568b..bcb9f4ed946 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js @@ -43,7 +43,7 @@ function main(parent) { const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceV1Beta1Client(); - async function listKeys() { + async function callListKeys() { // Construct request const request = { parent, @@ -56,7 +56,7 @@ function main(parent) { } } - listKeys(); + callListKeys(); // [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_ListKeys_async] } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js index b1188d41234..bb95a2a793e 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js @@ -22,12 +22,12 @@ function main(key) { /** * Required. The key to update. */ - // const key = '' + // const key = {} /** * Optional. The mask to control which field of the key get updated. If the mask is not * present, all fields will be updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Recaptchaenterprise library const {RecaptchaEnterpriseServiceV1Beta1Client} = @@ -37,7 +37,7 @@ function main(key) { const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceV1Beta1Client(); - async function updateKey() { + async function callUpdateKey() { // Construct request const request = { key, @@ -48,7 +48,7 @@ function main(key) { console.log(response); } - updateKey(); + callUpdateKey(); // [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_UpdateKey_async] } diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index 68d28ae4c74..5615373a104 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -357,6 +357,26 @@ export class RecaptchaEnterpriseServiceClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Creates an Assessment of the likelihood an event is legitimate. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the assessment will be created, + * in the format "projects/{project}". + * @param {google.cloud.recaptchaenterprise.v1.Assessment} request.assessment + * Required. The assessment details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1.Assessment}. + * 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/recaptcha_enterprise_service.create_assessment.js + * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_async + */ createAssessment( request?: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, options?: CallOptions @@ -391,26 +411,6 @@ export class RecaptchaEnterpriseServiceClient { {} | null | undefined > ): void; - /** - * Creates an Assessment of the likelihood an event is legitimate. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which the assessment will be created, - * in the format "projects/{project}". - * @param {google.cloud.recaptchaenterprise.v1.Assessment} request.assessment - * Required. The assessment details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1.Assessment}. - * 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.createAssessment(request); - */ createAssessment( request?: protos.google.cloud.recaptchaenterprise.v1.ICreateAssessmentRequest, optionsOrCallback?: @@ -457,6 +457,37 @@ export class RecaptchaEnterpriseServiceClient { this.initialize(); return this.innerApiCalls.createAssessment(request, options, callback); } + /** + * Annotates a previously created Assessment to provide additional information + * on whether the event turned out to be authentic or fraudulent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Assessment, in the format + * "projects/{project}/assessments/{assessment}". + * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} [request.annotation] + * Optional. The annotation that will be assigned to the Event. This field can be left + * empty to provide reasons that apply to an event without concluding whether + * the event is legitimate or fraudulent. + * @param {number[]} [request.reasons] + * Optional. Optional reasons for the annotation that will be assigned to the Event. + * @param {Buffer} [request.hashedAccountId] + * Optional. Optional unique stable hashed user identifier to apply to the assessment. + * This is an alternative to setting the hashed_account_id in + * CreateAssessment, for example when the account identifier is not yet known + * in the initial request. It is recommended that the identifier is hashed + * using hmac-sha256 with stable secret. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse}. + * 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/recaptcha_enterprise_service.annotate_assessment.js + * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_async + */ annotateAssessment( request?: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, options?: CallOptions @@ -491,37 +522,6 @@ export class RecaptchaEnterpriseServiceClient { {} | null | undefined > ): void; - /** - * Annotates a previously created Assessment to provide additional information - * on whether the event turned out to be authentic or fraudulent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Assessment, in the format - * "projects/{project}/assessments/{assessment}". - * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} [request.annotation] - * Optional. The annotation that will be assigned to the Event. This field can be left - * empty to provide reasons that apply to an event without concluding whether - * the event is legitimate or fraudulent. - * @param {number[]} [request.reasons] - * Optional. Optional reasons for the annotation that will be assigned to the Event. - * @param {Buffer} [request.hashedAccountId] - * Optional. Optional unique stable hashed user identifier to apply to the assessment. - * This is an alternative to setting the hashed_account_id in - * CreateAssessment, for example when the account identifier is not yet known - * in the initial request. It is recommended that the identifier is hashed - * using hmac-sha256 with stable secret. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse}. - * 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.annotateAssessment(request); - */ annotateAssessment( request?: protos.google.cloud.recaptchaenterprise.v1.IAnnotateAssessmentRequest, optionsOrCallback?: @@ -568,6 +568,26 @@ export class RecaptchaEnterpriseServiceClient { this.initialize(); return this.innerApiCalls.annotateAssessment(request, options, callback); } + /** + * Creates a new reCAPTCHA Enterprise key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the key will be created, in the + * format "projects/{project}". + * @param {google.cloud.recaptchaenterprise.v1.Key} request.key + * Required. Information to create a reCAPTCHA Enterprise key. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * 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/recaptcha_enterprise_service.create_key.js + * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_async + */ createKey( request?: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, options?: CallOptions @@ -599,26 +619,6 @@ export class RecaptchaEnterpriseServiceClient { {} | null | undefined > ): void; - /** - * Creates a new reCAPTCHA Enterprise key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which the key will be created, in the - * format "projects/{project}". - * @param {google.cloud.recaptchaenterprise.v1.Key} request.key - * Required. Information to create a reCAPTCHA Enterprise key. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * 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.createKey(request); - */ createKey( request?: protos.google.cloud.recaptchaenterprise.v1.ICreateKeyRequest, optionsOrCallback?: @@ -662,6 +662,24 @@ export class RecaptchaEnterpriseServiceClient { this.initialize(); return this.innerApiCalls.createKey(request, options, callback); } + /** + * Returns the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the requested key, in the format + * "projects/{project}/keys/{key}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * 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/recaptcha_enterprise_service.get_key.js + * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_async + */ getKey( request?: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, options?: CallOptions @@ -693,24 +711,6 @@ export class RecaptchaEnterpriseServiceClient { {} | null | undefined > ): void; - /** - * Returns the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the requested key, in the format - * "projects/{project}/keys/{key}". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * 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.getKey(request); - */ getKey( request?: protos.google.cloud.recaptchaenterprise.v1.IGetKeyRequest, optionsOrCallback?: @@ -754,6 +754,26 @@ export class RecaptchaEnterpriseServiceClient { this.initialize(); return this.innerApiCalls.getKey(request, options, callback); } + /** + * Updates the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.recaptchaenterprise.v1.Key} request.key + * Required. The key to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which fields of the key get updated. If the mask is not + * present, all fields will be 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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * 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/recaptcha_enterprise_service.update_key.js + * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_async + */ updateKey( request?: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, options?: CallOptions @@ -785,26 +805,6 @@ export class RecaptchaEnterpriseServiceClient { {} | null | undefined > ): void; - /** - * Updates the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.recaptchaenterprise.v1.Key} request.key - * Required. The key to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The mask to control which fields of the key get updated. If the mask is not - * present, all fields will be 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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * 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.updateKey(request); - */ updateKey( request?: protos.google.cloud.recaptchaenterprise.v1.IUpdateKeyRequest, optionsOrCallback?: @@ -848,6 +848,24 @@ export class RecaptchaEnterpriseServiceClient { this.initialize(); return this.innerApiCalls.updateKey(request, options, callback); } + /** + * Deletes the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the key to be deleted, in the format + * "projects/{project}/keys/{key}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * 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/recaptcha_enterprise_service.delete_key.js + * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_async + */ deleteKey( request?: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, options?: CallOptions @@ -879,24 +897,6 @@ export class RecaptchaEnterpriseServiceClient { {} | null | undefined > ): void; - /** - * Deletes the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the key to be deleted, in the format - * "projects/{project}/keys/{key}". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * 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.deleteKey(request); - */ deleteKey( request?: protos.google.cloud.recaptchaenterprise.v1.IDeleteKeyRequest, optionsOrCallback?: @@ -940,6 +940,29 @@ export class RecaptchaEnterpriseServiceClient { this.initialize(); return this.innerApiCalls.deleteKey(request, options, callback); } + /** + * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. + * Once a key is migrated, it can be used from either product. SiteVerify + * requests are billed as CreateAssessment calls. You must be + * authenticated as one of the current owners of the reCAPTCHA Site Key, and + * your user must have the reCAPTCHA Enterprise Admin IAM role in the + * destination project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the key to be migrated, in the format + * "projects/{project}/keys/{key}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * 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/recaptcha_enterprise_service.migrate_key.js + * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_async + */ migrateKey( request?: protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest, options?: CallOptions @@ -971,29 +994,6 @@ export class RecaptchaEnterpriseServiceClient { {} | null | undefined > ): void; - /** - * Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. - * Once a key is migrated, it can be used from either product. SiteVerify - * requests are billed as CreateAssessment calls. You must be - * authenticated as one of the current owners of the reCAPTCHA Site Key, and - * your user must have the reCAPTCHA Enterprise Admin IAM role in the - * destination project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the key to be migrated, in the format - * "projects/{project}/keys/{key}". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * 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.migrateKey(request); - */ migrateKey( request?: protos.google.cloud.recaptchaenterprise.v1.IMigrateKeyRequest, optionsOrCallback?: @@ -1037,6 +1037,25 @@ export class RecaptchaEnterpriseServiceClient { this.initialize(); return this.innerApiCalls.migrateKey(request, options, callback); } + /** + * Get some aggregated metrics for a Key. This data can be used to build + * dashboards. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the requested metrics, in the format + * "projects/{project}/keys/{key}/metrics". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Metrics]{@link google.cloud.recaptchaenterprise.v1.Metrics}. + * 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/recaptcha_enterprise_service.get_metrics.js + * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_async + */ getMetrics( request?: protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, options?: CallOptions @@ -1056,37 +1075,18 @@ export class RecaptchaEnterpriseServiceClient { | null | undefined, {} | null | undefined - > - ): void; - getMetrics( - request: protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1.IMetrics, - | protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Get some aggregated metrics for a Key. This data can be used to build - * dashboards. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the requested metrics, in the format - * "projects/{project}/keys/{key}/metrics". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Metrics]{@link google.cloud.recaptchaenterprise.v1.Metrics}. - * 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.getMetrics(request); - */ + > + ): void; + getMetrics( + request: protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IMetrics, + | protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest + | null + | undefined, + {} | null | undefined + > + ): void; getMetrics( request?: protos.google.cloud.recaptchaenterprise.v1.IGetMetricsRequest, optionsOrCallback?: @@ -1131,6 +1131,33 @@ export class RecaptchaEnterpriseServiceClient { return this.innerApiCalls.getMetrics(request, options, callback); } + /** + * Returns the list of all keys that belong to a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project that contains the keys that will be + * listed, in the format "projects/{project}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. + * 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 `listKeysAsync()` + * 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. + */ listKeys( request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, options?: CallOptions @@ -1162,33 +1189,6 @@ export class RecaptchaEnterpriseServiceClient { protos.google.cloud.recaptchaenterprise.v1.IKey > ): void; - /** - * Returns the list of all keys that belong to a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project that contains the keys that will be - * listed, in the format "projects/{project}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. - * 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 `listKeysAsync()` - * 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. - */ listKeys( request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, optionsOrCallback?: @@ -1305,11 +1305,8 @@ export class RecaptchaEnterpriseServiceClient { * 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.listKeysAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/recaptcha_enterprise_service.list_keys.js + * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_async */ listKeysAsync( request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, @@ -1323,7 +1320,6 @@ export class RecaptchaEnterpriseServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listKeys']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1333,37 +1329,6 @@ export class RecaptchaEnterpriseServiceClient { callSettings ) as AsyncIterable; } - listRelatedAccountGroups( - request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup[], - protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest | null, - protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse - ] - >; - listRelatedAccountGroups( - request: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, - | protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup - > - ): void; - listRelatedAccountGroups( - request: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, - callback: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, - | protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup - > - ): void; /** * List groups of related accounts. * @@ -1397,6 +1362,37 @@ export class RecaptchaEnterpriseServiceClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listRelatedAccountGroups( + request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup[], + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest | null, + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse + ] + >; + listRelatedAccountGroups( + request: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup + > + ): void; + listRelatedAccountGroups( + request: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroup + > + ): void; listRelatedAccountGroups( request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, optionsOrCallback?: @@ -1529,11 +1525,8 @@ export class RecaptchaEnterpriseServiceClient { * 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.listRelatedAccountGroupsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js + * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_async */ listRelatedAccountGroupsAsync( request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupsRequest, @@ -1547,7 +1540,6 @@ export class RecaptchaEnterpriseServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listRelatedAccountGroups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1557,37 +1549,6 @@ export class RecaptchaEnterpriseServiceClient { callSettings ) as AsyncIterable; } - listRelatedAccountGroupMemberships( - request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[], - protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest | null, - protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse - ] - >; - listRelatedAccountGroupMemberships( - request: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, - | protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership - > - ): void; - listRelatedAccountGroupMemberships( - request: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, - callback: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, - | protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership - > - ): void; /** * Get the memberships in a group of related accounts. * @@ -1621,6 +1582,37 @@ export class RecaptchaEnterpriseServiceClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listRelatedAccountGroupMemberships( + request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[], + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest | null, + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse + ] + >; + listRelatedAccountGroupMemberships( + request: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership + > + ): void; + listRelatedAccountGroupMemberships( + request: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, + | protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership + > + ): void; listRelatedAccountGroupMemberships( request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, optionsOrCallback?: @@ -1754,11 +1746,8 @@ export class RecaptchaEnterpriseServiceClient { * 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.listRelatedAccountGroupMembershipsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js + * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_async */ listRelatedAccountGroupMembershipsAsync( request?: protos.google.cloud.recaptchaenterprise.v1.IListRelatedAccountGroupMembershipsRequest, @@ -1772,7 +1761,6 @@ export class RecaptchaEnterpriseServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listRelatedAccountGroupMemberships']; const callSettings = defaultCallSettings.merge(options); @@ -1783,37 +1771,6 @@ export class RecaptchaEnterpriseServiceClient { callSettings ) as AsyncIterable; } - searchRelatedAccountGroupMemberships( - request?: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[], - protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest | null, - protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse - ] - >; - searchRelatedAccountGroupMemberships( - request: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, - | protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership - > - ): void; - searchRelatedAccountGroupMemberships( - request: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, - callback: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, - | protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership - > - ): void; /** * Search group memberships related to a given account. * @@ -1852,6 +1809,37 @@ export class RecaptchaEnterpriseServiceClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + searchRelatedAccountGroupMemberships( + request?: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership[], + protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest | null, + protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse + ] + >; + searchRelatedAccountGroupMemberships( + request: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, + | protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership + > + ): void; + searchRelatedAccountGroupMemberships( + request: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, + callback: PaginationCallback< + protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, + | protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsResponse + | null + | undefined, + protos.google.cloud.recaptchaenterprise.v1.IRelatedAccountGroupMembership + > + ): void; searchRelatedAccountGroupMemberships( request?: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, optionsOrCallback?: @@ -1995,11 +1983,8 @@ export class RecaptchaEnterpriseServiceClient { * 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.searchRelatedAccountGroupMembershipsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js + * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_async */ searchRelatedAccountGroupMembershipsAsync( request?: protos.google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest, @@ -2013,7 +1998,6 @@ export class RecaptchaEnterpriseServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['searchRelatedAccountGroupMemberships']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 23abb64c4ca..880c306cdcd 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -327,6 +327,26 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { // ------------------- // -- Service calls -- // ------------------- + /** + * Creates an Assessment of the likelihood an event is legitimate. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the assessment will be created, + * in the format "projects/{project_number}". + * @param {google.cloud.recaptchaenterprise.v1beta1.Assessment} request.assessment + * Required. The assessment details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js + * region_tag:recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateAssessment_async + */ createAssessment( request?: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, options?: CallOptions @@ -361,26 +381,6 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { {} | null | undefined > ): void; - /** - * Creates an Assessment of the likelihood an event is legitimate. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which the assessment will be created, - * in the format "projects/{project_number}". - * @param {google.cloud.recaptchaenterprise.v1beta1.Assessment} request.assessment - * Required. The assessment details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment}. - * 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.createAssessment(request); - */ createAssessment( request?: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateAssessmentRequest, optionsOrCallback?: @@ -427,6 +427,27 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { this.initialize(); return this.innerApiCalls.createAssessment(request, options, callback); } + /** + * Annotates a previously created Assessment to provide additional information + * on whether the event turned out to be authentic or fradulent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Assessment, in the format + * "projects/{project_number}/assessments/{assessment_id}". + * @param {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation} request.annotation + * Required. The annotation that will be assigned to the Event. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js + * region_tag:recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_AnnotateAssessment_async + */ annotateAssessment( request?: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, options?: CallOptions @@ -461,27 +482,6 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { {} | null | undefined > ): void; - /** - * Annotates a previously created Assessment to provide additional information - * on whether the event turned out to be authentic or fradulent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Assessment, in the format - * "projects/{project_number}/assessments/{assessment_id}". - * @param {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation} request.annotation - * Required. The annotation that will be assigned to the Event. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse}. - * 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.annotateAssessment(request); - */ annotateAssessment( request?: protos.google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest, optionsOrCallback?: @@ -528,6 +528,26 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { this.initialize(); return this.innerApiCalls.annotateAssessment(request, options, callback); } + /** + * Creates a new reCAPTCHA Enterprise key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project in which the key will be created, in the + * format "projects/{project_number}". + * @param {google.cloud.recaptchaenterprise.v1beta1.Key} request.key + * Required. Information to create a reCAPTCHA Enterprise key. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.js + * region_tag:recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateKey_async + */ createKey( request?: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, options?: CallOptions @@ -562,26 +582,6 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { {} | null | undefined > ): void; - /** - * Creates a new reCAPTCHA Enterprise key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which the key will be created, in the - * format "projects/{project_number}". - * @param {google.cloud.recaptchaenterprise.v1beta1.Key} request.key - * Required. Information to create a reCAPTCHA Enterprise key. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * 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.createKey(request); - */ createKey( request?: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, optionsOrCallback?: @@ -628,6 +628,24 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { this.initialize(); return this.innerApiCalls.createKey(request, options, callback); } + /** + * Returns the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the requested key, in the format + * "projects/{project_number}/keys/{key_id}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.js + * region_tag:recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_GetKey_async + */ getKey( request?: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, options?: CallOptions @@ -662,24 +680,6 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { {} | null | undefined > ): void; - /** - * Returns the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the requested key, in the format - * "projects/{project_number}/keys/{key_id}". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * 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.getKey(request); - */ getKey( request?: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, optionsOrCallback?: @@ -726,6 +726,26 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { this.initialize(); return this.innerApiCalls.getKey(request, options, callback); } + /** + * Updates the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.recaptchaenterprise.v1beta1.Key} request.key + * Required. The key to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which field of the key get updated. If the mask is not + * present, all fields will be 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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js + * region_tag:recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_UpdateKey_async + */ updateKey( request?: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, options?: CallOptions @@ -760,26 +780,6 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { {} | null | undefined > ): void; - /** - * Updates the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.recaptchaenterprise.v1beta1.Key} request.key - * Required. The key to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The mask to control which field of the key get updated. If the mask is not - * present, all fields will be 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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * 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.updateKey(request); - */ updateKey( request?: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, optionsOrCallback?: @@ -826,6 +826,24 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { this.initialize(); return this.innerApiCalls.updateKey(request, options, callback); } + /** + * Deletes the specified key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the key to be deleted, in the format + * "projects/{project_number}/keys/{key_id}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.js + * region_tag:recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_DeleteKey_async + */ deleteKey( request?: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, options?: CallOptions @@ -860,24 +878,6 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { {} | null | undefined > ): void; - /** - * Deletes the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the key to be deleted, in the format - * "projects/{project_number}/keys/{key_id}". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * 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.deleteKey(request); - */ deleteKey( request?: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, optionsOrCallback?: @@ -925,6 +925,33 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { return this.innerApiCalls.deleteKey(request, options, callback); } + /** + * Returns the list of all keys that belong to a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project that contains the keys that will be + * listed, in the format "projects/{project_number}". + * @param {number} [request.pageSize] + * Optional. The maximum number of keys to return. Default is 10. Max limit is + * 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous. + * ListKeysRequest, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. + * 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 `listKeysAsync()` + * 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. + */ listKeys( request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, options?: CallOptions @@ -956,33 +983,6 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { protos.google.cloud.recaptchaenterprise.v1beta1.IKey > ): void; - /** - * Returns the list of all keys that belong to a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project that contains the keys that will be - * listed, in the format "projects/{project_number}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * 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 `listKeysAsync()` - * 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. - */ listKeys( request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, optionsOrCallback?: @@ -1099,11 +1099,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * 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.listKeysAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js + * region_tag:recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_ListKeys_async */ listKeysAsync( request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, @@ -1117,7 +1114,6 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listKeys']; const callSettings = defaultCallSettings.merge(options); this.initialize(); From 1cf37adaac27134e6d903d8030742a1e366e1616 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 22:46:16 +0000 Subject: [PATCH 206/253] build: add generated samples to .eslintignore (#335) --- packages/google-cloud-recaptchaenterprise/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-recaptchaenterprise/.eslintignore b/packages/google-cloud-recaptchaenterprise/.eslintignore index 9340ad9b86d..ea5b04aebe6 100644 --- a/packages/google-cloud-recaptchaenterprise/.eslintignore +++ b/packages/google-cloud-recaptchaenterprise/.eslintignore @@ -4,3 +4,4 @@ test/fixtures build/ docs/ protos/ +samples/generated/ From 272b5595d67e4c0d3b8dc6b8b55784fa7e580b55 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 10 Dec 2021 21:48:18 +0000 Subject: [PATCH 207/253] feat: add new reCAPTCHA Enterprise fraud annotations (#334) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 414549384 Source-Link: https://github.com/googleapis/googleapis/commit/9b9da22ee21750793c110aa98eeb63034c1484ca Source-Link: https://github.com/googleapis/googleapis-gen/commit/e4e3b2c01ce675c100ed54519cad3274ea20a8a2 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTRlM2IyYzAxY2U2NzVjMTAwZWQ1NDUxOWNhZDMyNzRlYTIwYThhMiJ9 --- .../v1/recaptchaenterprise.proto | 15 +++++++++++++-- .../protos/protos.d.ts | 2 ++ .../protos/protos.js | 14 ++++++++++++++ .../protos/protos.json | 2 ++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index a2dd1ba2040..1be736a6b39 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -186,10 +186,21 @@ message AnnotateAssessmentRequest { // Default unspecified reason. REASON_UNSPECIFIED = 0; - // Indicates a chargeback for fraud was issued for the transaction - // associated with the assessment. + // Indicates a chargeback was issued for the transaction associated with the + // assessment, with no other details. When possible, specify the type by + // using CHARGEBACK_FRAUD or CHARGEBACK_DISPUTE instead. CHARGEBACK = 1; + // Indicates a chargeback related to an alleged unauthorized transaction + // from the perspective of the cardholder (for example, the card number was + // stolen). + CHARGEBACK_FRAUD = 8; + + // Indicates a chargeback related to the cardholder having provided their + // card but allegedly not being satisfied with the purchase + // (for example, misrepresentation, attempted cancellation). + CHARGEBACK_DISPUTE = 9; + // Indicates the transaction associated with the assessment is suspected of // being fraudulent based on the payment method, billing details, shipping // address or other transaction information. diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 5f2fd7b03af..3e626a821a6 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -521,6 +521,8 @@ export namespace google { enum Reason { REASON_UNSPECIFIED = 0, CHARGEBACK = 1, + CHARGEBACK_FRAUD = 8, + CHARGEBACK_DISPUTE = 9, PAYMENT_HEURISTICS = 2, INITIATED_TWO_FACTOR = 7, PASSED_TWO_FACTOR = 3, diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index b415fed0ab7..d2b226810e8 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -919,6 +919,8 @@ return "reasons: enum value[] expected"; case 0: case 1: + case 8: + case 9: case 2: case 7: case 3: @@ -985,6 +987,14 @@ case 1: message.reasons[i] = 1; break; + case "CHARGEBACK_FRAUD": + case 8: + message.reasons[i] = 8; + break; + case "CHARGEBACK_DISPUTE": + case 9: + message.reasons[i] = 9; + break; case "PAYMENT_HEURISTICS": case 2: message.reasons[i] = 2; @@ -1096,6 +1106,8 @@ * @enum {number} * @property {number} REASON_UNSPECIFIED=0 REASON_UNSPECIFIED value * @property {number} CHARGEBACK=1 CHARGEBACK value + * @property {number} CHARGEBACK_FRAUD=8 CHARGEBACK_FRAUD value + * @property {number} CHARGEBACK_DISPUTE=9 CHARGEBACK_DISPUTE value * @property {number} PAYMENT_HEURISTICS=2 PAYMENT_HEURISTICS value * @property {number} INITIATED_TWO_FACTOR=7 INITIATED_TWO_FACTOR value * @property {number} PASSED_TWO_FACTOR=3 PASSED_TWO_FACTOR value @@ -1107,6 +1119,8 @@ var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "REASON_UNSPECIFIED"] = 0; values[valuesById[1] = "CHARGEBACK"] = 1; + values[valuesById[8] = "CHARGEBACK_FRAUD"] = 8; + values[valuesById[9] = "CHARGEBACK_DISPUTE"] = 9; values[valuesById[2] = "PAYMENT_HEURISTICS"] = 2; values[valuesById[7] = "INITIATED_TWO_FACTOR"] = 7; values[valuesById[3] = "PASSED_TWO_FACTOR"] = 3; diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index c9911f0f010..d181a3bb919 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -296,6 +296,8 @@ "values": { "REASON_UNSPECIFIED": 0, "CHARGEBACK": 1, + "CHARGEBACK_FRAUD": 8, + "CHARGEBACK_DISPUTE": 9, "PAYMENT_HEURISTICS": 2, "INITIATED_TWO_FACTOR": 7, "PASSED_TWO_FACTOR": 3, From 2953c623fbfcc57c3109e754dbeb40ad2139a9db Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 13 Dec 2021 09:57:55 -0800 Subject: [PATCH 208/253] chore: release 2.5.0 (#336) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index a0c26763286..4951b4b6e67 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [2.5.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.4.0...v2.5.0) (2021-12-10) + + +### Features + +* add new reCAPTCHA Enterprise fraud annotations ([#334](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/334)) ([24fdff1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/24fdff1520fb8ff3192be7d256f7a7875d5803b6)) + ## [2.4.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.3.0...v2.4.0) (2021-11-09) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index ce03c684c42..a7c6899cf33 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.4.0", + "version": "2.5.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 6f85a189a31..73d9c3115f4 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.4.0" + "@google-cloud/recaptcha-enterprise": "^2.5.0" }, "devDependencies": { "chai": "^4.2.0", From c2e1ec6385cb924657075b173de1f82681c222b1 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:58:15 +0000 Subject: [PATCH 209/253] docs(node): support "stable"/"preview" release level (#1312) (#339) --- packages/google-cloud-recaptchaenterprise/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index 2e961f75932..74832dd6fb0 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -136,6 +136,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 f5a319b8a74e10d6522766a90435ca5b335cb7fc Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 30 Dec 2021 12:31:13 -0500 Subject: [PATCH 210/253] chore: add api_shortname and library_type to repo metadata (#338) --- .../google-cloud-recaptchaenterprise/.repo-metadata.json | 6 ++++-- packages/google-cloud-recaptchaenterprise/README.md | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.repo-metadata.json b/packages/google-cloud-recaptchaenterprise/.repo-metadata.json index 20c1f6c861b..ba318eb8991 100644 --- a/packages/google-cloud-recaptchaenterprise/.repo-metadata.json +++ b/packages/google-cloud-recaptchaenterprise/.repo-metadata.json @@ -2,7 +2,7 @@ "client_documentation": "https://cloud.google.com/nodejs/docs/reference/recaptcha-enterprise/latest", "api_id": "recaptchaenterprise.googleapis.com", "distribution_name": "@google-cloud/recaptcha-enterprise", - "release_level": "ga", + "release_level": "stable", "default_version": "v1", "language": "nodejs", "name_pretty": "Google Cloud reCAPTCHA Enterprise", @@ -10,5 +10,7 @@ "product_documentation": "https://cloud.google.com/recaptcha-enterprise/docs/", "requires_billing": true, "name": "recaptcha-enterprise", - "issue_tracker": "" + "issue_tracker": "https://github.com/googleapis/nodejs-recaptcha-enterprise/issues", + "api_shortname": "recaptchaenterprise", + "library_type": "GAPIC_AUTO" } diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index 74832dd6fb0..2a894cfa7ee 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -4,7 +4,7 @@ # [Google Cloud reCAPTCHA Enterprise: Node.js Client](https://github.com/googleapis/nodejs-recaptcha-enterprise) -[![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/recaptcha-enterprise.svg)](https://www.npmjs.org/package/@google-cloud/recaptcha-enterprise) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-recaptcha-enterprise/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-recaptcha-enterprise) @@ -126,10 +126,10 @@ _Legacy Node.js versions are supported as a best effort:_ This library follows [Semantic Versioning](http://semver.org/). -This library is considered to be **General Availability (GA)**. This means it -is stable; the code surface will not change in backwards-incompatible ways + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways unless absolutely necessary (e.g. because of critical security issues) or with -an extensive deprecation period. Issues and requests against **GA** libraries +an extensive deprecation period. Issues and requests against **stable** libraries are addressed with the highest priority. @@ -137,7 +137,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 039d19ddfbb87285ea7902ad0b88ef40e0a79d7a 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:08:12 +0000 Subject: [PATCH 211/253] docs(badges): tweak badge to use new preview/stable language (#1314) (#341) --- packages/google-cloud-recaptchaenterprise/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index 2a894cfa7ee..0bb26f38ca3 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -4,9 +4,8 @@ # [Google Cloud reCAPTCHA Enterprise: Node.js Client](https://github.com/googleapis/nodejs-recaptcha-enterprise) - +[![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/recaptcha-enterprise.svg)](https://www.npmjs.org/package/@google-cloud/recaptcha-enterprise) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-recaptcha-enterprise/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-recaptcha-enterprise) From 72485321ce08f1e83b1dd18c4c8137ecfb56aa13 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:08:24 +0000 Subject: [PATCH 212/253] test(nodejs): remove 15 add 16 (#1322) (#343) --- packages/google-cloud-recaptchaenterprise/protos/protos.d.ts | 2 +- packages/google-cloud-recaptchaenterprise/protos/protos.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 3e626a821a6..7cef6507cd6 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index d2b226810e8..7ad309e37a6 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/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 bc65933f6e3f3552e86d725bbfa4860af40a6646 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 19 Jan 2022 23:52:52 -0800 Subject: [PATCH 213/253] build: update copyright year to 2022 (#346) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): upgrade gapic-generator-java to 2.4.1 PiperOrigin-RevId: 422607515 Source-Link: https://github.com/googleapis/googleapis/commit/ba2ffd6fe6642e28b4fed2ffae217b4c5f084034 Source-Link: https://github.com/googleapis/googleapis-gen/commit/73ba4add239a619da567ffbd4e5730fdd6de04d3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzNiYTRhZGQyMzlhNjE5ZGE1NjdmZmJkNGU1NzMwZmRkNmRlMDRkMyJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- packages/google-cloud-recaptchaenterprise/.jsdoc.js | 4 ++-- ...ecaptcha_enterprise_service.annotate_assessment.js | 8 +++----- .../recaptcha_enterprise_service.create_assessment.js | 4 ++-- .../v1/recaptcha_enterprise_service.create_key.js | 4 ++-- .../v1/recaptcha_enterprise_service.delete_key.js | 4 ++-- .../v1/recaptcha_enterprise_service.get_key.js | 4 ++-- .../v1/recaptcha_enterprise_service.get_metrics.js | 4 ++-- .../v1/recaptcha_enterprise_service.list_keys.js | 6 +++--- ..._service.list_related_account_group_memberships.js | 11 ++++------- ..._enterprise_service.list_related_account_groups.js | 9 ++++----- .../v1/recaptcha_enterprise_service.migrate_key.js | 4 ++-- ...ervice.search_related_account_group_memberships.js | 11 ++++------- .../v1/recaptcha_enterprise_service.update_key.js | 4 ++-- ...enterprise_service_v1_beta1.annotate_assessment.js | 11 ++++------- ...a_enterprise_service_v1_beta1.create_assessment.js | 7 +++---- ...ecaptcha_enterprise_service_v1_beta1.create_key.js | 7 +++---- ...ecaptcha_enterprise_service_v1_beta1.delete_key.js | 7 +++---- .../recaptcha_enterprise_service_v1_beta1.get_key.js | 7 +++---- ...recaptcha_enterprise_service_v1_beta1.list_keys.js | 9 ++++----- ...ecaptcha_enterprise_service_v1_beta1.update_key.js | 7 +++---- .../google-cloud-recaptchaenterprise/src/v1/index.ts | 2 +- .../src/v1/recaptcha_enterprise_service_client.ts | 2 +- .../src/v1beta1/index.ts | 2 +- .../recaptcha_enterprise_service_v1_beta1_client.ts | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../system-test/install.ts | 2 +- .../test/gapic_recaptcha_enterprise_service_v1.ts | 2 +- ...c_recaptcha_enterprise_service_v1_beta1_v1beta1.ts | 2 +- 29 files changed, 66 insertions(+), 84 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/.jsdoc.js b/packages/google-cloud-recaptchaenterprise/.jsdoc.js index b6e3bb50897..fd8d38512d4 100644 --- a/packages/google-cloud-recaptchaenterprise/.jsdoc.js +++ b/packages/google-cloud-recaptchaenterprise/.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/recaptcha-enterprise', diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js index de80459b976..d3bca764bcd 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -44,8 +45,7 @@ function main(name) { // const hashedAccountId = 'Buffer.from('string')' // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceClient} = - require('@google-cloud/recaptcha-enterprise').v1; + const {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1; // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); @@ -57,9 +57,7 @@ function main(name) { }; // Run request - const response = await recaptchaenterpriseClient.annotateAssessment( - request - ); + const response = await recaptchaenterpriseClient.annotateAssessment(request); console.log(response); } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js index 1dd499e5a6d..fce5aa2e242 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, assessment) { @@ -30,8 +31,7 @@ function main(parent, assessment) { // const assessment = {} // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceClient} = - require('@google-cloud/recaptcha-enterprise').v1; + const {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1; // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js index d883945baa9..1c516661472 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, key) { @@ -30,8 +31,7 @@ function main(parent, key) { // const key = {} // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceClient} = - require('@google-cloud/recaptcha-enterprise').v1; + const {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1; // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js index 3610ef02ae5..e3101e8fc6b 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceClient} = - require('@google-cloud/recaptcha-enterprise').v1; + const {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1; // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js index 6addf324246..12bce4b7523 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceClient} = - require('@google-cloud/recaptcha-enterprise').v1; + const {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1; // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js index fa09740a230..be33e231aec 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceClient} = - require('@google-cloud/recaptcha-enterprise').v1; + const {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1; // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js index 5e257c6d6c7..555701896e3 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -36,8 +37,7 @@ function main(parent) { // const pageToken = 'abc123' // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceClient} = - require('@google-cloud/recaptcha-enterprise').v1; + const {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1; // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); @@ -51,7 +51,7 @@ function main(parent) { // Run request const iterable = await recaptchaenterpriseClient.listKeysAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js index 67ab03b7b48..83c71d03862 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -41,8 +42,7 @@ function main(parent) { // const pageToken = 'abc123' // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceClient} = - require('@google-cloud/recaptcha-enterprise').v1; + const {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1; // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); @@ -54,12 +54,9 @@ function main(parent) { }; // Run request - const iterable = - await recaptchaenterpriseClient.listRelatedAccountGroupMembershipsAsync( - request - ); + const iterable = await recaptchaenterpriseClient.listRelatedAccountGroupMembershipsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js index b450287957b..c03934244e6 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -41,8 +42,7 @@ function main(parent) { // const pageToken = 'abc123' // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceClient} = - require('@google-cloud/recaptcha-enterprise').v1; + const {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1; // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); @@ -54,10 +54,9 @@ function main(parent) { }; // Run request - const iterable = - await recaptchaenterpriseClient.listRelatedAccountGroupsAsync(request); + const iterable = await recaptchaenterpriseClient.listRelatedAccountGroupsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js index 14c61391cc9..a84bab6605d 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceClient} = - require('@google-cloud/recaptcha-enterprise').v1; + const {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1; // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js index 367a18164b3..9f6c80046ee 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -48,8 +49,7 @@ function main(parent) { // const pageToken = 'abc123' // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceClient} = - require('@google-cloud/recaptcha-enterprise').v1; + const {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1; // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); @@ -61,12 +61,9 @@ function main(parent) { }; // Run request - const iterable = - await recaptchaenterpriseClient.searchRelatedAccountGroupMembershipsAsync( - request - ); + const iterable = await recaptchaenterpriseClient.searchRelatedAccountGroupMembershipsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js index 064f58125f9..eae0df5894c 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(key) { @@ -30,8 +31,7 @@ function main(key) { // const updateMask = {} // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceClient} = - require('@google-cloud/recaptcha-enterprise').v1; + const {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1; // Instantiates a client const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js index ae540704812..a1b22b0f565 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name, annotation) { @@ -30,12 +31,10 @@ function main(name, annotation) { // const annotation = {} // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceV1Beta1Client} = - require('@google-cloud/recaptcha-enterprise').v1beta1; + const {RecaptchaEnterpriseServiceV1Beta1Client} = require('@google-cloud/recaptcha-enterprise').v1beta1; // Instantiates a client - const recaptchaenterpriseClient = - new RecaptchaEnterpriseServiceV1Beta1Client(); + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceV1Beta1Client(); async function callAnnotateAssessment() { // Construct request @@ -45,9 +44,7 @@ function main(name, annotation) { }; // Run request - const response = await recaptchaenterpriseClient.annotateAssessment( - request - ); + const response = await recaptchaenterpriseClient.annotateAssessment(request); console.log(response); } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js index 3f0b47ba831..3fc71f5d04c 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, assessment) { @@ -30,12 +31,10 @@ function main(parent, assessment) { // const assessment = {} // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceV1Beta1Client} = - require('@google-cloud/recaptcha-enterprise').v1beta1; + const {RecaptchaEnterpriseServiceV1Beta1Client} = require('@google-cloud/recaptcha-enterprise').v1beta1; // Instantiates a client - const recaptchaenterpriseClient = - new RecaptchaEnterpriseServiceV1Beta1Client(); + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceV1Beta1Client(); async function callCreateAssessment() { // Construct request diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.js index 42874d11eb0..6415203f968 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, key) { @@ -30,12 +31,10 @@ function main(parent, key) { // const key = {} // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceV1Beta1Client} = - require('@google-cloud/recaptcha-enterprise').v1beta1; + const {RecaptchaEnterpriseServiceV1Beta1Client} = require('@google-cloud/recaptcha-enterprise').v1beta1; // Instantiates a client - const recaptchaenterpriseClient = - new RecaptchaEnterpriseServiceV1Beta1Client(); + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceV1Beta1Client(); async function callCreateKey() { // Construct request diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.js index fd95e3a279b..14babc5f5dd 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,12 +27,10 @@ function main(name) { // const name = 'abc123' // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceV1Beta1Client} = - require('@google-cloud/recaptcha-enterprise').v1beta1; + const {RecaptchaEnterpriseServiceV1Beta1Client} = require('@google-cloud/recaptcha-enterprise').v1beta1; // Instantiates a client - const recaptchaenterpriseClient = - new RecaptchaEnterpriseServiceV1Beta1Client(); + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceV1Beta1Client(); async function callDeleteKey() { // Construct request diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.js index 5975fdfbf8f..3dda3d99270 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,12 +27,10 @@ function main(name) { // const name = 'abc123' // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceV1Beta1Client} = - require('@google-cloud/recaptcha-enterprise').v1beta1; + const {RecaptchaEnterpriseServiceV1Beta1Client} = require('@google-cloud/recaptcha-enterprise').v1beta1; // Instantiates a client - const recaptchaenterpriseClient = - new RecaptchaEnterpriseServiceV1Beta1Client(); + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceV1Beta1Client(); async function callGetKey() { // Construct request diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js index bcb9f4ed946..61551fbec5d 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -36,12 +37,10 @@ function main(parent) { // const pageToken = 'abc123' // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceV1Beta1Client} = - require('@google-cloud/recaptcha-enterprise').v1beta1; + const {RecaptchaEnterpriseServiceV1Beta1Client} = require('@google-cloud/recaptcha-enterprise').v1beta1; // Instantiates a client - const recaptchaenterpriseClient = - new RecaptchaEnterpriseServiceV1Beta1Client(); + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceV1Beta1Client(); async function callListKeys() { // Construct request @@ -52,7 +51,7 @@ function main(parent) { // Run request const iterable = await recaptchaenterpriseClient.listKeysAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js index bb95a2a793e..7910cec942c 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(key) { @@ -30,12 +31,10 @@ function main(key) { // const updateMask = {} // Imports the Recaptchaenterprise library - const {RecaptchaEnterpriseServiceV1Beta1Client} = - require('@google-cloud/recaptcha-enterprise').v1beta1; + const {RecaptchaEnterpriseServiceV1Beta1Client} = require('@google-cloud/recaptcha-enterprise').v1beta1; // Instantiates a client - const recaptchaenterpriseClient = - new RecaptchaEnterpriseServiceV1Beta1Client(); + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceV1Beta1Client(); async function callUpdateKey() { // Construct request diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/index.ts b/packages/google-cloud-recaptchaenterprise/src/v1/index.ts index 2159903e2fe..0d9bc262643 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/index.ts +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index 5615373a104..694267166d7 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_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-recaptchaenterprise/src/v1beta1/index.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/index.ts index 6314ef606cf..7cf779e456f 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/index.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 880c306cdcd..a0575317a61 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_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-recaptchaenterprise/system-test/fixtures/sample/src/index.js b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js index d686cde343d..88f738cf909 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts index ad545b0d6fc..0cfe4da061f 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/system-test/install.ts b/packages/google-cloud-recaptchaenterprise/system-test/install.ts index d2d61c0396f..6dd1eaadafa 100644 --- a/packages/google-cloud-recaptchaenterprise/system-test/install.ts +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index 38bb157033c..e3ae8660c4f 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_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-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts index c5c060f6c1c..37af3b9bde0 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 722db646a91d03f6e32850e1917ecd9067f33ed9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 20 Jan 2022 09:00:28 +0100 Subject: [PATCH 214/253] chore(deps): update dependency gts to v3 (#344) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency gts to v3 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Benjamin E. Coe Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index a7c6899cf33..b0bc35a1dff 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -32,7 +32,7 @@ "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.0.0", - "gts": "^2.0.0", + "gts": "^3.0.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", From f58fcb3984b093a8f0fb5c7b553e17568a02f5e7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 26 Jan 2022 19:54:36 +0000 Subject: [PATCH 215/253] chore: update v2.12.0 gapic-generator-typescript (#348) - [ ] Regenerate this pull request now. Committer: @summer-ji-eng PiperOrigin-RevId: 424244721 Source-Link: https://github.com/googleapis/googleapis/commit/4b6b01f507ebc3df95fdf8e1d76b0ae0ae33e52c Source-Link: https://github.com/googleapis/googleapis-gen/commit/8ac83fba606d008c7e8a42e7d55b6596ec4be35f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGFjODNmYmE2MDZkMDA4YzdlOGE0MmU3ZDU1YjY1OTZlYzRiZTM1ZiJ9 --- .../linkinator.config.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/linkinator.config.json b/packages/google-cloud-recaptchaenterprise/linkinator.config.json index 0121dfa684f..befd23c8633 100644 --- a/packages/google-cloud-recaptchaenterprise/linkinator.config.json +++ b/packages/google-cloud-recaptchaenterprise/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 } From a436cad6e7433de2b2e4618bcf4518827841afde Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 31 Jan 2022 23:38:25 +0100 Subject: [PATCH 216/253] chore(deps): update dependency sinon to v13 (#350) 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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index b0bc35a1dff..0ee384eb44d 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -40,7 +40,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 075aa4db69224e9a61c0af94f079a465dfab14b7 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:05:04 +0000 Subject: [PATCH 217/253] docs(nodejs): version support policy edits (#1346) (#352) --- .../README.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index 0bb26f38ca3..dbfb425e1e5 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -104,21 +104,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/recaptcha-enterprise@legacy-8` installs client libraries +for versions compatible with Node.js 8. ## Versioning From 397d3cb63e216c76c58acc90982103affa09d81d 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:02:57 +0000 Subject: [PATCH 218/253] docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#354) - [ ] 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 --- ..._enterprise_service.annotate_assessment.js | 9 +- ...ha_enterprise_service.create_assessment.js | 9 +- ...recaptcha_enterprise_service.create_key.js | 9 +- ...recaptcha_enterprise_service.delete_key.js | 9 +- .../recaptcha_enterprise_service.get_key.js | 9 +- ...ecaptcha_enterprise_service.get_metrics.js | 9 +- .../recaptcha_enterprise_service.list_keys.js | 9 +- ....list_related_account_group_memberships.js | 9 +- ...ise_service.list_related_account_groups.js | 9 +- ...ecaptcha_enterprise_service.migrate_key.js | 9 +- ...earch_related_account_group_memberships.js | 9 +- ...recaptcha_enterprise_service.update_key.js | 9 +- ...a.google.cloud.recaptchaenterprise.v1.json | 555 ++++++++++++++++++ ...se_service_v1_beta1.annotate_assessment.js | 9 +- ...rise_service_v1_beta1.create_assessment.js | 9 +- ..._enterprise_service_v1_beta1.create_key.js | 9 +- ..._enterprise_service_v1_beta1.delete_key.js | 9 +- ...cha_enterprise_service_v1_beta1.get_key.js | 9 +- ...a_enterprise_service_v1_beta1.list_keys.js | 9 +- ..._enterprise_service_v1_beta1.update_key.js | 9 +- ...gle.cloud.recaptchaenterprise.v1beta1.json | 319 ++++++++++ .../v1/recaptcha_enterprise_service_client.ts | 5 +- ...tcha_enterprise_service_v1_beta1_client.ts | 5 +- .../gapic_recaptcha_enterprise_service_v1.ts | 173 +++++- ...cha_enterprise_service_v1_beta1_v1beta1.ts | 137 ++++- 25 files changed, 1317 insertions(+), 48 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js index d3bca764bcd..0ed78fbf25f 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js index fce5aa2e242..62cadd841bc 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js index 1c516661472..3a016b15615 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js index e3101e8fc6b..4450343750c 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js index 12bce4b7523..bc0923e6123 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js index be33e231aec..8f8c24e17f7 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js index 555701896e3..2f69a5ef14d 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js index 83c71d03862..c2853cdb084 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js index c03934244e6..c4972529135 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js index a84bab6605d..1630b4edae7 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js index 9f6c80046ee..4c02dc44a00 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js index eae0df5894c..b4c91cd165b 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.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-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json new file mode 100644 index 00000000000..e9282e4ed13 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -0,0 +1,555 @@ +{ + "clientLibrary": { + "name": "nodejs-recaptchaenterprise", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.recaptchaenterprise.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_async", + "title": "RecaptchaEnterpriseService createAssessment Sample", + "origin": "API_DEFINITION", + "description": " Creates an Assessment of the likelihood an event is legitimate.", + "canonical": true, + "file": "recaptcha_enterprise_service.create_assessment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateAssessment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "assessment", + "type": ".google.cloud.recaptchaenterprise.v1.Assessment" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.Assessment", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "CreateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateAssessment", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_async", + "title": "RecaptchaEnterpriseService annotateAssessment Sample", + "origin": "API_DEFINITION", + "description": " Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fraudulent.", + "canonical": true, + "file": "recaptcha_enterprise_service.annotate_assessment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnnotateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.AnnotateAssessment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "annotation", + "type": ".google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation" + }, + { + "name": "reasons", + "type": "TYPE_ENUM[]" + }, + { + "name": "hashed_account_id", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "AnnotateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.AnnotateAssessment", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_async", + "title": "RecaptchaEnterpriseService createKey Sample", + "origin": "API_DEFINITION", + "description": " Creates a new reCAPTCHA Enterprise key.", + "canonical": true, + "file": "recaptcha_enterprise_service.create_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateKey", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "key", + "type": ".google.cloud.recaptchaenterprise.v1.Key" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.Key", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "CreateKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateKey", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_async", + "title": "RecaptchaEnterpriseService listKeys Sample", + "origin": "API_DEFINITION", + "description": " Returns the list of all keys that belong to a project.", + "canonical": true, + "file": "recaptcha_enterprise_service.list_keys.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListKeys", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListKeys", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.ListKeysResponse", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "ListKeys", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListKeys", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_async", + "title": "RecaptchaEnterpriseService getKey Sample", + "origin": "API_DEFINITION", + "description": " Returns the specified key.", + "canonical": true, + "file": "recaptcha_enterprise_service.get_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.Key", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "GetKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetKey", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_async", + "title": "RecaptchaEnterpriseService updateKey Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified key.", + "canonical": true, + "file": "recaptcha_enterprise_service.update_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.UpdateKey", + "async": true, + "parameters": [ + { + "name": "key", + "type": ".google.cloud.recaptchaenterprise.v1.Key" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.Key", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "UpdateKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.UpdateKey", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_async", + "title": "RecaptchaEnterpriseService deleteKey Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified key.", + "canonical": true, + "file": "recaptcha_enterprise_service.delete_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.DeleteKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "DeleteKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.DeleteKey", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_async", + "title": "RecaptchaEnterpriseService migrateKey Sample", + "origin": "API_DEFINITION", + "description": " Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. Once a key is migrated, it can be used from either product. SiteVerify requests are billed as CreateAssessment calls. You must be authenticated as one of the current owners of the reCAPTCHA Site Key, and your user must have the reCAPTCHA Enterprise Admin IAM role in the destination project.", + "canonical": true, + "file": "recaptcha_enterprise_service.migrate_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MigrateKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.MigrateKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.Key", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "MigrateKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.MigrateKey", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_async", + "title": "RecaptchaEnterpriseService getMetrics Sample", + "origin": "API_DEFINITION", + "description": " Get some aggregated metrics for a Key. This data can be used to build dashboards.", + "canonical": true, + "file": "recaptcha_enterprise_service.get_metrics.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMetrics", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetMetrics", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.Metrics", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "GetMetrics", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetMetrics", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_async", + "title": "RecaptchaEnterpriseService listRelatedAccountGroups Sample", + "origin": "API_DEFINITION", + "description": " List groups of related accounts.", + "canonical": true, + "file": "recaptcha_enterprise_service.list_related_account_groups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRelatedAccountGroups", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "ListRelatedAccountGroups", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroups", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_async", + "title": "RecaptchaEnterpriseService listRelatedAccountGroupMemberships Sample", + "origin": "API_DEFINITION", + "description": " Get the memberships in a group of related accounts.", + "canonical": true, + "file": "recaptcha_enterprise_service.list_related_account_group_memberships.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRelatedAccountGroupMemberships", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroupMemberships", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "ListRelatedAccountGroupMemberships", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroupMemberships", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_async", + "title": "RecaptchaEnterpriseService searchRelatedAccountGroupMemberships Sample", + "origin": "API_DEFINITION", + "description": " Search group memberships related to a given account.", + "canonical": true, + "file": "recaptcha_enterprise_service.search_related_account_group_memberships.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchRelatedAccountGroupMemberships", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.SearchRelatedAccountGroupMemberships", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "hashed_account_id", + "type": "TYPE_BYTES" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "SearchRelatedAccountGroupMemberships", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.SearchRelatedAccountGroupMemberships", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } + } + ] +} diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js index a1b22b0f565..f407558acd1 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.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-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js index 3fc71f5d04c..b0ceb63bb86 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.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-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.js index 6415203f968..b835923f453 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.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-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.js index 14babc5f5dd..149836ef693 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.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-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.js index 3dda3d99270..42ab9e46ddf 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.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-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js index 61551fbec5d..53096252862 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.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-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js index 7910cec942c..b1c78ff1a26 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.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-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json new file mode 100644 index 00000000000..b1104f833cc --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json @@ -0,0 +1,319 @@ +{ + "clientLibrary": { + "name": "nodejs-recaptchaenterprise", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.recaptchaenterprise.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateAssessment_async", + "title": "RecaptchaEnterpriseServiceV1Beta1 createAssessment Sample", + "origin": "API_DEFINITION", + "description": " Creates an Assessment of the likelihood an event is legitimate.", + "canonical": true, + "file": "recaptcha_enterprise_service_v1_beta1.create_assessment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateAssessment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "assessment", + "type": ".google.cloud.recaptchaenterprise.v1beta1.Assessment" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1beta1.Assessment", + "client": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + }, + "method": { + "shortName": "CreateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateAssessment", + "service": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_AnnotateAssessment_async", + "title": "RecaptchaEnterpriseServiceV1Beta1 annotateAssessment Sample", + "origin": "API_DEFINITION", + "description": " Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fradulent.", + "canonical": true, + "file": "recaptcha_enterprise_service_v1_beta1.annotate_assessment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnnotateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.AnnotateAssessment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "annotation", + "type": ".google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse", + "client": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + }, + "method": { + "shortName": "AnnotateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.AnnotateAssessment", + "service": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateKey_async", + "title": "RecaptchaEnterpriseServiceV1Beta1 createKey Sample", + "origin": "API_DEFINITION", + "description": " Creates a new reCAPTCHA Enterprise key.", + "canonical": true, + "file": "recaptcha_enterprise_service_v1_beta1.create_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateKey", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateKey", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "key", + "type": ".google.cloud.recaptchaenterprise.v1beta1.Key" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1beta1.Key", + "client": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + }, + "method": { + "shortName": "CreateKey", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateKey", + "service": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_ListKeys_async", + "title": "RecaptchaEnterpriseServiceV1Beta1 listKeys Sample", + "origin": "API_DEFINITION", + "description": " Returns the list of all keys that belong to a project.", + "canonical": true, + "file": "recaptcha_enterprise_service_v1_beta1.list_keys.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListKeys", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.ListKeys", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse", + "client": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + }, + "method": { + "shortName": "ListKeys", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.ListKeys", + "service": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_GetKey_async", + "title": "RecaptchaEnterpriseServiceV1Beta1 getKey Sample", + "origin": "API_DEFINITION", + "description": " Returns the specified key.", + "canonical": true, + "file": "recaptcha_enterprise_service_v1_beta1.get_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetKey", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.GetKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1beta1.Key", + "client": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + }, + "method": { + "shortName": "GetKey", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.GetKey", + "service": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_UpdateKey_async", + "title": "RecaptchaEnterpriseServiceV1Beta1 updateKey Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified key.", + "canonical": true, + "file": "recaptcha_enterprise_service_v1_beta1.update_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateKey", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.UpdateKey", + "async": true, + "parameters": [ + { + "name": "key", + "type": ".google.cloud.recaptchaenterprise.v1beta1.Key" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1beta1.Key", + "client": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + }, + "method": { + "shortName": "UpdateKey", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.UpdateKey", + "service": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" + } + } + } + }, + { + "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_DeleteKey_async", + "title": "RecaptchaEnterpriseServiceV1Beta1 deleteKey Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified key.", + "canonical": true, + "file": "recaptcha_enterprise_service_v1_beta1.delete_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteKey", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.DeleteKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + }, + "method": { + "shortName": "DeleteKey", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.DeleteKey", + "service": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" + } + } + } + } + ] +} diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index 694267166d7..c0be33b64f8 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -2259,9 +2259,8 @@ export class RecaptchaEnterpriseServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.recaptchaEnterpriseServiceStub!.then(stub => { + if (this.recaptchaEnterpriseServiceStub && !this._terminated) { + return this.recaptchaEnterpriseServiceStub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index a0575317a61..972066d1811 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -1231,9 +1231,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.recaptchaEnterpriseServiceV1Beta1Stub!.then(stub => { + if (this.recaptchaEnterpriseServiceV1Beta1Stub && !this._terminated) { + return this.recaptchaEnterpriseServiceV1Beta1Stub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index e3ae8660c4f..5b99b53849b 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -159,13 +159,29 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { assert(client.recaptchaEnterpriseServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.recaptchaEnterpriseServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.recaptchaEnterpriseServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -322,6 +338,25 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createAssessment with closed client', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createAssessment(request), expectedError); + }); }); describe('annotateAssessment', () => { @@ -443,6 +478,25 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes annotateAssessment with closed client', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.annotateAssessment(request), expectedError); + }); }); describe('createKey', () => { @@ -560,6 +614,25 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createKey with closed client', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createKey(request), expectedError); + }); }); describe('getKey', () => { @@ -677,6 +750,25 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getKey with closed client', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getKey(request), expectedError); + }); }); describe('updateKey', () => { @@ -797,6 +889,26 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateKey with closed client', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() + ); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = 'key.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateKey(request), expectedError); + }); }); describe('deleteKey', () => { @@ -914,6 +1026,25 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteKey with closed client', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteKey(request), expectedError); + }); }); describe('migrateKey', () => { @@ -1034,6 +1165,25 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes migrateKey with closed client', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.migrateKey(request), expectedError); + }); }); describe('getMetrics', () => { @@ -1154,6 +1304,25 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getMetrics with closed client', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.GetMetricsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMetrics(request), expectedError); + }); }); describe('listKeys', () => { diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts index 37af3b9bde0..ed6ae561953 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts @@ -164,7 +164,7 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { assert(client.recaptchaEnterpriseServiceV1Beta1Stub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( { @@ -172,7 +172,25 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { projectId: 'bogus', } ); - client.close(); + client.initialize(); + assert(client.recaptchaEnterpriseServiceV1Beta1Stub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.recaptchaEnterpriseServiceV1Beta1Stub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -333,6 +351,25 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createAssessment with closed client', async () => { + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createAssessment(request), expectedError); + }); }); describe('annotateAssessment', () => { @@ -454,6 +491,25 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes annotateAssessment with closed client', async () => { + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.annotateAssessment(request), expectedError); + }); }); describe('createKey', () => { @@ -571,6 +627,25 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createKey with closed client', async () => { + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createKey(request), expectedError); + }); }); describe('getKey', () => { @@ -688,6 +763,25 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getKey with closed client', async () => { + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getKey(request), expectedError); + }); }); describe('updateKey', () => { @@ -808,6 +902,26 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateKey with closed client', async () => { + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() + ); + request.key = {}; + request.key.name = ''; + const expectedHeaderRequestParams = 'key.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateKey(request), expectedError); + }); }); describe('deleteKey', () => { @@ -925,6 +1039,25 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteKey with closed client', async () => { + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteKey(request), expectedError); + }); }); describe('listKeys', () => { From 9d464d4c264e90727ed046d4a369374a17218866 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:38:11 +0000 Subject: [PATCH 219/253] chore: update v2.14.2 gapic-generator-typescript (#358) - [ ] Regenerate this pull request now. Committer: @summer-ji-eng PiperOrigin-RevId: 434859890 Source-Link: https://github.com/googleapis/googleapis/commit/bc2432d50cba657e95212122e3fa112591b5bec2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/930b673103e92523f8cfed38decd7d3afae8ebe7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTMwYjY3MzEwM2U5MjUyM2Y4Y2ZlZDM4ZGVjZDdkM2FmYWU4ZWJlNyJ9 --- .../test/gapic_recaptcha_enterprise_service_v1.ts | 8 -------- ...gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts | 6 ------ 2 files changed, 14 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index 5b99b53849b..3f4a9577491 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -352,7 +352,6 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createAssessment(request), expectedError); @@ -492,7 +491,6 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.annotateAssessment(request), expectedError); @@ -628,7 +626,6 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createKey(request), expectedError); @@ -764,7 +761,6 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getKey(request), expectedError); @@ -904,7 +900,6 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { ); request.key = {}; request.key.name = ''; - const expectedHeaderRequestParams = 'key.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateKey(request), expectedError); @@ -1040,7 +1035,6 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteKey(request), expectedError); @@ -1179,7 +1173,6 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.migrateKey(request), expectedError); @@ -1318,7 +1311,6 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.GetMetricsRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getMetrics(request), expectedError); diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts index ed6ae561953..841d5773b4c 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts @@ -365,7 +365,6 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createAssessment(request), expectedError); @@ -505,7 +504,6 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.annotateAssessment(request), expectedError); @@ -641,7 +639,6 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createKey(request), expectedError); @@ -777,7 +774,6 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getKey(request), expectedError); @@ -917,7 +913,6 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { ); request.key = {}; request.key.name = ''; - const expectedHeaderRequestParams = 'key.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateKey(request), expectedError); @@ -1053,7 +1048,6 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteKey(request), expectedError); From a929394fdf460a45230300641a67811368cad7c2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 18:32:20 +0000 Subject: [PATCH 220/253] build(node): update client library version in samples metadata (#1356) (#365) * 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 --- ...a.google.cloud.recaptchaenterprise.v1.json | 1060 ++++++++--------- ...gle.cloud.recaptchaenterprise.v1beta1.json | 608 +++++----- 2 files changed, 834 insertions(+), 834 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index e9282e4ed13..4427fd0d82f 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -1,555 +1,555 @@ { - "clientLibrary": { - "name": "nodejs-recaptchaenterprise", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.recaptchaenterprise.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_async", - "title": "RecaptchaEnterpriseService createAssessment Sample", - "origin": "API_DEFINITION", - "description": " Creates an Assessment of the likelihood an event is legitimate.", - "canonical": true, - "file": "recaptcha_enterprise_service.create_assessment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateAssessment", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateAssessment", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "assessment", - "type": ".google.cloud.recaptchaenterprise.v1.Assessment" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1.Assessment", - "client": { - "shortName": "RecaptchaEnterpriseServiceClient", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" - }, - "method": { - "shortName": "CreateAssessment", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateAssessment", - "service": { - "shortName": "RecaptchaEnterpriseService", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - } + "clientLibrary": { + "name": "nodejs-recaptchaenterprise", + "version": "2.5.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.recaptchaenterprise.v1", + "version": "v1" + } + ] }, - { - "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_async", - "title": "RecaptchaEnterpriseService annotateAssessment Sample", - "origin": "API_DEFINITION", - "description": " Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fraudulent.", - "canonical": true, - "file": "recaptcha_enterprise_service.annotate_assessment.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "AnnotateAssessment", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.AnnotateAssessment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "annotation", - "type": ".google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation" - }, - { - "name": "reasons", - "type": "TYPE_ENUM[]" - }, - { - "name": "hashed_account_id", - "type": "TYPE_BYTES" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse", - "client": { - "shortName": "RecaptchaEnterpriseServiceClient", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_async", + "title": "RecaptchaEnterpriseService createAssessment Sample", + "origin": "API_DEFINITION", + "description": " Creates an Assessment of the likelihood an event is legitimate.", + "canonical": true, + "file": "recaptcha_enterprise_service.create_assessment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateAssessment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "assessment", + "type": ".google.cloud.recaptchaenterprise.v1.Assessment" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.Assessment", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "CreateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateAssessment", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } }, - "method": { - "shortName": "AnnotateAssessment", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.AnnotateAssessment", - "service": { - "shortName": "RecaptchaEnterpriseService", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_async", - "title": "RecaptchaEnterpriseService createKey Sample", - "origin": "API_DEFINITION", - "description": " Creates a new reCAPTCHA Enterprise key.", - "canonical": true, - "file": "recaptcha_enterprise_service.create_key.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateKey", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateKey", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "key", - "type": ".google.cloud.recaptchaenterprise.v1.Key" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1.Key", - "client": { - "shortName": "RecaptchaEnterpriseServiceClient", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_async", + "title": "RecaptchaEnterpriseService annotateAssessment Sample", + "origin": "API_DEFINITION", + "description": " Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fraudulent.", + "canonical": true, + "file": "recaptcha_enterprise_service.annotate_assessment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnnotateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.AnnotateAssessment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "annotation", + "type": ".google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation" + }, + { + "name": "reasons", + "type": "TYPE_ENUM[]" + }, + { + "name": "hashed_account_id", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "AnnotateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.AnnotateAssessment", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } }, - "method": { - "shortName": "CreateKey", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateKey", - "service": { - "shortName": "RecaptchaEnterpriseService", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_async", - "title": "RecaptchaEnterpriseService listKeys Sample", - "origin": "API_DEFINITION", - "description": " Returns the list of all keys that belong to a project.", - "canonical": true, - "file": "recaptcha_enterprise_service.list_keys.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListKeys", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListKeys", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1.ListKeysResponse", - "client": { - "shortName": "RecaptchaEnterpriseServiceClient", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_async", + "title": "RecaptchaEnterpriseService createKey Sample", + "origin": "API_DEFINITION", + "description": " Creates a new reCAPTCHA Enterprise key.", + "canonical": true, + "file": "recaptcha_enterprise_service.create_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateKey", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "key", + "type": ".google.cloud.recaptchaenterprise.v1.Key" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.Key", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "CreateKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.CreateKey", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } }, - "method": { - "shortName": "ListKeys", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListKeys", - "service": { - "shortName": "RecaptchaEnterpriseService", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_async", - "title": "RecaptchaEnterpriseService getKey Sample", - "origin": "API_DEFINITION", - "description": " Returns the specified key.", - "canonical": true, - "file": "recaptcha_enterprise_service.get_key.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetKey", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetKey", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1.Key", - "client": { - "shortName": "RecaptchaEnterpriseServiceClient", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_async", + "title": "RecaptchaEnterpriseService listKeys Sample", + "origin": "API_DEFINITION", + "description": " Returns the list of all keys that belong to a project.", + "canonical": true, + "file": "recaptcha_enterprise_service.list_keys.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListKeys", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListKeys", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.ListKeysResponse", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "ListKeys", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListKeys", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } }, - "method": { - "shortName": "GetKey", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetKey", - "service": { - "shortName": "RecaptchaEnterpriseService", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_async", - "title": "RecaptchaEnterpriseService updateKey Sample", - "origin": "API_DEFINITION", - "description": " Updates the specified key.", - "canonical": true, - "file": "recaptcha_enterprise_service.update_key.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateKey", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.UpdateKey", - "async": true, - "parameters": [ - { - "name": "key", - "type": ".google.cloud.recaptchaenterprise.v1.Key" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1.Key", - "client": { - "shortName": "RecaptchaEnterpriseServiceClient", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_async", + "title": "RecaptchaEnterpriseService getKey Sample", + "origin": "API_DEFINITION", + "description": " Returns the specified key.", + "canonical": true, + "file": "recaptcha_enterprise_service.get_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.Key", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "GetKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetKey", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } }, - "method": { - "shortName": "UpdateKey", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.UpdateKey", - "service": { - "shortName": "RecaptchaEnterpriseService", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_async", - "title": "RecaptchaEnterpriseService deleteKey Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified key.", - "canonical": true, - "file": "recaptcha_enterprise_service.delete_key.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteKey", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.DeleteKey", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "RecaptchaEnterpriseServiceClient", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_async", + "title": "RecaptchaEnterpriseService updateKey Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified key.", + "canonical": true, + "file": "recaptcha_enterprise_service.update_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.UpdateKey", + "async": true, + "parameters": [ + { + "name": "key", + "type": ".google.cloud.recaptchaenterprise.v1.Key" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.Key", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "UpdateKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.UpdateKey", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } }, - "method": { - "shortName": "DeleteKey", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.DeleteKey", - "service": { - "shortName": "RecaptchaEnterpriseService", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_async", - "title": "RecaptchaEnterpriseService migrateKey Sample", - "origin": "API_DEFINITION", - "description": " Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. Once a key is migrated, it can be used from either product. SiteVerify requests are billed as CreateAssessment calls. You must be authenticated as one of the current owners of the reCAPTCHA Site Key, and your user must have the reCAPTCHA Enterprise Admin IAM role in the destination project.", - "canonical": true, - "file": "recaptcha_enterprise_service.migrate_key.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "MigrateKey", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.MigrateKey", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1.Key", - "client": { - "shortName": "RecaptchaEnterpriseServiceClient", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_async", + "title": "RecaptchaEnterpriseService deleteKey Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified key.", + "canonical": true, + "file": "recaptcha_enterprise_service.delete_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.DeleteKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "DeleteKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.DeleteKey", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } }, - "method": { - "shortName": "MigrateKey", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.MigrateKey", - "service": { - "shortName": "RecaptchaEnterpriseService", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_async", - "title": "RecaptchaEnterpriseService getMetrics Sample", - "origin": "API_DEFINITION", - "description": " Get some aggregated metrics for a Key. This data can be used to build dashboards.", - "canonical": true, - "file": "recaptcha_enterprise_service.get_metrics.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetMetrics", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetMetrics", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1.Metrics", - "client": { - "shortName": "RecaptchaEnterpriseServiceClient", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_async", + "title": "RecaptchaEnterpriseService migrateKey Sample", + "origin": "API_DEFINITION", + "description": " Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. Once a key is migrated, it can be used from either product. SiteVerify requests are billed as CreateAssessment calls. You must be authenticated as one of the current owners of the reCAPTCHA Site Key, and your user must have the reCAPTCHA Enterprise Admin IAM role in the destination project.", + "canonical": true, + "file": "recaptcha_enterprise_service.migrate_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MigrateKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.MigrateKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.Key", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "MigrateKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.MigrateKey", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } }, - "method": { - "shortName": "GetMetrics", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetMetrics", - "service": { - "shortName": "RecaptchaEnterpriseService", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_async", - "title": "RecaptchaEnterpriseService listRelatedAccountGroups Sample", - "origin": "API_DEFINITION", - "description": " List groups of related accounts.", - "canonical": true, - "file": "recaptcha_enterprise_service.list_related_account_groups.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListRelatedAccountGroups", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroups", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse", - "client": { - "shortName": "RecaptchaEnterpriseServiceClient", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_async", + "title": "RecaptchaEnterpriseService getMetrics Sample", + "origin": "API_DEFINITION", + "description": " Get some aggregated metrics for a Key. This data can be used to build dashboards.", + "canonical": true, + "file": "recaptcha_enterprise_service.get_metrics.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMetrics", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetMetrics", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.Metrics", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "GetMetrics", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.GetMetrics", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } }, - "method": { - "shortName": "ListRelatedAccountGroups", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroups", - "service": { - "shortName": "RecaptchaEnterpriseService", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_async", - "title": "RecaptchaEnterpriseService listRelatedAccountGroupMemberships Sample", - "origin": "API_DEFINITION", - "description": " Get the memberships in a group of related accounts.", - "canonical": true, - "file": "recaptcha_enterprise_service.list_related_account_group_memberships.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListRelatedAccountGroupMemberships", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroupMemberships", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse", - "client": { - "shortName": "RecaptchaEnterpriseServiceClient", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_async", + "title": "RecaptchaEnterpriseService listRelatedAccountGroups Sample", + "origin": "API_DEFINITION", + "description": " List groups of related accounts.", + "canonical": true, + "file": "recaptcha_enterprise_service.list_related_account_groups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRelatedAccountGroups", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "ListRelatedAccountGroups", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroups", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } }, - "method": { - "shortName": "ListRelatedAccountGroupMemberships", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroupMemberships", - "service": { - "shortName": "RecaptchaEnterpriseService", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_async", - "title": "RecaptchaEnterpriseService searchRelatedAccountGroupMemberships Sample", - "origin": "API_DEFINITION", - "description": " Search group memberships related to a given account.", - "canonical": true, - "file": "recaptcha_enterprise_service.search_related_account_group_memberships.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchRelatedAccountGroupMemberships", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.SearchRelatedAccountGroupMemberships", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "hashed_account_id", - "type": "TYPE_BYTES" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse", - "client": { - "shortName": "RecaptchaEnterpriseServiceClient", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_async", + "title": "RecaptchaEnterpriseService listRelatedAccountGroupMemberships Sample", + "origin": "API_DEFINITION", + "description": " Get the memberships in a group of related accounts.", + "canonical": true, + "file": "recaptcha_enterprise_service.list_related_account_group_memberships.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRelatedAccountGroupMemberships", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroupMemberships", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "ListRelatedAccountGroupMemberships", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.ListRelatedAccountGroupMemberships", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } }, - "method": { - "shortName": "SearchRelatedAccountGroupMemberships", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.SearchRelatedAccountGroupMemberships", - "service": { - "shortName": "RecaptchaEnterpriseService", - "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" - } + { + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_async", + "title": "RecaptchaEnterpriseService searchRelatedAccountGroupMemberships Sample", + "origin": "API_DEFINITION", + "description": " Search group memberships related to a given account.", + "canonical": true, + "file": "recaptcha_enterprise_service.search_related_account_group_memberships.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchRelatedAccountGroupMemberships", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.SearchRelatedAccountGroupMemberships", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "hashed_account_id", + "type": "TYPE_BYTES" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "SearchRelatedAccountGroupMemberships", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.SearchRelatedAccountGroupMemberships", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json index b1104f833cc..87d0c243c88 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json @@ -1,319 +1,319 @@ { - "clientLibrary": { - "name": "nodejs-recaptchaenterprise", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.recaptchaenterprise.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateAssessment_async", - "title": "RecaptchaEnterpriseServiceV1Beta1 createAssessment Sample", - "origin": "API_DEFINITION", - "description": " Creates an Assessment of the likelihood an event is legitimate.", - "canonical": true, - "file": "recaptcha_enterprise_service_v1_beta1.create_assessment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateAssessment", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateAssessment", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "assessment", - "type": ".google.cloud.recaptchaenterprise.v1beta1.Assessment" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1beta1.Assessment", - "client": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" - }, - "method": { - "shortName": "CreateAssessment", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateAssessment", - "service": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" - } - } - } + "clientLibrary": { + "name": "nodejs-recaptchaenterprise", + "version": "2.5.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.recaptchaenterprise.v1beta1", + "version": "v1beta1" + } + ] }, - { - "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_AnnotateAssessment_async", - "title": "RecaptchaEnterpriseServiceV1Beta1 annotateAssessment Sample", - "origin": "API_DEFINITION", - "description": " Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fradulent.", - "canonical": true, - "file": "recaptcha_enterprise_service_v1_beta1.annotate_assessment.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "AnnotateAssessment", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.AnnotateAssessment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "annotation", - "type": ".google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse", - "client": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateAssessment_async", + "title": "RecaptchaEnterpriseServiceV1Beta1 createAssessment Sample", + "origin": "API_DEFINITION", + "description": " Creates an Assessment of the likelihood an event is legitimate.", + "canonical": true, + "file": "recaptcha_enterprise_service_v1_beta1.create_assessment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateAssessment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "assessment", + "type": ".google.cloud.recaptchaenterprise.v1beta1.Assessment" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1beta1.Assessment", + "client": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + }, + "method": { + "shortName": "CreateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateAssessment", + "service": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" + } + } + } }, - "method": { - "shortName": "AnnotateAssessment", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.AnnotateAssessment", - "service": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateKey_async", - "title": "RecaptchaEnterpriseServiceV1Beta1 createKey Sample", - "origin": "API_DEFINITION", - "description": " Creates a new reCAPTCHA Enterprise key.", - "canonical": true, - "file": "recaptcha_enterprise_service_v1_beta1.create_key.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateKey", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateKey", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "key", - "type": ".google.cloud.recaptchaenterprise.v1beta1.Key" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1beta1.Key", - "client": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_AnnotateAssessment_async", + "title": "RecaptchaEnterpriseServiceV1Beta1 annotateAssessment Sample", + "origin": "API_DEFINITION", + "description": " Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fradulent.", + "canonical": true, + "file": "recaptcha_enterprise_service_v1_beta1.annotate_assessment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnnotateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.AnnotateAssessment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "annotation", + "type": ".google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse", + "client": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + }, + "method": { + "shortName": "AnnotateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.AnnotateAssessment", + "service": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" + } + } + } }, - "method": { - "shortName": "CreateKey", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateKey", - "service": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_ListKeys_async", - "title": "RecaptchaEnterpriseServiceV1Beta1 listKeys Sample", - "origin": "API_DEFINITION", - "description": " Returns the list of all keys that belong to a project.", - "canonical": true, - "file": "recaptcha_enterprise_service_v1_beta1.list_keys.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListKeys", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.ListKeys", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse", - "client": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateKey_async", + "title": "RecaptchaEnterpriseServiceV1Beta1 createKey Sample", + "origin": "API_DEFINITION", + "description": " Creates a new reCAPTCHA Enterprise key.", + "canonical": true, + "file": "recaptcha_enterprise_service_v1_beta1.create_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateKey", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateKey", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "key", + "type": ".google.cloud.recaptchaenterprise.v1beta1.Key" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1beta1.Key", + "client": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + }, + "method": { + "shortName": "CreateKey", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateKey", + "service": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" + } + } + } }, - "method": { - "shortName": "ListKeys", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.ListKeys", - "service": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_GetKey_async", - "title": "RecaptchaEnterpriseServiceV1Beta1 getKey Sample", - "origin": "API_DEFINITION", - "description": " Returns the specified key.", - "canonical": true, - "file": "recaptcha_enterprise_service_v1_beta1.get_key.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetKey", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.GetKey", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1beta1.Key", - "client": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_ListKeys_async", + "title": "RecaptchaEnterpriseServiceV1Beta1 listKeys Sample", + "origin": "API_DEFINITION", + "description": " Returns the list of all keys that belong to a project.", + "canonical": true, + "file": "recaptcha_enterprise_service_v1_beta1.list_keys.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListKeys", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.ListKeys", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse", + "client": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + }, + "method": { + "shortName": "ListKeys", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.ListKeys", + "service": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" + } + } + } }, - "method": { - "shortName": "GetKey", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.GetKey", - "service": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_UpdateKey_async", - "title": "RecaptchaEnterpriseServiceV1Beta1 updateKey Sample", - "origin": "API_DEFINITION", - "description": " Updates the specified key.", - "canonical": true, - "file": "recaptcha_enterprise_service_v1_beta1.update_key.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateKey", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.UpdateKey", - "async": true, - "parameters": [ - { - "name": "key", - "type": ".google.cloud.recaptchaenterprise.v1beta1.Key" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1beta1.Key", - "client": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_GetKey_async", + "title": "RecaptchaEnterpriseServiceV1Beta1 getKey Sample", + "origin": "API_DEFINITION", + "description": " Returns the specified key.", + "canonical": true, + "file": "recaptcha_enterprise_service_v1_beta1.get_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetKey", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.GetKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1beta1.Key", + "client": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + }, + "method": { + "shortName": "GetKey", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.GetKey", + "service": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" + } + } + } }, - "method": { - "shortName": "UpdateKey", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.UpdateKey", - "service": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_DeleteKey_async", - "title": "RecaptchaEnterpriseServiceV1Beta1 deleteKey Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified key.", - "canonical": true, - "file": "recaptcha_enterprise_service_v1_beta1.delete_key.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteKey", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.DeleteKey", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_UpdateKey_async", + "title": "RecaptchaEnterpriseServiceV1Beta1 updateKey Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified key.", + "canonical": true, + "file": "recaptcha_enterprise_service_v1_beta1.update_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateKey", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.UpdateKey", + "async": true, + "parameters": [ + { + "name": "key", + "type": ".google.cloud.recaptchaenterprise.v1beta1.Key" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1beta1.Key", + "client": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + }, + "method": { + "shortName": "UpdateKey", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.UpdateKey", + "service": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" + } + } + } }, - "method": { - "shortName": "DeleteKey", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.DeleteKey", - "service": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" - } + { + "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_DeleteKey_async", + "title": "RecaptchaEnterpriseServiceV1Beta1 deleteKey Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified key.", + "canonical": true, + "file": "recaptcha_enterprise_service_v1_beta1.delete_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteKey", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.DeleteKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" + }, + "method": { + "shortName": "DeleteKey", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.DeleteKey", + "service": { + "shortName": "RecaptchaEnterpriseServiceV1Beta1", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file From dc8671dfa425bfefc2fdd897c56c5a3447536aa6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 29 Apr 2022 09:26:03 -0700 Subject: [PATCH 221/253] fix!: remove key management API (#366) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix!: remove key management API feat: introduced Reason, PasswordLeakVerification, AccountDefenderAssessment PiperOrigin-RevId: 445255953 Source-Link: https://github.com/googleapis/googleapis/commit/79b905545385f8de66663f50da6b4c234c98acfb Source-Link: https://github.com/googleapis/googleapis-gen/commit/f21fea7656c7e8a6d29aca9e390d935a511aa931 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjIxZmVhNzY1NmM3ZThhNmQyOWFjYTllMzkwZDkzNWE1MTFhYTkzMSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../v1beta1/recaptchaenterprise.proto | 350 +- .../protos/protos.d.ts | 1238 ++----- .../protos/protos.js | 3064 ++++------------- .../protos/protos.json | 351 +- ...se_service_v1_beta1.annotate_assessment.js | 19 +- ...gle.cloud.recaptchaenterprise.v1beta1.json | 224 +- .../src/v1beta1/gapic_metadata.json | 54 - ...tcha_enterprise_service_v1_beta1_client.ts | 676 +--- ...rprise_service_v1_beta1_client_config.json | 25 - ...cha_enterprise_service_v1_beta1_v1beta1.ts | 1040 +----- 10 files changed, 1116 insertions(+), 5925 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto index 099d3041ffe..28a07a8e51b 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto @@ -1,4 +1,4 @@ -// Copyright 2019 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. @@ -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"; @@ -21,8 +20,6 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.RecaptchaEnterprise.V1Beta1"; @@ -57,43 +54,6 @@ service RecaptchaEnterpriseServiceV1Beta1 { }; option (google.api.method_signature) = "name,annotation"; } - - // Creates a new reCAPTCHA Enterprise key. - rpc CreateKey(CreateKeyRequest) returns (Key) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*}/keys" - body: "key" - }; - } - - // Returns the list of all keys that belong to a project. - rpc ListKeys(ListKeysRequest) returns (ListKeysResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*}/keys" - }; - } - - // Returns the specified key. - rpc GetKey(GetKeyRequest) returns (Key) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/keys/*}" - }; - } - - // Updates the specified key. - rpc UpdateKey(UpdateKeyRequest) returns (Key) { - option (google.api.http) = { - patch: "/v1beta1/{key.name=projects/*/keys/*}" - body: "key" - }; - } - - // Deletes the specified key. - rpc DeleteKey(DeleteKeyRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/keys/*}" - }; - } } // The create assessment request message. @@ -113,7 +73,7 @@ message CreateAssessmentRequest { // The request message to annotate an Assessment. message AnnotateAssessmentRequest { - // Enum that reprensents the types of annotations. + // Enum that represents the types of annotations. enum Annotation { // Default unspecified type. ANNOTATION_UNSPECIFIED = 0; @@ -123,6 +83,60 @@ message AnnotateAssessmentRequest { // Provides information that the event turned out to be fraudulent. FRAUDULENT = 2; + + // Provides information that the event was related to a login event in which + // the user typed the correct password. Deprecated, prefer indicating + // CORRECT_PASSWORD through the reasons field instead. + PASSWORD_CORRECT = 3 [deprecated = true]; + + // Provides information that the event was related to a login event in which + // the user typed the incorrect password. Deprecated, prefer indicating + // INCORRECT_PASSWORD through the reasons field instead. + PASSWORD_INCORRECT = 4 [deprecated = true]; + } + + // Enum that represents potential reasons for annotating an assessment. + enum Reason { + // Default unspecified reason. + REASON_UNSPECIFIED = 0; + + // Indicates a chargeback issued for the transaction with no other details. + // When possible, specify the type by using CHARGEBACK_FRAUD or + // CHARGEBACK_DISPUTE instead. + CHARGEBACK = 1; + + // Indicates a chargeback related to an alleged unauthorized transaction + // from the cardholder's perspective (for example, the card number was + // stolen). + CHARGEBACK_FRAUD = 8; + + // Indicates a chargeback related to the cardholder having provided their + // card details but allegedly not being satisfied with the purchase + // (for example, misrepresentation, attempted cancellation). + CHARGEBACK_DISPUTE = 9; + + // Indicates the transaction associated with the assessment is suspected of + // being fraudulent based on the payment method, billing details, shipping + // address or other transaction information. + PAYMENT_HEURISTICS = 2; + + // Indicates that the user was served a 2FA challenge. An old assessment + // with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been + // overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow. + // This is equivalent to `FAILED_TWO_FACTOR`. + INITIATED_TWO_FACTOR = 7; + + // Indicates that the user passed a 2FA challenge. + PASSED_TWO_FACTOR = 3; + + // Indicates that the user failed a 2FA challenge. + FAILED_TWO_FACTOR = 4; + + // Indicates the user provided the correct password. + CORRECT_PASSWORD = 5; + + // Indicates the user provided an incorrect password. + INCORRECT_PASSWORD = 6; } // Required. The resource name of the Assessment, in the format @@ -134,8 +148,20 @@ message AnnotateAssessmentRequest { } ]; - // Required. The annotation that will be assigned to the Event. - Annotation annotation = 2 [(google.api.field_behavior) = REQUIRED]; + // Optional. The annotation that will be assigned to the Event. This field can be left + // empty to provide reasons that apply to an event without concluding whether + // the event is legitimate or fraudulent. + Annotation annotation = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional reasons for the annotation that will be assigned to the Event. + repeated Reason reasons = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional unique stable hashed user identifier to apply to the assessment. + // This is an alternative to setting the hashed_account_id in + // CreateAssessment, for example when the account identifier is not yet known + // in the initial request. It is recommended that the identifier is hashed + // using hmac-sha256 with stable secret. + bytes hashed_account_id = 4 [(google.api.field_behavior) = OPTIONAL]; } // Empty response for AnnotateAssessment. @@ -143,6 +169,21 @@ message AnnotateAssessmentResponse { } +// Password leak verification info. +message PasswordLeakVerification { + // Optional. Scrypt hash of the username+password that the customer wants to verify + // against a known password leak. + bytes hashed_user_credentials = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Whether or not the user's credentials are present in a known leak. + bool credentials_leaked = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The username part of the user credentials for which we want to trigger a + // leak check in canonicalized form. This is the same data used to create the + // hashed_user_credentials on the customer side. + string canonicalized_username = 3 [(google.api.field_behavior) = OPTIONAL]; +} + // A recaptcha assessment resource. message Assessment { option (google.api.resource) = { @@ -150,7 +191,6 @@ message Assessment { pattern: "projects/{project}/assessments/{assessment}" }; - // LINT.IfChange(classification_reason) // Reasons contributing to the risk analysis verdict. enum ClassificationReason { // Default unspecified type. @@ -191,6 +231,16 @@ message Assessment { // Output only. Reasons contributing to the risk analysis verdict. repeated ClassificationReason reasons = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Information about the user's credentials used to check for leaks. + // This feature is part of the Early Access Program (EAP). Exercise caution, + // and do not deploy integrations based on this feature in a production + // environment. + PasswordLeakVerification password_leak_verification = 7; + + // Assessment returned by Account Defender when a hashed_account_id is + // provided. + AccountDefenderAssessment account_defender_assessment = 8; } message Event { @@ -213,10 +263,13 @@ message Event { // provided at token generation time on client-side platforms already // integrated with recaptcha enterprise. string expected_action = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional unique stable hashed user identifier for the request. The + // identifier should ideally be hashed using sha256 with stable secret. + bytes hashed_account_id = 6 [(google.api.field_behavior) = OPTIONAL]; } message TokenProperties { - // LINT.IfChange // Enum that represents the types of invalid token reasons. enum InvalidReason { // Default unspecified type. @@ -238,13 +291,21 @@ message TokenProperties { // This may be a configuration error (e.g. development keys used in // production) or end users trying to use verification tokens from other // sites. - SITE_MISMATCH = 5; + SITE_MISMATCH = 5 [deprecated = true]; // The user verification token was not present. It is a required input. MISSING = 6; + + // A retriable error (such as network failure) occurred on the browser. + // Could easily be simulated by an attacker. + BROWSER_ERROR = 7; } - // Whether the provided user response token is valid. + // Whether the provided user response token is valid. When valid = false, the + // reason could be specified in invalid_reason or it could also be due to + // a user failing to solve a challenge or a sitekey mismatch (i.e the sitekey + // used to generate the token was different than the one specified in the + // assessment). bool valid = 1; // Reason associated with the response when valid = false. @@ -260,183 +321,30 @@ message TokenProperties { string action = 5; } -// The create key request message. -message CreateKeyRequest { - // Required. The name of the project in which the key will be created, in the - // format "projects/{project_number}". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. Information to create a reCAPTCHA Enterprise key. - Key key = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The list keys request message. -message ListKeysRequest { - // Required. The name of the project that contains the keys that will be - // listed, in the format "projects/{project_number}". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Optional. The maximum number of keys to return. Default is 10. Max limit is - // 1000. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The next_page_token value returned from a previous. - // ListKeysRequest, if any. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response to request to list keys in a project. -message ListKeysResponse { - // Key details. - repeated Key keys = 1; - - // Token to retrieve the next page of results. It is set to empty if no keys - // remain in results. - string next_page_token = 2; -} - -// The get key request message. -message GetKeyRequest { - // Required. The name of the requested key, in the format - // "projects/{project_number}/keys/{key_id}". - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "recaptchaenterprise.googleapis.com/Key" - } - ]; -} - -// The update key request message. -message UpdateKeyRequest { - // Required. The key to update. - Key key = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The mask to control which field of the key get updated. If the mask is not - // present, all fields will be updated. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// The delete key request message. -message DeleteKeyRequest { - // Required. The name of the key to be deleted, in the format - // "projects/{project_number}/keys/{key_id}". - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "recaptchaenterprise.googleapis.com/Key" - } - ]; -} - -// A key used to identify and configure applications (web and/or mobile) that -// use reCAPTCHA Enterprise. -message Key { - option (google.api.resource) = { - type: "recaptchaenterprise.googleapis.com/Key" - pattern: "projects/{project}/keys/{key}" - }; - - // The resource name for the Key in the format - // "projects/{project_number}/keys/{key_id}". - string name = 1; - - // Human-readable display name of this key. Modifiable by user. - string display_name = 2; - - // Platform specific settings for this key. The key can only be used on one - // platform, the one it has settings for. - oneof platform_settings { - // Settings for keys that can be used by websites. - WebKeySettings web_settings = 3; - - // Settings for keys that can be used by Android apps. - AndroidKeySettings android_settings = 4; - - // Settings for keys that can be used by iOS apps. - IOSKeySettings ios_settings = 5; - } -} - -// Settings specific to keys that can be used by websites. -message WebKeySettings { - // Enum that represents the integration types for web keys. - enum IntegrationType { - // Default type that indicates this enum hasn't been specified. This is not - // a valid IntegrationType, one of the other types must be specified - // instead. - INTEGRATION_TYPE_UNSPECIFIED = 0; - - // Only used to produce scores. It doesn't display the "I'm not a robot" - // checkbox and never shows captcha challenges. - SCORE_ONLY = 1; - - // Displays the "I'm not a robot" checkbox and may show captcha challenges - // after it is checked. - CHECKBOX_CHALLENGE = 2; - - // Doesn't display the "I'm not a robot" checkbox, but may show captcha - // challenges after risk analysis. - INVISIBLE_CHALLENGE = 3; - } +// Account Defender risk assessment. +message AccountDefenderAssessment { + // Labels returned by Account Defender for this request. + enum AccountDefenderLabel { + // Default unspecified type. + ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0; - // Enum that represents the possible challenge frequency and difficulty - // configurations for a web key. - enum ChallengeSecurityPreference { - // Default type that indicates this enum hasn't been specified. - CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0; + // The request matches a known good profile for the user. + PROFILE_MATCH = 1; - // Key tends to show fewer and easier challenges. - USABILITY = 1; + // The request is potentially a suspicious login event and should be further + // verified either via multi-factor authentication or another system. + SUSPICIOUS_LOGIN_ACTIVITY = 2; - // Key tends to show balanced (in amount and difficulty) challenges. - BALANCED = 2; + // The request matched a profile that previously had suspicious account + // creation behavior. This could mean this is a fake account. + SUSPICIOUS_ACCOUNT_CREATION = 3; - // Key tends to show more and harder challenges. - SECURITY = 3; + // The account in the request has a high number of related accounts. It does + // not necessarily imply that the account is bad but could require + // investigating. + RELATED_ACCOUNTS_NUMBER_HIGH = 4; } - // Whether allowed_domains is enforced or not. - bool enforce_allowed_domains = 3; - - // Domains or subdomains of websites allowed to use the key. All subdomains - // of an allowed domain are automatically allowed. A valid domain requires a - // host and must not include any path, port, query or fragment. - // Examples: 'example.com' or 'subdomain.example.com' - repeated string allowed_domains = 1; - - // Whether this key can be used on AMP (Accelerated Mobile Pages) websites. - bool allow_amp_traffic = 2; - - // Required. Describes how this key is integrated with the website. - IntegrationType integration_type = 4 [(google.api.field_behavior) = REQUIRED]; - - // Settings for the frequency and difficulty at which this key triggers - // captcha challenges. This should only be specified for IntegrationTypes - // CHECKBOX_CHALLENGE and INVISIBLE_CHALLENGE. - ChallengeSecurityPreference challenge_security_preference = 5; -} - -// Settings specific to keys that can be used by Android apps. -message AndroidKeySettings { - // Android package names of apps allowed to use the key. - // Example: 'com.companyname.appname' - repeated string allowed_package_names = 1; -} - -// Settings specific to keys that can be used by iOS apps. -message IOSKeySettings { - // iOS bundle ids of apps allowed to use the key. - // Example: 'com.companyname.productname.appname' - repeated string allowed_bundle_ids = 1; + // Labels for this request. + repeated AccountDefenderLabel labels = 1; } diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 7cef6507cd6..ab69c80f3f7 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -3744,76 +3744,6 @@ export namespace google { * @returns Promise */ public annotateAssessment(request: google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest): Promise; - - /** - * Calls CreateKey. - * @param request CreateKeyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Key - */ - public createKey(request: google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, callback: google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateKeyCallback): void; - - /** - * Calls CreateKey. - * @param request CreateKeyRequest message or plain object - * @returns Promise - */ - public createKey(request: google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest): Promise; - - /** - * Calls ListKeys. - * @param request ListKeysRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListKeysResponse - */ - public listKeys(request: google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, callback: google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.ListKeysCallback): void; - - /** - * Calls ListKeys. - * @param request ListKeysRequest message or plain object - * @returns Promise - */ - public listKeys(request: google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest): Promise; - - /** - * Calls GetKey. - * @param request GetKeyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Key - */ - public getKey(request: google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, callback: google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.GetKeyCallback): void; - - /** - * Calls GetKey. - * @param request GetKeyRequest message or plain object - * @returns Promise - */ - public getKey(request: google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest): Promise; - - /** - * Calls UpdateKey. - * @param request UpdateKeyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Key - */ - public updateKey(request: google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, callback: google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.UpdateKeyCallback): void; - - /** - * Calls UpdateKey. - * @param request UpdateKeyRequest message or plain object - * @returns Promise - */ - public updateKey(request: google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest): Promise; - - /** - * Calls DeleteKey. - * @param request DeleteKeyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteKey(request: google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, callback: google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.DeleteKeyCallback): void; - - /** - * Calls DeleteKey. - * @param request DeleteKeyRequest message or plain object - * @returns Promise - */ - public deleteKey(request: google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest): Promise; } namespace RecaptchaEnterpriseServiceV1Beta1 { @@ -3831,41 +3761,6 @@ export namespace google { * @param [response] AnnotateAssessmentResponse */ type AnnotateAssessmentCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse) => void; - - /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#createKey}. - * @param error Error, if any - * @param [response] Key - */ - type CreateKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1beta1.Key) => void; - - /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#listKeys}. - * @param error Error, if any - * @param [response] ListKeysResponse - */ - type ListKeysCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse) => void; - - /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#getKey}. - * @param error Error, if any - * @param [response] Key - */ - type GetKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1beta1.Key) => void; - - /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#updateKey}. - * @param error Error, if any - * @param [response] Key - */ - type UpdateKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1beta1.Key) => void; - - /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#deleteKey}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteKeyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } /** Properties of a CreateAssessmentRequest. */ @@ -3972,6 +3867,12 @@ export namespace google { /** AnnotateAssessmentRequest annotation */ annotation?: (google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation|keyof typeof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation|null); + + /** AnnotateAssessmentRequest reasons */ + reasons?: (google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Reason[]|null); + + /** AnnotateAssessmentRequest hashedAccountId */ + hashedAccountId?: (Uint8Array|string|null); } /** Represents an AnnotateAssessmentRequest. */ @@ -3989,6 +3890,12 @@ export namespace google { /** AnnotateAssessmentRequest annotation. */ public annotation: (google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation|keyof typeof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation); + /** AnnotateAssessmentRequest reasons. */ + public reasons: google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Reason[]; + + /** AnnotateAssessmentRequest hashedAccountId. */ + public hashedAccountId: (Uint8Array|string); + /** * Creates a new AnnotateAssessmentRequest instance using the specified properties. * @param [properties] Properties to set @@ -4066,7 +3973,23 @@ export namespace google { enum Annotation { ANNOTATION_UNSPECIFIED = 0, LEGITIMATE = 1, - FRAUDULENT = 2 + FRAUDULENT = 2, + PASSWORD_CORRECT = 3, + PASSWORD_INCORRECT = 4 + } + + /** Reason enum. */ + enum Reason { + REASON_UNSPECIFIED = 0, + CHARGEBACK = 1, + CHARGEBACK_FRAUD = 8, + CHARGEBACK_DISPUTE = 9, + PAYMENT_HEURISTICS = 2, + INITIATED_TWO_FACTOR = 7, + PASSED_TWO_FACTOR = 3, + FAILED_TWO_FACTOR = 4, + CORRECT_PASSWORD = 5, + INCORRECT_PASSWORD = 6 } } @@ -4154,6 +4077,108 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a PasswordLeakVerification. */ + interface IPasswordLeakVerification { + + /** PasswordLeakVerification hashedUserCredentials */ + hashedUserCredentials?: (Uint8Array|string|null); + + /** PasswordLeakVerification credentialsLeaked */ + credentialsLeaked?: (boolean|null); + + /** PasswordLeakVerification canonicalizedUsername */ + canonicalizedUsername?: (string|null); + } + + /** Represents a PasswordLeakVerification. */ + class PasswordLeakVerification implements IPasswordLeakVerification { + + /** + * Constructs a new PasswordLeakVerification. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification); + + /** PasswordLeakVerification hashedUserCredentials. */ + public hashedUserCredentials: (Uint8Array|string); + + /** PasswordLeakVerification credentialsLeaked. */ + public credentialsLeaked: boolean; + + /** PasswordLeakVerification canonicalizedUsername. */ + public canonicalizedUsername: string; + + /** + * Creates a new PasswordLeakVerification instance using the specified properties. + * @param [properties] Properties to set + * @returns PasswordLeakVerification instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification): google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification; + + /** + * Encodes the specified PasswordLeakVerification message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.verify|verify} messages. + * @param message PasswordLeakVerification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PasswordLeakVerification message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.verify|verify} messages. + * @param message PasswordLeakVerification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PasswordLeakVerification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PasswordLeakVerification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification; + + /** + * Decodes a PasswordLeakVerification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PasswordLeakVerification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification; + + /** + * Verifies a PasswordLeakVerification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PasswordLeakVerification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PasswordLeakVerification + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification; + + /** + * Creates a plain object from a PasswordLeakVerification message. Also converts values to other types if specified. + * @param message PasswordLeakVerification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PasswordLeakVerification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an Assessment. */ interface IAssessment { @@ -4171,6 +4196,12 @@ export namespace google { /** Assessment reasons */ reasons?: (google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason[]|null); + + /** Assessment passwordLeakVerification */ + passwordLeakVerification?: (google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification|null); + + /** Assessment accountDefenderAssessment */ + accountDefenderAssessment?: (google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment|null); } /** Represents an Assessment. */ @@ -4197,6 +4228,12 @@ export namespace google { /** Assessment reasons. */ public reasons: google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason[]; + /** Assessment passwordLeakVerification. */ + public passwordLeakVerification?: (google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification|null); + + /** Assessment accountDefenderAssessment. */ + public accountDefenderAssessment?: (google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment|null); + /** * Creates a new Assessment instance using the specified properties. * @param [properties] Properties to set @@ -4298,6 +4335,9 @@ export namespace google { /** Event expectedAction */ expectedAction?: (string|null); + + /** Event hashedAccountId */ + hashedAccountId?: (Uint8Array|string|null); } /** Represents an Event. */ @@ -4324,6 +4364,9 @@ export namespace google { /** Event expectedAction. */ public expectedAction: string; + /** Event hashedAccountId. */ + public hashedAccountId: (Uint8Array|string); + /** * Creates a new Event instance using the specified properties. * @param [properties] Properties to set @@ -4519,1009 +4562,112 @@ export namespace google { EXPIRED = 3, DUPE = 4, SITE_MISMATCH = 5, - MISSING = 6 + MISSING = 6, + BROWSER_ERROR = 7 } } - /** Properties of a CreateKeyRequest. */ - interface ICreateKeyRequest { - - /** CreateKeyRequest parent */ - parent?: (string|null); + /** Properties of an AccountDefenderAssessment. */ + interface IAccountDefenderAssessment { - /** CreateKeyRequest key */ - key?: (google.cloud.recaptchaenterprise.v1beta1.IKey|null); + /** AccountDefenderAssessment labels */ + labels?: (google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.AccountDefenderLabel[]|null); } - /** Represents a CreateKeyRequest. */ - class CreateKeyRequest implements ICreateKeyRequest { + /** Represents an AccountDefenderAssessment. */ + class AccountDefenderAssessment implements IAccountDefenderAssessment { /** - * Constructs a new CreateKeyRequest. + * Constructs a new AccountDefenderAssessment. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest); - - /** CreateKeyRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment); - /** CreateKeyRequest key. */ - public key?: (google.cloud.recaptchaenterprise.v1beta1.IKey|null); + /** AccountDefenderAssessment labels. */ + public labels: google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.AccountDefenderLabel[]; /** - * Creates a new CreateKeyRequest instance using the specified properties. + * Creates a new AccountDefenderAssessment instance using the specified properties. * @param [properties] Properties to set - * @returns CreateKeyRequest instance + * @returns AccountDefenderAssessment instance */ - public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest): google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest; + public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment): google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment; /** - * Encodes the specified CreateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest.verify|verify} messages. - * @param message CreateKeyRequest message or plain object to encode + * Encodes the specified AccountDefenderAssessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.verify|verify} messages. + * @param message AccountDefenderAssessment message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest.verify|verify} messages. - * @param message CreateKeyRequest message or plain object to encode + * Encodes the specified AccountDefenderAssessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.verify|verify} messages. + * @param message AccountDefenderAssessment message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateKeyRequest message from the specified reader or buffer. + * Decodes an AccountDefenderAssessment message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateKeyRequest + * @returns AccountDefenderAssessment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment; /** - * Decodes a CreateKeyRequest message from the specified reader or buffer, length delimited. + * Decodes an AccountDefenderAssessment message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateKeyRequest + * @returns AccountDefenderAssessment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment; /** - * Verifies a CreateKeyRequest message. + * Verifies an AccountDefenderAssessment message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateKeyRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AccountDefenderAssessment message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateKeyRequest + * @returns AccountDefenderAssessment */ - public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment; /** - * Creates a plain object from a CreateKeyRequest message. Also converts values to other types if specified. - * @param message CreateKeyRequest + * Creates a plain object from an AccountDefenderAssessment message. Also converts values to other types if specified. + * @param message AccountDefenderAssessment * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateKeyRequest to JSON. + * Converts this AccountDefenderAssessment to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListKeysRequest. */ - interface IListKeysRequest { - - /** ListKeysRequest parent */ - parent?: (string|null); - - /** ListKeysRequest pageSize */ - pageSize?: (number|null); - - /** ListKeysRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListKeysRequest. */ - class ListKeysRequest implements IListKeysRequest { - - /** - * Constructs a new ListKeysRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest); + namespace AccountDefenderAssessment { - /** ListKeysRequest parent. */ - public parent: string; - - /** ListKeysRequest pageSize. */ - public pageSize: number; - - /** ListKeysRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListKeysRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListKeysRequest instance - */ - public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest): google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest; - - /** - * Encodes the specified ListKeysRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest.verify|verify} messages. - * @param message ListKeysRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListKeysRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest.verify|verify} messages. - * @param message ListKeysRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListKeysRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest; - - /** - * Decodes a ListKeysRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest; - - /** - * Verifies a ListKeysRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListKeysRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListKeysRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest; - - /** - * Creates a plain object from a ListKeysRequest message. Also converts values to other types if specified. - * @param message ListKeysRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListKeysRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListKeysResponse. */ - interface IListKeysResponse { - - /** ListKeysResponse keys */ - keys?: (google.cloud.recaptchaenterprise.v1beta1.IKey[]|null); - - /** ListKeysResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListKeysResponse. */ - class ListKeysResponse implements IListKeysResponse { - - /** - * Constructs a new ListKeysResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse); - - /** ListKeysResponse keys. */ - public keys: google.cloud.recaptchaenterprise.v1beta1.IKey[]; - - /** ListKeysResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListKeysResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListKeysResponse instance - */ - public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse): google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse; - - /** - * Encodes the specified ListKeysResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse.verify|verify} messages. - * @param message ListKeysResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListKeysResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse.verify|verify} messages. - * @param message ListKeysResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListKeysResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListKeysResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse; - - /** - * Decodes a ListKeysResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListKeysResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse; - - /** - * Verifies a ListKeysResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListKeysResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListKeysResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse; - - /** - * Creates a plain object from a ListKeysResponse message. Also converts values to other types if specified. - * @param message ListKeysResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListKeysResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GetKeyRequest. */ - interface IGetKeyRequest { - - /** GetKeyRequest name */ - name?: (string|null); - } - - /** Represents a GetKeyRequest. */ - class GetKeyRequest implements IGetKeyRequest { - - /** - * Constructs a new GetKeyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest); - - /** GetKeyRequest name. */ - public name: string; - - /** - * Creates a new GetKeyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetKeyRequest instance - */ - public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest): google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest; - - /** - * Encodes the specified GetKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest.verify|verify} messages. - * @param message GetKeyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest.verify|verify} messages. - * @param message GetKeyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetKeyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest; - - /** - * Decodes a GetKeyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest; - - /** - * Verifies a GetKeyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetKeyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetKeyRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest; - - /** - * Creates a plain object from a GetKeyRequest message. Also converts values to other types if specified. - * @param message GetKeyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetKeyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UpdateKeyRequest. */ - interface IUpdateKeyRequest { - - /** UpdateKeyRequest key */ - key?: (google.cloud.recaptchaenterprise.v1beta1.IKey|null); - - /** UpdateKeyRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateKeyRequest. */ - class UpdateKeyRequest implements IUpdateKeyRequest { - - /** - * Constructs a new UpdateKeyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest); - - /** UpdateKeyRequest key. */ - public key?: (google.cloud.recaptchaenterprise.v1beta1.IKey|null); - - /** UpdateKeyRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateKeyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateKeyRequest instance - */ - public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest): google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest; - - /** - * Encodes the specified UpdateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest.verify|verify} messages. - * @param message UpdateKeyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest.verify|verify} messages. - * @param message UpdateKeyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateKeyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest; - - /** - * Decodes an UpdateKeyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest; - - /** - * Verifies an UpdateKeyRequest message. - * @param message Plain 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 UpdateKeyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateKeyRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest; - - /** - * Creates a plain object from an UpdateKeyRequest message. Also converts values to other types if specified. - * @param message UpdateKeyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateKeyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DeleteKeyRequest. */ - interface IDeleteKeyRequest { - - /** DeleteKeyRequest name */ - name?: (string|null); - } - - /** Represents a DeleteKeyRequest. */ - class DeleteKeyRequest implements IDeleteKeyRequest { - - /** - * Constructs a new DeleteKeyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest); - - /** DeleteKeyRequest name. */ - public name: string; - - /** - * Creates a new DeleteKeyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteKeyRequest instance - */ - public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest): google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest; - - /** - * Encodes the specified DeleteKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest.verify|verify} messages. - * @param message DeleteKeyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest.verify|verify} messages. - * @param message DeleteKeyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteKeyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest; - - /** - * Decodes a DeleteKeyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest; - - /** - * Verifies a DeleteKeyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteKeyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteKeyRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest; - - /** - * Creates a plain object from a DeleteKeyRequest message. Also converts values to other types if specified. - * @param message DeleteKeyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteKeyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Key. */ - interface IKey { - - /** Key name */ - name?: (string|null); - - /** Key displayName */ - displayName?: (string|null); - - /** Key webSettings */ - webSettings?: (google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings|null); - - /** Key androidSettings */ - androidSettings?: (google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings|null); - - /** Key iosSettings */ - iosSettings?: (google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings|null); - } - - /** Represents a Key. */ - class Key implements IKey { - - /** - * Constructs a new Key. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IKey); - - /** Key name. */ - public name: string; - - /** Key displayName. */ - public displayName: string; - - /** Key webSettings. */ - public webSettings?: (google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings|null); - - /** Key androidSettings. */ - public androidSettings?: (google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings|null); - - /** Key iosSettings. */ - public iosSettings?: (google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings|null); - - /** Key platformSettings. */ - public platformSettings?: ("webSettings"|"androidSettings"|"iosSettings"); - - /** - * Creates a new Key instance using the specified properties. - * @param [properties] Properties to set - * @returns Key instance - */ - public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IKey): google.cloud.recaptchaenterprise.v1beta1.Key; - - /** - * Encodes the specified Key message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Key.verify|verify} messages. - * @param message Key message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Key message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Key.verify|verify} messages. - * @param message Key message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Key message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Key - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.Key; - - /** - * Decodes a Key message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Key - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.Key; - - /** - * Verifies a Key message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Key message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Key - */ - public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.Key; - - /** - * Creates a plain object from a Key message. Also converts values to other types if specified. - * @param message Key - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.Key, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Key to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a WebKeySettings. */ - interface IWebKeySettings { - - /** WebKeySettings enforceAllowedDomains */ - enforceAllowedDomains?: (boolean|null); - - /** WebKeySettings allowedDomains */ - allowedDomains?: (string[]|null); - - /** WebKeySettings allowAmpTraffic */ - allowAmpTraffic?: (boolean|null); - - /** WebKeySettings integrationType */ - integrationType?: (google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType|keyof typeof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType|null); - - /** WebKeySettings challengeSecurityPreference */ - challengeSecurityPreference?: (google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference|keyof typeof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference|null); - } - - /** Represents a WebKeySettings. */ - class WebKeySettings implements IWebKeySettings { - - /** - * Constructs a new WebKeySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings); - - /** WebKeySettings enforceAllowedDomains. */ - public enforceAllowedDomains: boolean; - - /** WebKeySettings allowedDomains. */ - public allowedDomains: string[]; - - /** WebKeySettings allowAmpTraffic. */ - public allowAmpTraffic: boolean; - - /** WebKeySettings integrationType. */ - public integrationType: (google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType|keyof typeof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType); - - /** WebKeySettings challengeSecurityPreference. */ - public challengeSecurityPreference: (google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference|keyof typeof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference); - - /** - * Creates a new WebKeySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns WebKeySettings instance - */ - public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings): google.cloud.recaptchaenterprise.v1beta1.WebKeySettings; - - /** - * Encodes the specified WebKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.verify|verify} messages. - * @param message WebKeySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WebKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.verify|verify} messages. - * @param message WebKeySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WebKeySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WebKeySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.WebKeySettings; - - /** - * Decodes a WebKeySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WebKeySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.WebKeySettings; - - /** - * Verifies a WebKeySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WebKeySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WebKeySettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.WebKeySettings; - - /** - * Creates a plain object from a WebKeySettings message. Also converts values to other types if specified. - * @param message WebKeySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.WebKeySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WebKeySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace WebKeySettings { - - /** IntegrationType enum. */ - enum IntegrationType { - INTEGRATION_TYPE_UNSPECIFIED = 0, - SCORE_ONLY = 1, - CHECKBOX_CHALLENGE = 2, - INVISIBLE_CHALLENGE = 3 - } - - /** ChallengeSecurityPreference enum. */ - enum ChallengeSecurityPreference { - CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0, - USABILITY = 1, - BALANCED = 2, - SECURITY = 3 + /** AccountDefenderLabel enum. */ + enum AccountDefenderLabel { + ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0, + PROFILE_MATCH = 1, + SUSPICIOUS_LOGIN_ACTIVITY = 2, + SUSPICIOUS_ACCOUNT_CREATION = 3, + RELATED_ACCOUNTS_NUMBER_HIGH = 4 } } - - /** Properties of an AndroidKeySettings. */ - interface IAndroidKeySettings { - - /** AndroidKeySettings allowedPackageNames */ - allowedPackageNames?: (string[]|null); - } - - /** Represents an AndroidKeySettings. */ - class AndroidKeySettings implements IAndroidKeySettings { - - /** - * Constructs a new AndroidKeySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings); - - /** AndroidKeySettings allowedPackageNames. */ - public allowedPackageNames: string[]; - - /** - * Creates a new AndroidKeySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns AndroidKeySettings instance - */ - public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings): google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings; - - /** - * Encodes the specified AndroidKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.verify|verify} messages. - * @param message AndroidKeySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AndroidKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.verify|verify} messages. - * @param message AndroidKeySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AndroidKeySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AndroidKeySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings; - - /** - * Decodes an AndroidKeySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AndroidKeySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings; - - /** - * Verifies an AndroidKeySettings message. - * @param message Plain 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 AndroidKeySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AndroidKeySettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings; - - /** - * Creates a plain object from an AndroidKeySettings message. Also converts values to other types if specified. - * @param message AndroidKeySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AndroidKeySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a IOSKeySettings. */ - interface IIOSKeySettings { - - /** IOSKeySettings allowedBundleIds */ - allowedBundleIds?: (string[]|null); - } - - /** Represents a IOSKeySettings. */ - class IOSKeySettings implements IIOSKeySettings { - - /** - * Constructs a new IOSKeySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings); - - /** IOSKeySettings allowedBundleIds. */ - public allowedBundleIds: string[]; - - /** - * Creates a new IOSKeySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns IOSKeySettings instance - */ - public static create(properties?: google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings): google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings; - - /** - * Encodes the specified IOSKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.verify|verify} messages. - * @param message IOSKeySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IOSKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.verify|verify} messages. - * @param message IOSKeySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a IOSKeySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IOSKeySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings; - - /** - * Decodes a IOSKeySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IOSKeySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings; - - /** - * Verifies a IOSKeySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a IOSKeySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IOSKeySettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings; - - /** - * Creates a plain object from a IOSKeySettings message. Also converts values to other types if specified. - * @param message IOSKeySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IOSKeySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } } } } diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 7ad309e37a6..b798ec91426 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -8986,171 +8986,6 @@ * @variation 2 */ - /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#createKey}. - * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 - * @typedef CreateKeyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.recaptchaenterprise.v1beta1.Key} [response] Key - */ - - /** - * Calls CreateKey. - * @function createKey - * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 - * @instance - * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest} request CreateKeyRequest message or plain object - * @param {google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateKeyCallback} callback Node-style callback called with the error, if any, and Key - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RecaptchaEnterpriseServiceV1Beta1.prototype.createKey = function createKey(request, callback) { - return this.rpcCall(createKey, $root.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest, $root.google.cloud.recaptchaenterprise.v1beta1.Key, request, callback); - }, "name", { value: "CreateKey" }); - - /** - * Calls CreateKey. - * @function createKey - * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 - * @instance - * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest} request CreateKeyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#listKeys}. - * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 - * @typedef ListKeysCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse} [response] ListKeysResponse - */ - - /** - * Calls ListKeys. - * @function listKeys - * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 - * @instance - * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest} request ListKeysRequest message or plain object - * @param {google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.ListKeysCallback} callback Node-style callback called with the error, if any, and ListKeysResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RecaptchaEnterpriseServiceV1Beta1.prototype.listKeys = function listKeys(request, callback) { - return this.rpcCall(listKeys, $root.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest, $root.google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse, request, callback); - }, "name", { value: "ListKeys" }); - - /** - * Calls ListKeys. - * @function listKeys - * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 - * @instance - * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest} request ListKeysRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#getKey}. - * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 - * @typedef GetKeyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.recaptchaenterprise.v1beta1.Key} [response] Key - */ - - /** - * Calls GetKey. - * @function getKey - * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 - * @instance - * @param {google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest} request GetKeyRequest message or plain object - * @param {google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.GetKeyCallback} callback Node-style callback called with the error, if any, and Key - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RecaptchaEnterpriseServiceV1Beta1.prototype.getKey = function getKey(request, callback) { - return this.rpcCall(getKey, $root.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest, $root.google.cloud.recaptchaenterprise.v1beta1.Key, request, callback); - }, "name", { value: "GetKey" }); - - /** - * Calls GetKey. - * @function getKey - * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 - * @instance - * @param {google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest} request GetKeyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#updateKey}. - * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 - * @typedef UpdateKeyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.recaptchaenterprise.v1beta1.Key} [response] Key - */ - - /** - * Calls UpdateKey. - * @function updateKey - * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 - * @instance - * @param {google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest} request UpdateKeyRequest message or plain object - * @param {google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.UpdateKeyCallback} callback Node-style callback called with the error, if any, and Key - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RecaptchaEnterpriseServiceV1Beta1.prototype.updateKey = function updateKey(request, callback) { - return this.rpcCall(updateKey, $root.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest, $root.google.cloud.recaptchaenterprise.v1beta1.Key, request, callback); - }, "name", { value: "UpdateKey" }); - - /** - * Calls UpdateKey. - * @function updateKey - * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 - * @instance - * @param {google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest} request UpdateKeyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#deleteKey}. - * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 - * @typedef DeleteKeyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteKey. - * @function deleteKey - * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 - * @instance - * @param {google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest} request DeleteKeyRequest message or plain object - * @param {google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.DeleteKeyCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RecaptchaEnterpriseServiceV1Beta1.prototype.deleteKey = function deleteKey(request, callback) { - return this.rpcCall(deleteKey, $root.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteKey" }); - - /** - * Calls DeleteKey. - * @function deleteKey - * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 - * @instance - * @param {google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest} request DeleteKeyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - return RecaptchaEnterpriseServiceV1Beta1; })(); @@ -9377,6 +9212,8 @@ * @interface IAnnotateAssessmentRequest * @property {string|null} [name] AnnotateAssessmentRequest name * @property {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation|null} [annotation] AnnotateAssessmentRequest annotation + * @property {Array.|null} [reasons] AnnotateAssessmentRequest reasons + * @property {Uint8Array|null} [hashedAccountId] AnnotateAssessmentRequest hashedAccountId */ /** @@ -9388,6 +9225,7 @@ * @param {google.cloud.recaptchaenterprise.v1beta1.IAnnotateAssessmentRequest=} [properties] Properties to set */ function AnnotateAssessmentRequest(properties) { + this.reasons = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9410,6 +9248,22 @@ */ AnnotateAssessmentRequest.prototype.annotation = 0; + /** + * AnnotateAssessmentRequest reasons. + * @member {Array.} reasons + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + * @instance + */ + AnnotateAssessmentRequest.prototype.reasons = $util.emptyArray; + + /** + * AnnotateAssessmentRequest hashedAccountId. + * @member {Uint8Array} hashedAccountId + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + * @instance + */ + AnnotateAssessmentRequest.prototype.hashedAccountId = $util.newBuffer([]); + /** * Creates a new AnnotateAssessmentRequest instance using the specified properties. * @function create @@ -9438,6 +9292,14 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.annotation); + if (message.reasons != null && message.reasons.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.reasons.length; ++i) + writer.int32(message.reasons[i]); + writer.ldelim(); + } + if (message.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hashedAccountId); return writer; }; @@ -9478,6 +9340,19 @@ case 2: message.annotation = reader.int32(); break; + case 3: + if (!(message.reasons && message.reasons.length)) + message.reasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.reasons.push(reader.int32()); + } else + message.reasons.push(reader.int32()); + break; + case 4: + message.hashedAccountId = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -9523,8 +9398,33 @@ case 0: case 1: case 2: + case 3: + case 4: break; } + if (message.reasons != null && message.hasOwnProperty("reasons")) { + if (!Array.isArray(message.reasons)) + return "reasons: array expected"; + for (var i = 0; i < message.reasons.length; ++i) + switch (message.reasons[i]) { + default: + return "reasons: enum value[] expected"; + case 0: + case 1: + case 8: + case 9: + case 2: + case 7: + case 3: + case 4: + case 5: + case 6: + break; + } + } + if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) + return "hashedAccountId: buffer expected"; return null; }; @@ -9555,7 +9455,69 @@ case 2: message.annotation = 2; break; + case "PASSWORD_CORRECT": + case 3: + message.annotation = 3; + break; + case "PASSWORD_INCORRECT": + case 4: + message.annotation = 4; + break; + } + if (object.reasons) { + if (!Array.isArray(object.reasons)) + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.reasons: array expected"); + message.reasons = []; + for (var i = 0; i < object.reasons.length; ++i) + switch (object.reasons[i]) { + default: + case "REASON_UNSPECIFIED": + case 0: + message.reasons[i] = 0; + break; + case "CHARGEBACK": + case 1: + message.reasons[i] = 1; + break; + case "CHARGEBACK_FRAUD": + case 8: + message.reasons[i] = 8; + break; + case "CHARGEBACK_DISPUTE": + case 9: + message.reasons[i] = 9; + break; + case "PAYMENT_HEURISTICS": + case 2: + message.reasons[i] = 2; + break; + case "INITIATED_TWO_FACTOR": + case 7: + message.reasons[i] = 7; + break; + case "PASSED_TWO_FACTOR": + case 3: + message.reasons[i] = 3; + break; + case "FAILED_TWO_FACTOR": + case 4: + message.reasons[i] = 4; + break; + case "CORRECT_PASSWORD": + case 5: + message.reasons[i] = 5; + break; + case "INCORRECT_PASSWORD": + case 6: + message.reasons[i] = 6; + break; + } } + if (object.hashedAccountId != null) + if (typeof object.hashedAccountId === "string") + $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); + else if (object.hashedAccountId.length) + message.hashedAccountId = object.hashedAccountId; return message; }; @@ -9572,14 +9534,30 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.reasons = []; if (options.defaults) { object.name = ""; object.annotation = options.enums === String ? "ANNOTATION_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.bytes === String) + object.hashedAccountId = ""; + else { + object.hashedAccountId = []; + if (options.bytes !== Array) + object.hashedAccountId = $util.newBuffer(object.hashedAccountId); + } + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; if (message.annotation != null && message.hasOwnProperty("annotation")) object.annotation = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation[message.annotation] : message.annotation; + if (message.reasons && message.reasons.length) { + object.reasons = []; + for (var j = 0; j < message.reasons.length; ++j) + object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Reason[message.reasons[j]] : message.reasons[j]; + } + if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; return object; }; @@ -9601,12 +9579,46 @@ * @property {number} ANNOTATION_UNSPECIFIED=0 ANNOTATION_UNSPECIFIED value * @property {number} LEGITIMATE=1 LEGITIMATE value * @property {number} FRAUDULENT=2 FRAUDULENT value + * @property {number} PASSWORD_CORRECT=3 PASSWORD_CORRECT value + * @property {number} PASSWORD_INCORRECT=4 PASSWORD_INCORRECT value */ AnnotateAssessmentRequest.Annotation = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "ANNOTATION_UNSPECIFIED"] = 0; values[valuesById[1] = "LEGITIMATE"] = 1; values[valuesById[2] = "FRAUDULENT"] = 2; + values[valuesById[3] = "PASSWORD_CORRECT"] = 3; + values[valuesById[4] = "PASSWORD_INCORRECT"] = 4; + return values; + })(); + + /** + * Reason enum. + * @name google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Reason + * @enum {number} + * @property {number} REASON_UNSPECIFIED=0 REASON_UNSPECIFIED value + * @property {number} CHARGEBACK=1 CHARGEBACK value + * @property {number} CHARGEBACK_FRAUD=8 CHARGEBACK_FRAUD value + * @property {number} CHARGEBACK_DISPUTE=9 CHARGEBACK_DISPUTE value + * @property {number} PAYMENT_HEURISTICS=2 PAYMENT_HEURISTICS value + * @property {number} INITIATED_TWO_FACTOR=7 INITIATED_TWO_FACTOR value + * @property {number} PASSED_TWO_FACTOR=3 PASSED_TWO_FACTOR value + * @property {number} FAILED_TWO_FACTOR=4 FAILED_TWO_FACTOR value + * @property {number} CORRECT_PASSWORD=5 CORRECT_PASSWORD value + * @property {number} INCORRECT_PASSWORD=6 INCORRECT_PASSWORD value + */ + AnnotateAssessmentRequest.Reason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "CHARGEBACK"] = 1; + values[valuesById[8] = "CHARGEBACK_FRAUD"] = 8; + values[valuesById[9] = "CHARGEBACK_DISPUTE"] = 9; + values[valuesById[2] = "PAYMENT_HEURISTICS"] = 2; + values[valuesById[7] = "INITIATED_TWO_FACTOR"] = 7; + values[valuesById[3] = "PASSED_TWO_FACTOR"] = 3; + values[valuesById[4] = "FAILED_TWO_FACTOR"] = 4; + values[valuesById[5] = "CORRECT_PASSWORD"] = 5; + values[valuesById[6] = "INCORRECT_PASSWORD"] = 6; return values; })(); @@ -9773,6 +9785,247 @@ return AnnotateAssessmentResponse; })(); + v1beta1.PasswordLeakVerification = (function() { + + /** + * Properties of a PasswordLeakVerification. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @interface IPasswordLeakVerification + * @property {Uint8Array|null} [hashedUserCredentials] PasswordLeakVerification hashedUserCredentials + * @property {boolean|null} [credentialsLeaked] PasswordLeakVerification credentialsLeaked + * @property {string|null} [canonicalizedUsername] PasswordLeakVerification canonicalizedUsername + */ + + /** + * Constructs a new PasswordLeakVerification. + * @memberof google.cloud.recaptchaenterprise.v1beta1 + * @classdesc Represents a PasswordLeakVerification. + * @implements IPasswordLeakVerification + * @constructor + * @param {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification=} [properties] Properties to set + */ + function PasswordLeakVerification(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PasswordLeakVerification hashedUserCredentials. + * @member {Uint8Array} hashedUserCredentials + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @instance + */ + PasswordLeakVerification.prototype.hashedUserCredentials = $util.newBuffer([]); + + /** + * PasswordLeakVerification credentialsLeaked. + * @member {boolean} credentialsLeaked + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @instance + */ + PasswordLeakVerification.prototype.credentialsLeaked = false; + + /** + * PasswordLeakVerification canonicalizedUsername. + * @member {string} canonicalizedUsername + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @instance + */ + PasswordLeakVerification.prototype.canonicalizedUsername = ""; + + /** + * Creates a new PasswordLeakVerification instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification} PasswordLeakVerification instance + */ + PasswordLeakVerification.create = function create(properties) { + return new PasswordLeakVerification(properties); + }; + + /** + * Encodes the specified PasswordLeakVerification message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification} message PasswordLeakVerification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PasswordLeakVerification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hashedUserCredentials != null && Object.hasOwnProperty.call(message, "hashedUserCredentials")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hashedUserCredentials); + if (message.credentialsLeaked != null && Object.hasOwnProperty.call(message, "credentialsLeaked")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.credentialsLeaked); + if (message.canonicalizedUsername != null && Object.hasOwnProperty.call(message, "canonicalizedUsername")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.canonicalizedUsername); + return writer; + }; + + /** + * Encodes the specified PasswordLeakVerification message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification} message PasswordLeakVerification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PasswordLeakVerification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PasswordLeakVerification message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification} PasswordLeakVerification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PasswordLeakVerification.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hashedUserCredentials = reader.bytes(); + break; + case 2: + message.credentialsLeaked = reader.bool(); + break; + case 3: + message.canonicalizedUsername = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PasswordLeakVerification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification} PasswordLeakVerification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PasswordLeakVerification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PasswordLeakVerification message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PasswordLeakVerification.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hashedUserCredentials != null && message.hasOwnProperty("hashedUserCredentials")) + if (!(message.hashedUserCredentials && typeof message.hashedUserCredentials.length === "number" || $util.isString(message.hashedUserCredentials))) + return "hashedUserCredentials: buffer expected"; + if (message.credentialsLeaked != null && message.hasOwnProperty("credentialsLeaked")) + if (typeof message.credentialsLeaked !== "boolean") + return "credentialsLeaked: boolean expected"; + if (message.canonicalizedUsername != null && message.hasOwnProperty("canonicalizedUsername")) + if (!$util.isString(message.canonicalizedUsername)) + return "canonicalizedUsername: string expected"; + return null; + }; + + /** + * Creates a PasswordLeakVerification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification} PasswordLeakVerification + */ + PasswordLeakVerification.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification(); + if (object.hashedUserCredentials != null) + if (typeof object.hashedUserCredentials === "string") + $util.base64.decode(object.hashedUserCredentials, message.hashedUserCredentials = $util.newBuffer($util.base64.length(object.hashedUserCredentials)), 0); + else if (object.hashedUserCredentials.length) + message.hashedUserCredentials = object.hashedUserCredentials; + if (object.credentialsLeaked != null) + message.credentialsLeaked = Boolean(object.credentialsLeaked); + if (object.canonicalizedUsername != null) + message.canonicalizedUsername = String(object.canonicalizedUsername); + return message; + }; + + /** + * Creates a plain object from a PasswordLeakVerification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @static + * @param {google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification} message PasswordLeakVerification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PasswordLeakVerification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.hashedUserCredentials = ""; + else { + object.hashedUserCredentials = []; + if (options.bytes !== Array) + object.hashedUserCredentials = $util.newBuffer(object.hashedUserCredentials); + } + object.credentialsLeaked = false; + object.canonicalizedUsername = ""; + } + if (message.hashedUserCredentials != null && message.hasOwnProperty("hashedUserCredentials")) + object.hashedUserCredentials = options.bytes === String ? $util.base64.encode(message.hashedUserCredentials, 0, message.hashedUserCredentials.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedUserCredentials) : message.hashedUserCredentials; + if (message.credentialsLeaked != null && message.hasOwnProperty("credentialsLeaked")) + object.credentialsLeaked = message.credentialsLeaked; + if (message.canonicalizedUsername != null && message.hasOwnProperty("canonicalizedUsername")) + object.canonicalizedUsername = message.canonicalizedUsername; + return object; + }; + + /** + * Converts this PasswordLeakVerification to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @instance + * @returns {Object.} JSON object + */ + PasswordLeakVerification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PasswordLeakVerification; + })(); + v1beta1.Assessment = (function() { /** @@ -9784,6 +10037,8 @@ * @property {number|null} [score] Assessment score * @property {google.cloud.recaptchaenterprise.v1beta1.ITokenProperties|null} [tokenProperties] Assessment tokenProperties * @property {Array.|null} [reasons] Assessment reasons + * @property {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification|null} [passwordLeakVerification] Assessment passwordLeakVerification + * @property {google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment|null} [accountDefenderAssessment] Assessment accountDefenderAssessment */ /** @@ -9842,6 +10097,22 @@ */ Assessment.prototype.reasons = $util.emptyArray; + /** + * Assessment passwordLeakVerification. + * @member {google.cloud.recaptchaenterprise.v1beta1.IPasswordLeakVerification|null|undefined} passwordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @instance + */ + Assessment.prototype.passwordLeakVerification = null; + + /** + * Assessment accountDefenderAssessment. + * @member {google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment|null|undefined} accountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @instance + */ + Assessment.prototype.accountDefenderAssessment = null; + /** * Creates a new Assessment instance using the specified properties. * @function create @@ -9880,6 +10151,10 @@ writer.int32(message.reasons[i]); writer.ldelim(); } + if (message.passwordLeakVerification != null && Object.hasOwnProperty.call(message, "passwordLeakVerification")) + $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.encode(message.passwordLeakVerification, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.accountDefenderAssessment != null && Object.hasOwnProperty.call(message, "accountDefenderAssessment")) + $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.encode(message.accountDefenderAssessment, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -9936,6 +10211,12 @@ } else message.reasons.push(reader.int32()); break; + case 7: + message.passwordLeakVerification = $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.decode(reader, reader.uint32()); + break; + case 8: + message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -10003,6 +10284,16 @@ break; } } + if (message.passwordLeakVerification != null && message.hasOwnProperty("passwordLeakVerification")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.verify(message.passwordLeakVerification); + if (error) + return "passwordLeakVerification." + error; + } + if (message.accountDefenderAssessment != null && message.hasOwnProperty("accountDefenderAssessment")) { + var error = $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.verify(message.accountDefenderAssessment); + if (error) + return "accountDefenderAssessment." + error; + } return null; }; @@ -10065,6 +10356,16 @@ break; } } + if (object.passwordLeakVerification != null) { + if (typeof object.passwordLeakVerification !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Assessment.passwordLeakVerification: object expected"); + message.passwordLeakVerification = $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.fromObject(object.passwordLeakVerification); + } + if (object.accountDefenderAssessment != null) { + if (typeof object.accountDefenderAssessment !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Assessment.accountDefenderAssessment: object expected"); + message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.fromObject(object.accountDefenderAssessment); + } return message; }; @@ -10088,6 +10389,8 @@ object.event = null; object.score = 0; object.tokenProperties = null; + object.passwordLeakVerification = null; + object.accountDefenderAssessment = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -10102,6 +10405,10 @@ for (var j = 0; j < message.reasons.length; ++j) object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason[message.reasons[j]] : message.reasons[j]; } + if (message.passwordLeakVerification != null && message.hasOwnProperty("passwordLeakVerification")) + object.passwordLeakVerification = $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.toObject(message.passwordLeakVerification, options); + if (message.accountDefenderAssessment != null && message.hasOwnProperty("accountDefenderAssessment")) + object.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.toObject(message.accountDefenderAssessment, options); return object; }; @@ -10152,6 +10459,7 @@ * @property {string|null} [userAgent] Event userAgent * @property {string|null} [userIpAddress] Event userIpAddress * @property {string|null} [expectedAction] Event expectedAction + * @property {Uint8Array|null} [hashedAccountId] Event hashedAccountId */ /** @@ -10209,6 +10517,14 @@ */ Event.prototype.expectedAction = ""; + /** + * Event hashedAccountId. + * @member {Uint8Array} hashedAccountId + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @instance + */ + Event.prototype.hashedAccountId = $util.newBuffer([]); + /** * Creates a new Event instance using the specified properties. * @function create @@ -10243,6 +10559,8 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.userIpAddress); if (message.expectedAction != null && Object.hasOwnProperty.call(message, "expectedAction")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.expectedAction); + if (message.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.hashedAccountId); return writer; }; @@ -10292,6 +10610,9 @@ case 5: message.expectedAction = reader.string(); break; + case 6: + message.hashedAccountId = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -10342,6 +10663,9 @@ if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) if (!$util.isString(message.expectedAction)) return "expectedAction: string expected"; + if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) + return "hashedAccountId: buffer expected"; return null; }; @@ -10367,6 +10691,11 @@ message.userIpAddress = String(object.userIpAddress); if (object.expectedAction != null) message.expectedAction = String(object.expectedAction); + if (object.hashedAccountId != null) + if (typeof object.hashedAccountId === "string") + $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); + else if (object.hashedAccountId.length) + message.hashedAccountId = object.hashedAccountId; return message; }; @@ -10389,6 +10718,13 @@ object.userAgent = ""; object.userIpAddress = ""; object.expectedAction = ""; + if (options.bytes === String) + object.hashedAccountId = ""; + else { + object.hashedAccountId = []; + if (options.bytes !== Array) + object.hashedAccountId = $util.newBuffer(object.hashedAccountId); + } } if (message.token != null && message.hasOwnProperty("token")) object.token = message.token; @@ -10400,6 +10736,8 @@ object.userIpAddress = message.userIpAddress; if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) object.expectedAction = message.expectedAction; + if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; return object; }; @@ -10617,6 +10955,7 @@ case 4: case 5: case 6: + case 7: break; } if (message.createTime != null && message.hasOwnProperty("createTime")) { @@ -10676,6 +11015,10 @@ case 6: message.invalidReason = 6; break; + case "BROWSER_ERROR": + case 7: + message.invalidReason = 7; + break; } if (object.createTime != null) { if (typeof object.createTime !== "object") @@ -10744,6 +11087,7 @@ * @property {number} DUPE=4 DUPE value * @property {number} SITE_MISMATCH=5 SITE_MISMATCH value * @property {number} MISSING=6 MISSING value + * @property {number} BROWSER_ERROR=7 BROWSER_ERROR value */ TokenProperties.InvalidReason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -10754,31 +11098,32 @@ values[valuesById[4] = "DUPE"] = 4; values[valuesById[5] = "SITE_MISMATCH"] = 5; values[valuesById[6] = "MISSING"] = 6; + values[valuesById[7] = "BROWSER_ERROR"] = 7; return values; })(); return TokenProperties; })(); - v1beta1.CreateKeyRequest = (function() { + v1beta1.AccountDefenderAssessment = (function() { /** - * Properties of a CreateKeyRequest. + * Properties of an AccountDefenderAssessment. * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @interface ICreateKeyRequest - * @property {string|null} [parent] CreateKeyRequest parent - * @property {google.cloud.recaptchaenterprise.v1beta1.IKey|null} [key] CreateKeyRequest key + * @interface IAccountDefenderAssessment + * @property {Array.|null} [labels] AccountDefenderAssessment labels */ /** - * Constructs a new CreateKeyRequest. + * Constructs a new AccountDefenderAssessment. * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @classdesc Represents a CreateKeyRequest. - * @implements ICreateKeyRequest + * @classdesc Represents an AccountDefenderAssessment. + * @implements IAccountDefenderAssessment * @constructor - * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment=} [properties] Properties to set */ - function CreateKeyRequest(properties) { + function AccountDefenderAssessment(properties) { + this.labels = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10786,88 +11131,86 @@ } /** - * CreateKeyRequest parent. - * @member {string} parent - * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest - * @instance - */ - CreateKeyRequest.prototype.parent = ""; - - /** - * CreateKeyRequest key. - * @member {google.cloud.recaptchaenterprise.v1beta1.IKey|null|undefined} key - * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * AccountDefenderAssessment labels. + * @member {Array.} labels + * @memberof google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment * @instance */ - CreateKeyRequest.prototype.key = null; + AccountDefenderAssessment.prototype.labels = $util.emptyArray; /** - * Creates a new CreateKeyRequest instance using the specified properties. + * Creates a new AccountDefenderAssessment instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest} CreateKeyRequest instance + * @param {google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment} AccountDefenderAssessment instance */ - CreateKeyRequest.create = function create(properties) { - return new CreateKeyRequest(properties); + AccountDefenderAssessment.create = function create(properties) { + return new AccountDefenderAssessment(properties); }; /** - * Encodes the specified CreateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest.verify|verify} messages. + * Encodes the specified AccountDefenderAssessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest} message CreateKeyRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment} message AccountDefenderAssessment message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateKeyRequest.encode = function encode(message, writer) { + AccountDefenderAssessment.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.key != null && Object.hasOwnProperty.call(message, "key")) - $root.google.cloud.recaptchaenterprise.v1beta1.Key.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.labels != null && message.labels.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.labels.length; ++i) + writer.int32(message.labels[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified CreateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest.verify|verify} messages. + * Encodes the specified AccountDefenderAssessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest} message CreateKeyRequest message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1beta1.IAccountDefenderAssessment} message AccountDefenderAssessment message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + AccountDefenderAssessment.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateKeyRequest message from the specified reader or buffer. + * Decodes an AccountDefenderAssessment message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest} CreateKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment} AccountDefenderAssessment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateKeyRequest.decode = function decode(reader, length) { + AccountDefenderAssessment.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.key = $root.google.cloud.recaptchaenterprise.v1beta1.Key.decode(reader, reader.uint32()); + if (!(message.labels && message.labels.length)) + message.labels = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.labels.push(reader.int32()); + } else + message.labels.push(reader.int32()); break; default: reader.skipType(tag & 7); @@ -10878,2264 +11221,149 @@ }; /** - * Decodes a CreateKeyRequest message from the specified reader or buffer, length delimited. + * Decodes an AccountDefenderAssessment message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest} CreateKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment} AccountDefenderAssessment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateKeyRequest.decodeDelimited = function decodeDelimited(reader) { + AccountDefenderAssessment.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateKeyRequest message. + * Verifies an AccountDefenderAssessment message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateKeyRequest.verify = function verify(message) { + AccountDefenderAssessment.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.key != null && message.hasOwnProperty("key")) { - var error = $root.google.cloud.recaptchaenterprise.v1beta1.Key.verify(message.key); - if (error) - return "key." + error; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) + switch (message.labels[i]) { + default: + return "labels: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } } return null; }; /** - * Creates a CreateKeyRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AccountDefenderAssessment message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest} CreateKeyRequest + * @returns {google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment} AccountDefenderAssessment */ - CreateKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest) + AccountDefenderAssessment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest.key: object expected"); - message.key = $root.google.cloud.recaptchaenterprise.v1beta1.Key.fromObject(object.key); + var message = new $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment(); + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) + switch (object.labels[i]) { + default: + case "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED": + case 0: + message.labels[i] = 0; + break; + case "PROFILE_MATCH": + case 1: + message.labels[i] = 1; + break; + case "SUSPICIOUS_LOGIN_ACTIVITY": + case 2: + message.labels[i] = 2; + break; + case "SUSPICIOUS_ACCOUNT_CREATION": + case 3: + message.labels[i] = 3; + break; + case "RELATED_ACCOUNTS_NUMBER_HIGH": + case 4: + message.labels[i] = 4; + break; + } } return message; }; /** - * Creates a plain object from a CreateKeyRequest message. Also converts values to other types if specified. + * Creates a plain object from an AccountDefenderAssessment message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest} message CreateKeyRequest + * @param {google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment} message AccountDefenderAssessment * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateKeyRequest.toObject = function toObject(message, options) { + AccountDefenderAssessment.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.key = null; + if (options.arrays || options.defaults) + object.labels = []; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.AccountDefenderLabel[message.labels[j]] : message.labels[j]; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.google.cloud.recaptchaenterprise.v1beta1.Key.toObject(message.key, options); return object; }; /** - * Converts this CreateKeyRequest to JSON. + * Converts this AccountDefenderAssessment to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest + * @memberof google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment * @instance * @returns {Object.} JSON object */ - CreateKeyRequest.prototype.toJSON = function toJSON() { + AccountDefenderAssessment.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateKeyRequest; - })(); - - v1beta1.ListKeysRequest = (function() { - - /** - * Properties of a ListKeysRequest. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @interface IListKeysRequest - * @property {string|null} [parent] ListKeysRequest parent - * @property {number|null} [pageSize] ListKeysRequest pageSize - * @property {string|null} [pageToken] ListKeysRequest pageToken - */ - - /** - * Constructs a new ListKeysRequest. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @classdesc Represents a ListKeysRequest. - * @implements IListKeysRequest - * @constructor - * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest=} [properties] Properties to set - */ - function ListKeysRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListKeysRequest parent. - * @member {string} parent - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest - * @instance - */ - ListKeysRequest.prototype.parent = ""; - - /** - * ListKeysRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest - * @instance - */ - ListKeysRequest.prototype.pageSize = 0; - - /** - * ListKeysRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest - * @instance - */ - ListKeysRequest.prototype.pageToken = ""; - - /** - * Creates a new ListKeysRequest instance using the specified properties. - * @function create - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} ListKeysRequest instance - */ - ListKeysRequest.create = function create(properties) { - return new ListKeysRequest(properties); - }; - - /** - * Encodes the specified ListKeysRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest} message ListKeysRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListKeysRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - /** - * Encodes the specified ListKeysRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest} message ListKeysRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * AccountDefenderLabel enum. + * @name google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.AccountDefenderLabel + * @enum {number} + * @property {number} ACCOUNT_DEFENDER_LABEL_UNSPECIFIED=0 ACCOUNT_DEFENDER_LABEL_UNSPECIFIED value + * @property {number} PROFILE_MATCH=1 PROFILE_MATCH value + * @property {number} SUSPICIOUS_LOGIN_ACTIVITY=2 SUSPICIOUS_LOGIN_ACTIVITY value + * @property {number} SUSPICIOUS_ACCOUNT_CREATION=3 SUSPICIOUS_ACCOUNT_CREATION value + * @property {number} RELATED_ACCOUNTS_NUMBER_HIGH=4 RELATED_ACCOUNTS_NUMBER_HIGH value */ - ListKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + AccountDefenderAssessment.AccountDefenderLabel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROFILE_MATCH"] = 1; + values[valuesById[2] = "SUSPICIOUS_LOGIN_ACTIVITY"] = 2; + values[valuesById[3] = "SUSPICIOUS_ACCOUNT_CREATION"] = 3; + values[valuesById[4] = "RELATED_ACCOUNTS_NUMBER_HIGH"] = 4; + return values; + })(); - /** - * Decodes a ListKeysRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} ListKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListKeysRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListKeysRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} ListKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListKeysRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListKeysRequest message. - * @function verify - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListKeysRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListKeysRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} ListKeysRequest - */ - ListKeysRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest) - return object; - var message = new $root.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListKeysRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} message ListKeysRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListKeysRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListKeysRequest to JSON. - * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest - * @instance - * @returns {Object.} JSON object - */ - ListKeysRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ListKeysRequest; - })(); - - v1beta1.ListKeysResponse = (function() { - - /** - * Properties of a ListKeysResponse. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @interface IListKeysResponse - * @property {Array.|null} [keys] ListKeysResponse keys - * @property {string|null} [nextPageToken] ListKeysResponse nextPageToken - */ - - /** - * Constructs a new ListKeysResponse. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @classdesc Represents a ListKeysResponse. - * @implements IListKeysResponse - * @constructor - * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse=} [properties] Properties to set - */ - function ListKeysResponse(properties) { - this.keys = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListKeysResponse keys. - * @member {Array.} keys - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse - * @instance - */ - ListKeysResponse.prototype.keys = $util.emptyArray; - - /** - * ListKeysResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse - * @instance - */ - ListKeysResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListKeysResponse instance using the specified properties. - * @function create - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse} ListKeysResponse instance - */ - ListKeysResponse.create = function create(properties) { - return new ListKeysResponse(properties); - }; - - /** - * Encodes the specified ListKeysResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse} message ListKeysResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListKeysResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - $root.google.cloud.recaptchaenterprise.v1beta1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListKeysResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse} message ListKeysResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListKeysResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse} ListKeysResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListKeysResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.cloud.recaptchaenterprise.v1beta1.Key.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListKeysResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse} ListKeysResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListKeysResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListKeysResponse message. - * @function verify - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListKeysResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keys != null && message.hasOwnProperty("keys")) { - if (!Array.isArray(message.keys)) - return "keys: array expected"; - for (var i = 0; i < message.keys.length; ++i) { - var error = $root.google.cloud.recaptchaenterprise.v1beta1.Key.verify(message.keys[i]); - if (error) - return "keys." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListKeysResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse} ListKeysResponse - */ - ListKeysResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse) - return object; - var message = new $root.google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse(); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse.keys: object expected"); - message.keys[i] = $root.google.cloud.recaptchaenterprise.v1beta1.Key.fromObject(object.keys[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListKeysResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse} message ListKeysResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListKeysResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keys = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.cloud.recaptchaenterprise.v1beta1.Key.toObject(message.keys[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListKeysResponse to JSON. - * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse - * @instance - * @returns {Object.} JSON object - */ - ListKeysResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ListKeysResponse; - })(); - - v1beta1.GetKeyRequest = (function() { - - /** - * Properties of a GetKeyRequest. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @interface IGetKeyRequest - * @property {string|null} [name] GetKeyRequest name - */ - - /** - * Constructs a new GetKeyRequest. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @classdesc Represents a GetKeyRequest. - * @implements IGetKeyRequest - * @constructor - * @param {google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest=} [properties] Properties to set - */ - function GetKeyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetKeyRequest name. - * @member {string} name - * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest - * @instance - */ - GetKeyRequest.prototype.name = ""; - - /** - * Creates a new GetKeyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest} GetKeyRequest instance - */ - GetKeyRequest.create = function create(properties) { - return new GetKeyRequest(properties); - }; - - /** - * Encodes the specified GetKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest} message GetKeyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetKeyRequest.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 GetKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest} message GetKeyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetKeyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest} GetKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetKeyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest(); - 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 GetKeyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest} GetKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetKeyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetKeyRequest message. - * @function verify - * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetKeyRequest.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 GetKeyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest} GetKeyRequest - */ - GetKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest) - return object; - var message = new $root.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetKeyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest} message GetKeyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetKeyRequest.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 GetKeyRequest to JSON. - * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest - * @instance - * @returns {Object.} JSON object - */ - GetKeyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetKeyRequest; - })(); - - v1beta1.UpdateKeyRequest = (function() { - - /** - * Properties of an UpdateKeyRequest. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @interface IUpdateKeyRequest - * @property {google.cloud.recaptchaenterprise.v1beta1.IKey|null} [key] UpdateKeyRequest key - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateKeyRequest updateMask - */ - - /** - * Constructs a new UpdateKeyRequest. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @classdesc Represents an UpdateKeyRequest. - * @implements IUpdateKeyRequest - * @constructor - * @param {google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest=} [properties] Properties to set - */ - function UpdateKeyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateKeyRequest key. - * @member {google.cloud.recaptchaenterprise.v1beta1.IKey|null|undefined} key - * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest - * @instance - */ - UpdateKeyRequest.prototype.key = null; - - /** - * UpdateKeyRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest - * @instance - */ - UpdateKeyRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateKeyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest} UpdateKeyRequest instance - */ - UpdateKeyRequest.create = function create(properties) { - return new UpdateKeyRequest(properties); - }; - - /** - * Encodes the specified UpdateKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest} message UpdateKeyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateKeyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.google.cloud.recaptchaenterprise.v1beta1.Key.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest} message UpdateKeyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateKeyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest} UpdateKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateKeyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = $root.google.cloud.recaptchaenterprise.v1beta1.Key.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateKeyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest} UpdateKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateKeyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateKeyRequest message. - * @function verify - * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateKeyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.google.cloud.recaptchaenterprise.v1beta1.Key.verify(message.key); - if (error) - return "key." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateKeyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest} UpdateKeyRequest - */ - UpdateKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest) - return object; - var message = new $root.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest(); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest.key: object expected"); - message.key = $root.google.cloud.recaptchaenterprise.v1beta1.Key.fromObject(object.key); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateKeyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest} message UpdateKeyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateKeyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.key = null; - object.updateMask = null; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.google.cloud.recaptchaenterprise.v1beta1.Key.toObject(message.key, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateKeyRequest to JSON. - * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateKeyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UpdateKeyRequest; - })(); - - v1beta1.DeleteKeyRequest = (function() { - - /** - * Properties of a DeleteKeyRequest. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @interface IDeleteKeyRequest - * @property {string|null} [name] DeleteKeyRequest name - */ - - /** - * Constructs a new DeleteKeyRequest. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @classdesc Represents a DeleteKeyRequest. - * @implements IDeleteKeyRequest - * @constructor - * @param {google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest=} [properties] Properties to set - */ - function DeleteKeyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteKeyRequest name. - * @member {string} name - * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest - * @instance - */ - DeleteKeyRequest.prototype.name = ""; - - /** - * Creates a new DeleteKeyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest} DeleteKeyRequest instance - */ - DeleteKeyRequest.create = function create(properties) { - return new DeleteKeyRequest(properties); - }; - - /** - * Encodes the specified DeleteKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest} message DeleteKeyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteKeyRequest.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 DeleteKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest} message DeleteKeyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteKeyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest} DeleteKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteKeyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest(); - 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 DeleteKeyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest} DeleteKeyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteKeyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteKeyRequest message. - * @function verify - * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteKeyRequest.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 DeleteKeyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest} DeleteKeyRequest - */ - DeleteKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest) - return object; - var message = new $root.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteKeyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest} message DeleteKeyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteKeyRequest.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 DeleteKeyRequest to JSON. - * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteKeyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DeleteKeyRequest; - })(); - - v1beta1.Key = (function() { - - /** - * Properties of a Key. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @interface IKey - * @property {string|null} [name] Key name - * @property {string|null} [displayName] Key displayName - * @property {google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings|null} [webSettings] Key webSettings - * @property {google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings|null} [androidSettings] Key androidSettings - * @property {google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings|null} [iosSettings] Key iosSettings - */ - - /** - * Constructs a new Key. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @classdesc Represents a Key. - * @implements IKey - * @constructor - * @param {google.cloud.recaptchaenterprise.v1beta1.IKey=} [properties] Properties to set - */ - function Key(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Key name. - * @member {string} name - * @memberof google.cloud.recaptchaenterprise.v1beta1.Key - * @instance - */ - Key.prototype.name = ""; - - /** - * Key displayName. - * @member {string} displayName - * @memberof google.cloud.recaptchaenterprise.v1beta1.Key - * @instance - */ - Key.prototype.displayName = ""; - - /** - * Key webSettings. - * @member {google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings|null|undefined} webSettings - * @memberof google.cloud.recaptchaenterprise.v1beta1.Key - * @instance - */ - Key.prototype.webSettings = null; - - /** - * Key androidSettings. - * @member {google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings|null|undefined} androidSettings - * @memberof google.cloud.recaptchaenterprise.v1beta1.Key - * @instance - */ - Key.prototype.androidSettings = null; - - /** - * Key iosSettings. - * @member {google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings|null|undefined} iosSettings - * @memberof google.cloud.recaptchaenterprise.v1beta1.Key - * @instance - */ - Key.prototype.iosSettings = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Key platformSettings. - * @member {"webSettings"|"androidSettings"|"iosSettings"|undefined} platformSettings - * @memberof google.cloud.recaptchaenterprise.v1beta1.Key - * @instance - */ - Object.defineProperty(Key.prototype, "platformSettings", { - get: $util.oneOfGetter($oneOfFields = ["webSettings", "androidSettings", "iosSettings"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Key instance using the specified properties. - * @function create - * @memberof google.cloud.recaptchaenterprise.v1beta1.Key - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IKey=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1beta1.Key} Key instance - */ - Key.create = function create(properties) { - return new Key(properties); - }; - - /** - * Encodes the specified Key message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Key.verify|verify} messages. - * @function encode - * @memberof google.cloud.recaptchaenterprise.v1beta1.Key - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IKey} message Key message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Key.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.webSettings != null && Object.hasOwnProperty.call(message, "webSettings")) - $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.encode(message.webSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.androidSettings != null && Object.hasOwnProperty.call(message, "androidSettings")) - $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.encode(message.androidSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.iosSettings != null && Object.hasOwnProperty.call(message, "iosSettings")) - $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.encode(message.iosSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Key message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.Key.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.Key - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IKey} message Key message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Key.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Key message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.recaptchaenterprise.v1beta1.Key - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1beta1.Key} Key - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Key.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.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: - message.webSettings = $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.decode(reader, reader.uint32()); - break; - case 4: - message.androidSettings = $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.decode(reader, reader.uint32()); - break; - case 5: - message.iosSettings = $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Key message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.Key - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1beta1.Key} Key - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Key.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Key message. - * @function verify - * @memberof google.cloud.recaptchaenterprise.v1beta1.Key - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Key.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.webSettings != null && message.hasOwnProperty("webSettings")) { - properties.platformSettings = 1; - { - var error = $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.verify(message.webSettings); - if (error) - return "webSettings." + error; - } - } - if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) { - if (properties.platformSettings === 1) - return "platformSettings: multiple values"; - properties.platformSettings = 1; - { - var error = $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.verify(message.androidSettings); - if (error) - return "androidSettings." + error; - } - } - if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) { - if (properties.platformSettings === 1) - return "platformSettings: multiple values"; - properties.platformSettings = 1; - { - var error = $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.verify(message.iosSettings); - if (error) - return "iosSettings." + error; - } - } - return null; - }; - - /** - * Creates a Key message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.Key - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1beta1.Key} Key - */ - Key.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.Key) - return object; - var message = new $root.google.cloud.recaptchaenterprise.v1beta1.Key(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.webSettings != null) { - if (typeof object.webSettings !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Key.webSettings: object expected"); - message.webSettings = $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.fromObject(object.webSettings); - } - if (object.androidSettings != null) { - if (typeof object.androidSettings !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Key.androidSettings: object expected"); - message.androidSettings = $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.fromObject(object.androidSettings); - } - if (object.iosSettings != null) { - if (typeof object.iosSettings !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.Key.iosSettings: object expected"); - message.iosSettings = $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.fromObject(object.iosSettings); - } - return message; - }; - - /** - * Creates a plain object from a Key message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.Key - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.Key} message Key - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Key.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.webSettings != null && message.hasOwnProperty("webSettings")) { - object.webSettings = $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.toObject(message.webSettings, options); - if (options.oneofs) - object.platformSettings = "webSettings"; - } - if (message.androidSettings != null && message.hasOwnProperty("androidSettings")) { - object.androidSettings = $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.toObject(message.androidSettings, options); - if (options.oneofs) - object.platformSettings = "androidSettings"; - } - if (message.iosSettings != null && message.hasOwnProperty("iosSettings")) { - object.iosSettings = $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.toObject(message.iosSettings, options); - if (options.oneofs) - object.platformSettings = "iosSettings"; - } - return object; - }; - - /** - * Converts this Key to JSON. - * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1beta1.Key - * @instance - * @returns {Object.} JSON object - */ - Key.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Key; - })(); - - v1beta1.WebKeySettings = (function() { - - /** - * Properties of a WebKeySettings. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @interface IWebKeySettings - * @property {boolean|null} [enforceAllowedDomains] WebKeySettings enforceAllowedDomains - * @property {Array.|null} [allowedDomains] WebKeySettings allowedDomains - * @property {boolean|null} [allowAmpTraffic] WebKeySettings allowAmpTraffic - * @property {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType|null} [integrationType] WebKeySettings integrationType - * @property {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference|null} [challengeSecurityPreference] WebKeySettings challengeSecurityPreference - */ - - /** - * Constructs a new WebKeySettings. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @classdesc Represents a WebKeySettings. - * @implements IWebKeySettings - * @constructor - * @param {google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings=} [properties] Properties to set - */ - function WebKeySettings(properties) { - this.allowedDomains = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WebKeySettings enforceAllowedDomains. - * @member {boolean} enforceAllowedDomains - * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings - * @instance - */ - WebKeySettings.prototype.enforceAllowedDomains = false; - - /** - * WebKeySettings allowedDomains. - * @member {Array.} allowedDomains - * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings - * @instance - */ - WebKeySettings.prototype.allowedDomains = $util.emptyArray; - - /** - * WebKeySettings allowAmpTraffic. - * @member {boolean} allowAmpTraffic - * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings - * @instance - */ - WebKeySettings.prototype.allowAmpTraffic = false; - - /** - * WebKeySettings integrationType. - * @member {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType} integrationType - * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings - * @instance - */ - WebKeySettings.prototype.integrationType = 0; - - /** - * WebKeySettings challengeSecurityPreference. - * @member {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference} challengeSecurityPreference - * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings - * @instance - */ - WebKeySettings.prototype.challengeSecurityPreference = 0; - - /** - * Creates a new WebKeySettings instance using the specified properties. - * @function create - * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings} WebKeySettings instance - */ - WebKeySettings.create = function create(properties) { - return new WebKeySettings(properties); - }; - - /** - * Encodes the specified WebKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings} message WebKeySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebKeySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedDomains != null && message.allowedDomains.length) - for (var i = 0; i < message.allowedDomains.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedDomains[i]); - if (message.allowAmpTraffic != null && Object.hasOwnProperty.call(message, "allowAmpTraffic")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAmpTraffic); - if (message.enforceAllowedDomains != null && Object.hasOwnProperty.call(message, "enforceAllowedDomains")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enforceAllowedDomains); - if (message.integrationType != null && Object.hasOwnProperty.call(message, "integrationType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.integrationType); - if (message.challengeSecurityPreference != null && Object.hasOwnProperty.call(message, "challengeSecurityPreference")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.challengeSecurityPreference); - return writer; - }; - - /** - * Encodes the specified WebKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IWebKeySettings} message WebKeySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebKeySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WebKeySettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings} WebKeySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebKeySettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: - message.enforceAllowedDomains = reader.bool(); - break; - case 1: - if (!(message.allowedDomains && message.allowedDomains.length)) - message.allowedDomains = []; - message.allowedDomains.push(reader.string()); - break; - case 2: - message.allowAmpTraffic = reader.bool(); - break; - case 4: - message.integrationType = reader.int32(); - break; - case 5: - message.challengeSecurityPreference = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WebKeySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings} WebKeySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebKeySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WebKeySettings message. - * @function verify - * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WebKeySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enforceAllowedDomains != null && message.hasOwnProperty("enforceAllowedDomains")) - if (typeof message.enforceAllowedDomains !== "boolean") - return "enforceAllowedDomains: boolean expected"; - if (message.allowedDomains != null && message.hasOwnProperty("allowedDomains")) { - if (!Array.isArray(message.allowedDomains)) - return "allowedDomains: array expected"; - for (var i = 0; i < message.allowedDomains.length; ++i) - if (!$util.isString(message.allowedDomains[i])) - return "allowedDomains: string[] expected"; - } - if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) - if (typeof message.allowAmpTraffic !== "boolean") - return "allowAmpTraffic: boolean expected"; - if (message.integrationType != null && message.hasOwnProperty("integrationType")) - switch (message.integrationType) { - default: - return "integrationType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) - switch (message.challengeSecurityPreference) { - default: - return "challengeSecurityPreference: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a WebKeySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings} WebKeySettings - */ - WebKeySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings) - return object; - var message = new $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings(); - if (object.enforceAllowedDomains != null) - message.enforceAllowedDomains = Boolean(object.enforceAllowedDomains); - if (object.allowedDomains) { - if (!Array.isArray(object.allowedDomains)) - throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.allowedDomains: array expected"); - message.allowedDomains = []; - for (var i = 0; i < object.allowedDomains.length; ++i) - message.allowedDomains[i] = String(object.allowedDomains[i]); - } - if (object.allowAmpTraffic != null) - message.allowAmpTraffic = Boolean(object.allowAmpTraffic); - switch (object.integrationType) { - case "INTEGRATION_TYPE_UNSPECIFIED": - case 0: - message.integrationType = 0; - break; - case "SCORE_ONLY": - case 1: - message.integrationType = 1; - break; - case "CHECKBOX_CHALLENGE": - case 2: - message.integrationType = 2; - break; - case "INVISIBLE_CHALLENGE": - case 3: - message.integrationType = 3; - break; - } - switch (object.challengeSecurityPreference) { - case "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED": - case 0: - message.challengeSecurityPreference = 0; - break; - case "USABILITY": - case 1: - message.challengeSecurityPreference = 1; - break; - case "BALANCED": - case 2: - message.challengeSecurityPreference = 2; - break; - case "SECURITY": - case 3: - message.challengeSecurityPreference = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a WebKeySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.WebKeySettings} message WebKeySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WebKeySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedDomains = []; - if (options.defaults) { - object.allowAmpTraffic = false; - object.enforceAllowedDomains = false; - object.integrationType = options.enums === String ? "INTEGRATION_TYPE_UNSPECIFIED" : 0; - object.challengeSecurityPreference = options.enums === String ? "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED" : 0; - } - if (message.allowedDomains && message.allowedDomains.length) { - object.allowedDomains = []; - for (var j = 0; j < message.allowedDomains.length; ++j) - object.allowedDomains[j] = message.allowedDomains[j]; - } - if (message.allowAmpTraffic != null && message.hasOwnProperty("allowAmpTraffic")) - object.allowAmpTraffic = message.allowAmpTraffic; - if (message.enforceAllowedDomains != null && message.hasOwnProperty("enforceAllowedDomains")) - object.enforceAllowedDomains = message.enforceAllowedDomains; - if (message.integrationType != null && message.hasOwnProperty("integrationType")) - object.integrationType = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType[message.integrationType] : message.integrationType; - if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) - object.challengeSecurityPreference = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference[message.challengeSecurityPreference] : message.challengeSecurityPreference; - return object; - }; - - /** - * Converts this WebKeySettings to JSON. - * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1beta1.WebKeySettings - * @instance - * @returns {Object.} JSON object - */ - WebKeySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * IntegrationType enum. - * @name google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType - * @enum {number} - * @property {number} INTEGRATION_TYPE_UNSPECIFIED=0 INTEGRATION_TYPE_UNSPECIFIED value - * @property {number} SCORE_ONLY=1 SCORE_ONLY value - * @property {number} CHECKBOX_CHALLENGE=2 CHECKBOX_CHALLENGE value - * @property {number} INVISIBLE_CHALLENGE=3 INVISIBLE_CHALLENGE value - */ - WebKeySettings.IntegrationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INTEGRATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SCORE_ONLY"] = 1; - values[valuesById[2] = "CHECKBOX_CHALLENGE"] = 2; - values[valuesById[3] = "INVISIBLE_CHALLENGE"] = 3; - return values; - })(); - - /** - * ChallengeSecurityPreference enum. - * @name google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference - * @enum {number} - * @property {number} CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED=0 CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED value - * @property {number} USABILITY=1 USABILITY value - * @property {number} BALANCED=2 BALANCED value - * @property {number} SECURITY=3 SECURITY value - */ - WebKeySettings.ChallengeSecurityPreference = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED"] = 0; - values[valuesById[1] = "USABILITY"] = 1; - values[valuesById[2] = "BALANCED"] = 2; - values[valuesById[3] = "SECURITY"] = 3; - return values; - })(); - - return WebKeySettings; - })(); - - v1beta1.AndroidKeySettings = (function() { - - /** - * Properties of an AndroidKeySettings. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @interface IAndroidKeySettings - * @property {Array.|null} [allowedPackageNames] AndroidKeySettings allowedPackageNames - */ - - /** - * Constructs a new AndroidKeySettings. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @classdesc Represents an AndroidKeySettings. - * @implements IAndroidKeySettings - * @constructor - * @param {google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings=} [properties] Properties to set - */ - function AndroidKeySettings(properties) { - this.allowedPackageNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AndroidKeySettings allowedPackageNames. - * @member {Array.} allowedPackageNames - * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings - * @instance - */ - AndroidKeySettings.prototype.allowedPackageNames = $util.emptyArray; - - /** - * Creates a new AndroidKeySettings instance using the specified properties. - * @function create - * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings} AndroidKeySettings instance - */ - AndroidKeySettings.create = function create(properties) { - return new AndroidKeySettings(properties); - }; - - /** - * Encodes the specified AndroidKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings} message AndroidKeySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AndroidKeySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedPackageNames != null && message.allowedPackageNames.length) - for (var i = 0; i < message.allowedPackageNames.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedPackageNames[i]); - return writer; - }; - - /** - * Encodes the specified AndroidKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IAndroidKeySettings} message AndroidKeySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AndroidKeySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AndroidKeySettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings} AndroidKeySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AndroidKeySettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.allowedPackageNames && message.allowedPackageNames.length)) - message.allowedPackageNames = []; - message.allowedPackageNames.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AndroidKeySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings} AndroidKeySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AndroidKeySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AndroidKeySettings message. - * @function verify - * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AndroidKeySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedPackageNames != null && message.hasOwnProperty("allowedPackageNames")) { - if (!Array.isArray(message.allowedPackageNames)) - return "allowedPackageNames: array expected"; - for (var i = 0; i < message.allowedPackageNames.length; ++i) - if (!$util.isString(message.allowedPackageNames[i])) - return "allowedPackageNames: string[] expected"; - } - return null; - }; - - /** - * Creates an AndroidKeySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings} AndroidKeySettings - */ - AndroidKeySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings) - return object; - var message = new $root.google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings(); - if (object.allowedPackageNames) { - if (!Array.isArray(object.allowedPackageNames)) - throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings.allowedPackageNames: array expected"); - message.allowedPackageNames = []; - for (var i = 0; i < object.allowedPackageNames.length; ++i) - message.allowedPackageNames[i] = String(object.allowedPackageNames[i]); - } - return message; - }; - - /** - * Creates a plain object from an AndroidKeySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings} message AndroidKeySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AndroidKeySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedPackageNames = []; - if (message.allowedPackageNames && message.allowedPackageNames.length) { - object.allowedPackageNames = []; - for (var j = 0; j < message.allowedPackageNames.length; ++j) - object.allowedPackageNames[j] = message.allowedPackageNames[j]; - } - return object; - }; - - /** - * Converts this AndroidKeySettings to JSON. - * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings - * @instance - * @returns {Object.} JSON object - */ - AndroidKeySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return AndroidKeySettings; - })(); - - v1beta1.IOSKeySettings = (function() { - - /** - * Properties of a IOSKeySettings. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @interface IIOSKeySettings - * @property {Array.|null} [allowedBundleIds] IOSKeySettings allowedBundleIds - */ - - /** - * Constructs a new IOSKeySettings. - * @memberof google.cloud.recaptchaenterprise.v1beta1 - * @classdesc Represents a IOSKeySettings. - * @implements IIOSKeySettings - * @constructor - * @param {google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings=} [properties] Properties to set - */ - function IOSKeySettings(properties) { - this.allowedBundleIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IOSKeySettings allowedBundleIds. - * @member {Array.} allowedBundleIds - * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings - * @instance - */ - IOSKeySettings.prototype.allowedBundleIds = $util.emptyArray; - - /** - * Creates a new IOSKeySettings instance using the specified properties. - * @function create - * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings} IOSKeySettings instance - */ - IOSKeySettings.create = function create(properties) { - return new IOSKeySettings(properties); - }; - - /** - * Encodes the specified IOSKeySettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings} message IOSKeySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IOSKeySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedBundleIds != null && message.allowedBundleIds.length) - for (var i = 0; i < message.allowedBundleIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedBundleIds[i]); - return writer; - }; - - /** - * Encodes the specified IOSKeySettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IIOSKeySettings} message IOSKeySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IOSKeySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a IOSKeySettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings} IOSKeySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IOSKeySettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.allowedBundleIds && message.allowedBundleIds.length)) - message.allowedBundleIds = []; - message.allowedBundleIds.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a IOSKeySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings} IOSKeySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IOSKeySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a IOSKeySettings message. - * @function verify - * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IOSKeySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedBundleIds != null && message.hasOwnProperty("allowedBundleIds")) { - if (!Array.isArray(message.allowedBundleIds)) - return "allowedBundleIds: array expected"; - for (var i = 0; i < message.allowedBundleIds.length; ++i) - if (!$util.isString(message.allowedBundleIds[i])) - return "allowedBundleIds: string[] expected"; - } - return null; - }; - - /** - * Creates a IOSKeySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings} IOSKeySettings - */ - IOSKeySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings) - return object; - var message = new $root.google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings(); - if (object.allowedBundleIds) { - if (!Array.isArray(object.allowedBundleIds)) - throw TypeError(".google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings.allowedBundleIds: array expected"); - message.allowedBundleIds = []; - for (var i = 0; i < object.allowedBundleIds.length; ++i) - message.allowedBundleIds[i] = String(object.allowedBundleIds[i]); - } - return message; - }; - - /** - * Creates a plain object from a IOSKeySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings - * @static - * @param {google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings} message IOSKeySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IOSKeySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedBundleIds = []; - if (message.allowedBundleIds && message.allowedBundleIds.length) { - object.allowedBundleIds = []; - for (var j = 0; j < message.allowedBundleIds.length; ++j) - object.allowedBundleIds[j] = message.allowedBundleIds[j]; - } - return object; - }; - - /** - * Converts this IOSKeySettings to JSON. - * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings - * @instance - * @returns {Object.} JSON object - */ - IOSKeySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IOSKeySettings; + return AccountDefenderAssessment; })(); return v1beta1; diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index d181a3bb919..6b0daf149de 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -1033,80 +1033,6 @@ "(google.api.method_signature)": "name,annotation" } ] - }, - "CreateKey": { - "requestType": "CreateKeyRequest", - "responseType": "Key", - "options": { - "(google.api.http).post": "/v1beta1/{parent=projects/*}/keys", - "(google.api.http).body": "key" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{parent=projects/*}/keys", - "body": "key" - } - } - ] - }, - "ListKeys": { - "requestType": "ListKeysRequest", - "responseType": "ListKeysResponse", - "options": { - "(google.api.http).get": "/v1beta1/{parent=projects/*}/keys" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{parent=projects/*}/keys" - } - } - ] - }, - "GetKey": { - "requestType": "GetKeyRequest", - "responseType": "Key", - "options": { - "(google.api.http).get": "/v1beta1/{name=projects/*/keys/*}" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{name=projects/*/keys/*}" - } - } - ] - }, - "UpdateKey": { - "requestType": "UpdateKeyRequest", - "responseType": "Key", - "options": { - "(google.api.http).patch": "/v1beta1/{key.name=projects/*/keys/*}", - "(google.api.http).body": "key" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta1/{key.name=projects/*/keys/*}", - "body": "key" - } - } - ] - }, - "DeleteKey": { - "requestType": "DeleteKeyRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta1/{name=projects/*/keys/*}" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta1/{name=projects/*/keys/*}" - } - } - ] } } }, @@ -1143,7 +1069,22 @@ "type": "Annotation", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "reasons": { + "rule": "repeated", + "type": "Reason", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hashedAccountId": { + "type": "bytes", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } }, @@ -1152,7 +1093,23 @@ "values": { "ANNOTATION_UNSPECIFIED": 0, "LEGITIMATE": 1, - "FRAUDULENT": 2 + "FRAUDULENT": 2, + "PASSWORD_CORRECT": 3, + "PASSWORD_INCORRECT": 4 + } + }, + "Reason": { + "values": { + "REASON_UNSPECIFIED": 0, + "CHARGEBACK": 1, + "CHARGEBACK_FRAUD": 8, + "CHARGEBACK_DISPUTE": 9, + "PAYMENT_HEURISTICS": 2, + "INITIATED_TWO_FACTOR": 7, + "PASSED_TWO_FACTOR": 3, + "FAILED_TWO_FACTOR": 4, + "CORRECT_PASSWORD": 5, + "INCORRECT_PASSWORD": 6 } } } @@ -1160,6 +1117,31 @@ "AnnotateAssessmentResponse": { "fields": {} }, + "PasswordLeakVerification": { + "fields": { + "hashedUserCredentials": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "credentialsLeaked": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "canonicalizedUsername": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "Assessment": { "options": { "(google.api.resource).type": "recaptchaenterprise.googleapis.com/Assessment", @@ -1198,6 +1180,14 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "passwordLeakVerification": { + "type": "PasswordLeakVerification", + "id": 7 + }, + "accountDefenderAssessment": { + "type": "AccountDefenderAssessment", + "id": 8 } }, "nested": { @@ -1249,6 +1239,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "hashedAccountId": { + "type": "bytes", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1284,211 +1281,31 @@ "EXPIRED": 3, "DUPE": 4, "SITE_MISMATCH": 5, - "MISSING": 6 - } - } - } - }, - "CreateKeyRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "key": { - "type": "Key", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" + "MISSING": 6, + "BROWSER_ERROR": 7 } } } }, - "ListKeysRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListKeysResponse": { - "fields": { - "keys": { - "rule": "repeated", - "type": "Key", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetKeyRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/Key" - } - } - } - }, - "UpdateKeyRequest": { - "fields": { - "key": { - "type": "Key", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteKeyRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/Key" - } - } - } - }, - "Key": { - "options": { - "(google.api.resource).type": "recaptchaenterprise.googleapis.com/Key", - "(google.api.resource).pattern": "projects/{project}/keys/{key}" - }, - "oneofs": { - "platformSettings": { - "oneof": [ - "webSettings", - "androidSettings", - "iosSettings" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - }, - "webSettings": { - "type": "WebKeySettings", - "id": 3 - }, - "androidSettings": { - "type": "AndroidKeySettings", - "id": 4 - }, - "iosSettings": { - "type": "IOSKeySettings", - "id": 5 - } - } - }, - "WebKeySettings": { + "AccountDefenderAssessment": { "fields": { - "enforceAllowedDomains": { - "type": "bool", - "id": 3 - }, - "allowedDomains": { + "labels": { "rule": "repeated", - "type": "string", + "type": "AccountDefenderLabel", "id": 1 - }, - "allowAmpTraffic": { - "type": "bool", - "id": 2 - }, - "integrationType": { - "type": "IntegrationType", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "challengeSecurityPreference": { - "type": "ChallengeSecurityPreference", - "id": 5 } }, "nested": { - "IntegrationType": { - "values": { - "INTEGRATION_TYPE_UNSPECIFIED": 0, - "SCORE_ONLY": 1, - "CHECKBOX_CHALLENGE": 2, - "INVISIBLE_CHALLENGE": 3 - } - }, - "ChallengeSecurityPreference": { + "AccountDefenderLabel": { "values": { - "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED": 0, - "USABILITY": 1, - "BALANCED": 2, - "SECURITY": 3 + "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED": 0, + "PROFILE_MATCH": 1, + "SUSPICIOUS_LOGIN_ACTIVITY": 2, + "SUSPICIOUS_ACCOUNT_CREATION": 3, + "RELATED_ACCOUNTS_NUMBER_HIGH": 4 } } } - }, - "AndroidKeySettings": { - "fields": { - "allowedPackageNames": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "IOSKeySettings": { - "fields": { - "allowedBundleIds": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } } } } diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js index f407558acd1..969aa7f414a 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js @@ -20,7 +20,7 @@ 'use strict'; -function main(name, annotation) { +function main(name) { // [START recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_AnnotateAssessment_async] /** * TODO(developer): Uncomment these variables before running the sample. @@ -31,9 +31,23 @@ function main(name, annotation) { */ // const name = 'abc123' /** - * Required. The annotation that will be assigned to the Event. + * Optional. The annotation that will be assigned to the Event. This field can be left + * empty to provide reasons that apply to an event without concluding whether + * the event is legitimate or fraudulent. */ // const annotation = {} + /** + * Optional. Optional reasons for the annotation that will be assigned to the Event. + */ + // const reasons = 1234 + /** + * Optional. Optional unique stable hashed user identifier to apply to the assessment. + * This is an alternative to setting the hashed_account_id in + * CreateAssessment, for example when the account identifier is not yet known + * in the initial request. It is recommended that the identifier is hashed + * using hmac-sha256 with stable secret. + */ + // const hashedAccountId = 'Buffer.from('string')' // Imports the Recaptchaenterprise library const {RecaptchaEnterpriseServiceV1Beta1Client} = require('@google-cloud/recaptcha-enterprise').v1beta1; @@ -45,7 +59,6 @@ function main(name, annotation) { // Construct request const request = { name, - annotation, }; // Run request diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json index 87d0c243c88..0cb6619f3de 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json @@ -66,7 +66,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 69, "type": "FULL" } ], @@ -82,232 +82,24 @@ { "name": "annotation", "type": ".google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse", - "client": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" - }, - "method": { - "shortName": "AnnotateAssessment", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.AnnotateAssessment", - "service": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateKey_async", - "title": "RecaptchaEnterpriseServiceV1Beta1 createKey Sample", - "origin": "API_DEFINITION", - "description": " Creates a new reCAPTCHA Enterprise key.", - "canonical": true, - "file": "recaptcha_enterprise_service_v1_beta1.create_key.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateKey", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateKey", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" }, { - "name": "key", - "type": ".google.cloud.recaptchaenterprise.v1beta1.Key" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1beta1.Key", - "client": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" - }, - "method": { - "shortName": "CreateKey", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.CreateKey", - "service": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_ListKeys_async", - "title": "RecaptchaEnterpriseServiceV1Beta1 listKeys Sample", - "origin": "API_DEFINITION", - "description": " Returns the list of all keys that belong to a project.", - "canonical": true, - "file": "recaptcha_enterprise_service_v1_beta1.list_keys.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListKeys", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.ListKeys", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" + "name": "reasons", + "type": "TYPE_ENUM[]" }, { - "name": "page_token", - "type": "TYPE_STRING" + "name": "hashed_account_id", + "type": "TYPE_BYTES" } ], - "resultType": ".google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse", - "client": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" - }, - "method": { - "shortName": "ListKeys", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.ListKeys", - "service": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_GetKey_async", - "title": "RecaptchaEnterpriseServiceV1Beta1 getKey Sample", - "origin": "API_DEFINITION", - "description": " Returns the specified key.", - "canonical": true, - "file": "recaptcha_enterprise_service_v1_beta1.get_key.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetKey", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.GetKey", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1beta1.Key", - "client": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" - }, - "method": { - "shortName": "GetKey", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.GetKey", - "service": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_UpdateKey_async", - "title": "RecaptchaEnterpriseServiceV1Beta1 updateKey Sample", - "origin": "API_DEFINITION", - "description": " Updates the specified key.", - "canonical": true, - "file": "recaptcha_enterprise_service_v1_beta1.update_key.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateKey", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.UpdateKey", - "async": true, - "parameters": [ - { - "name": "key", - "type": ".google.cloud.recaptchaenterprise.v1beta1.Key" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.recaptchaenterprise.v1beta1.Key", - "client": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" - }, - "method": { - "shortName": "UpdateKey", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.UpdateKey", - "service": { - "shortName": "RecaptchaEnterpriseServiceV1Beta1", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" - } - } - } - }, - { - "regionTag": "recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_DeleteKey_async", - "title": "RecaptchaEnterpriseServiceV1Beta1 deleteKey Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified key.", - "canonical": true, - "file": "recaptcha_enterprise_service_v1_beta1.delete_key.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteKey", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.DeleteKey", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", + "resultType": ".google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse", "client": { "shortName": "RecaptchaEnterpriseServiceV1Beta1Client", "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client" }, "method": { - "shortName": "DeleteKey", - "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.DeleteKey", + "shortName": "AnnotateAssessment", + "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1.AnnotateAssessment", "service": { "shortName": "RecaptchaEnterpriseServiceV1Beta1", "fullName": "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1" diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/gapic_metadata.json b/packages/google-cloud-recaptchaenterprise/src/v1beta1/gapic_metadata.json index 7a2089e9920..2a7ea778505 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/gapic_metadata.json +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/gapic_metadata.json @@ -19,33 +19,6 @@ "methods": [ "annotateAssessment" ] - }, - "CreateKey": { - "methods": [ - "createKey" - ] - }, - "GetKey": { - "methods": [ - "getKey" - ] - }, - "UpdateKey": { - "methods": [ - "updateKey" - ] - }, - "DeleteKey": { - "methods": [ - "deleteKey" - ] - }, - "ListKeys": { - "methods": [ - "listKeys", - "listKeysStream", - "listKeysAsync" - ] } } }, @@ -61,33 +34,6 @@ "methods": [ "annotateAssessment" ] - }, - "CreateKey": { - "methods": [ - "createKey" - ] - }, - "GetKey": { - "methods": [ - "getKey" - ] - }, - "UpdateKey": { - "methods": [ - "updateKey" - ] - }, - "DeleteKey": { - "methods": [ - "deleteKey" - ] - }, - "ListKeys": { - "methods": [ - "listKeys", - "listKeysStream", - "listKeysAsync" - ] } } } diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 972066d1811..1a2a4a3d781 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -18,17 +18,8 @@ /* global window */ import * as gax from 'google-gax'; -import { - Callback, - CallOptions, - Descriptors, - ClientOptions, - PaginationCallback, - GaxCall, -} from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} 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'); /** @@ -168,25 +159,11 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { assessmentPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/assessments/{assessment}' ), - keyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/keys/{key}' - ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), }; - // 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 = { - listKeys: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'keys' - ), - }; - // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1', @@ -240,11 +217,6 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { const recaptchaEnterpriseServiceV1Beta1StubMethods = [ 'createAssessment', 'annotateAssessment', - 'createKey', - 'listKeys', - 'getKey', - 'updateKey', - 'deleteKey', ]; for (const methodName of recaptchaEnterpriseServiceV1Beta1StubMethods) { const callPromise = this.recaptchaEnterpriseServiceV1Beta1Stub.then( @@ -261,7 +233,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { } ); - const descriptor = this.descriptors.page[methodName] || undefined; + const descriptor = undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -436,8 +408,18 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * @param {string} request.name * Required. The resource name of the Assessment, in the format * "projects/{project_number}/assessments/{assessment_id}". - * @param {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation} request.annotation - * Required. The annotation that will be assigned to the Event. + * @param {google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation} [request.annotation] + * Optional. The annotation that will be assigned to the Event. This field can be left + * empty to provide reasons that apply to an event without concluding whether + * the event is legitimate or fraudulent. + * @param {number[]} [request.reasons] + * Optional. Optional reasons for the annotation that will be assigned to the Event. + * @param {Buffer} [request.hashedAccountId] + * Optional. Optional unique stable hashed user identifier to apply to the assessment. + * This is an alternative to setting the hashed_account_id in + * CreateAssessment, for example when the account identifier is not yet known + * in the initial request. It is recommended that the identifier is hashed + * using hmac-sha256 with stable secret. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -528,601 +510,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { this.initialize(); return this.innerApiCalls.annotateAssessment(request, options, callback); } - /** - * Creates a new reCAPTCHA Enterprise key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project in which the key will be created, in the - * format "projects/{project_number}". - * @param {google.cloud.recaptchaenterprise.v1beta1.Key} request.key - * Required. Information to create a reCAPTCHA Enterprise key. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_key.js - * region_tag:recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateKey_async - */ - createKey( - request?: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest - | undefined - ), - {} | undefined - ] - >; - createKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; - createKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; - createKey( - request?: protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.ICreateKeyRequest - | 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.createKey(request, options, callback); - } - /** - * Returns the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the requested key, in the format - * "projects/{project_number}/keys/{key_id}". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.get_key.js - * region_tag:recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_GetKey_async - */ - getKey( - request?: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest - | undefined - ), - {} | undefined - ] - >; - getKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; - getKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; - getKey( - request?: protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.IGetKeyRequest - | 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.getKey(request, options, callback); - } - /** - * Updates the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.recaptchaenterprise.v1beta1.Key} request.key - * Required. The key to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The mask to control which field of the key get updated. If the mask is not - * present, all fields will be 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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.update_key.js - * region_tag:recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_UpdateKey_async - */ - updateKey( - request?: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest - | undefined - ), - {} | undefined - ] - >; - updateKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; - updateKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, - callback: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; - updateKey( - request?: protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.IUpdateKeyRequest - | 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({ - 'key.name': request.key!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateKey(request, options, callback); - } - /** - * Deletes the specified key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the key to be deleted, in the format - * "projects/{project_number}/keys/{key_id}". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.delete_key.js - * region_tag:recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_DeleteKey_async - */ - deleteKey( - request?: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest - | undefined - ), - {} | undefined - ] - >; - deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; - deleteKey( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest - | null - | undefined, - {} | null | undefined - > - ): void; - deleteKey( - request?: protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.protobuf.IEmpty, - ( - | protos.google.cloud.recaptchaenterprise.v1beta1.IDeleteKeyRequest - | 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.deleteKey(request, options, callback); - } - - /** - * Returns the list of all keys that belong to a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project that contains the keys that will be - * listed, in the format "projects/{project_number}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. - * 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 `listKeysAsync()` - * 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. - */ - listKeys( - request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey[], - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse - ] - >; - listKeys( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1beta1.IKey - > - ): void; - listKeys( - request: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - callback: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1beta1.IKey - > - ): void; - listKeys( - request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1beta1.IKey - >, - callback?: PaginationCallback< - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - | protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse - | null - | undefined, - protos.google.cloud.recaptchaenterprise.v1beta1.IKey - > - ): Promise< - [ - protos.google.cloud.recaptchaenterprise.v1beta1.IKey[], - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest | null, - protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysResponse - ] - > | 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.listKeys(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 name of the project that contains the keys that will be - * listed, in the format "projects/{project_number}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @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 [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} 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 `listKeysAsync()` - * 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. - */ - listKeysStream( - request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - options?: CallOptions - ): Transform { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - parent: request.parent || '', - }); - const defaultCallSettings = this._defaults['listKeys']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listKeys.createStream( - this.innerApiCalls.listKeys as gax.GaxCall, - request, - callSettings - ); - } - - /** - * Equivalent to `listKeys`, 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 name of the project that contains the keys that will be - * listed, in the format "projects/{project_number}". - * @param {number} [request.pageSize] - * Optional. The maximum number of keys to return. Default is 10. Max limit is - * 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous. - * ListKeysRequest, if any. - * @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 - * [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.list_keys.js - * region_tag:recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_ListKeys_async - */ - listKeysAsync( - request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, - 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 || '', - }); - const defaultCallSettings = this._defaults['listKeys']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listKeys.asyncIterate( - this.innerApiCalls['listKeys'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } // -------------------- // -- Path templates -- // -------------------- @@ -1165,42 +553,6 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { .assessment; } - /** - * Return a fully-qualified key resource name string. - * - * @param {string} project - * @param {string} key - * @returns {string} Resource name string. - */ - keyPath(project: string, key: string) { - return this.pathTemplates.keyPathTemplate.render({ - project: project, - key: key, - }); - } - - /** - * Parse the project from Key resource. - * - * @param {string} keyName - * A fully-qualified path representing Key resource. - * @returns {string} A string representing the project. - */ - matchProjectFromKeyName(keyName: string) { - return this.pathTemplates.keyPathTemplate.match(keyName).project; - } - - /** - * Parse the key from Key resource. - * - * @param {string} keyName - * A fully-qualified path representing Key resource. - * @returns {string} A string representing the key. - */ - matchKeyFromKeyName(keyName: string) { - return this.pathTemplates.keyPathTemplate.match(keyName).key; - } - /** * Return a fully-qualified project resource name string. * diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json index 726aae13003..7907ebe8f8e 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client_config.json @@ -29,31 +29,6 @@ "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" - }, - "CreateKey": { - "timeout_millis": 600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListKeys": { - "timeout_millis": 600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetKey": { - "timeout_millis": 600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateKey": { - "timeout_millis": 600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteKey": { - "timeout_millis": 600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" } } } diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts index 841d5773b4c..0e49aad21a6 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts @@ -23,8 +23,6 @@ import {SinonStub} from 'sinon'; import {describe, it} from 'mocha'; import * as recaptchaenterpriseservicev1beta1Module from '../src'; -import {PassThrough} from 'stream'; - import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { @@ -51,67 +49,6 @@ function stubSimpleCallWithCallback( : sinon.stub().callsArgWith(2, null, response); } -function stubPageStreamingCall( - responses?: ResponseType[], - error?: Error -) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error - ? sinon.stub().callsArgWith(2, error) - : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { - mockStream.write({}); - }); - } - setImmediate(() => { - mockStream.end(); - }); - } else { - setImmediate(() => { - mockStream.write({}); - }); - setImmediate(() => { - mockStream.end(); - }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall( - responses?: ResponseType[], - error?: Error -) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - }, - }; - }, - }; - return sinon.stub().returns(asyncIterable); -} - describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { it('has servicePath', () => { const servicePath = @@ -510,143 +447,13 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); }); - describe('createKey', () => { - it('invokes createKey without error', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ); - client.innerApiCalls.createKey = stubSimpleCall(expectedResponse); - const [response] = await client.createKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes createKey without error using callback', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ); - client.innerApiCalls.createKey = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createKey( - request, - ( - err?: Error | null, - result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); - - it('invokes createKey with error', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, + describe('Path templates', () => { + describe('assessment', () => { + const fakePath = '/rendered/path/assessment'; + const expectedParameters = { + project: 'projectValue', + assessment: 'assessmentValue', }; - const expectedError = new Error('expected'); - client.innerApiCalls.createKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createKey(request), expectedError); - assert( - (client.innerApiCalls.createKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes createKey with closed client', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest() - ); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createKey(request), expectedError); - }); - }); - - describe('getKey', () => { - it('invokes getKey without error', async () => { const client = new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( { @@ -655,773 +462,32 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { } ); client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ); - client.innerApiCalls.getKey = stubSimpleCall(expectedResponse); - const [response] = await client.getKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + client.pathTemplates.assessmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assessmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); - it('invokes getKey without error using callback', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ); - client.innerApiCalls.getKey = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getKey( - request, - ( - err?: Error | null, - result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } + it('assessmentPath', () => { + const result = client.assessmentPath('projectValue', 'assessmentValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assessmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) ); }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); - it('invokes getKey with error', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } + it('matchProjectFromAssessmentName', () => { + const result = client.matchProjectFromAssessmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.assessmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getKey(request), expectedError); - assert( - (client.innerApiCalls.getKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes getKey with closed client', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest() - ); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getKey(request), expectedError); - }); - }); - - describe('updateKey', () => { - it('invokes updateKey without error', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() - ); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = 'key.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ); - client.innerApiCalls.updateKey = stubSimpleCall(expectedResponse); - const [response] = await client.updateKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes updateKey without error using callback', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() - ); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = 'key.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ); - client.innerApiCalls.updateKey = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateKey( - request, - ( - err?: Error | null, - result?: protos.google.cloud.recaptchaenterprise.v1beta1.IKey | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); - - it('invokes updateKey with error', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() - ); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = 'key.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateKey(request), expectedError); - assert( - (client.innerApiCalls.updateKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes updateKey with closed client', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest() - ); - request.key = {}; - request.key.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateKey(request), expectedError); - }); - }); - - describe('deleteKey', () => { - it('invokes deleteKey without error', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteKey = stubSimpleCall(expectedResponse); - const [response] = await client.deleteKey(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes deleteKey without error using callback', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteKey = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteKey( - request, - ( - err?: Error | null, - result?: protos.google.protobuf.IEmpty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); - - it('invokes deleteKey with error', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteKey = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteKey(request), expectedError); - assert( - (client.innerApiCalls.deleteKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes deleteKey with closed client', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest() - ); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteKey(request), expectedError); - }); - }); - - describe('listKeys', () => { - it('invokes listKeys without error', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - ]; - client.innerApiCalls.listKeys = stubSimpleCall(expectedResponse); - const [response] = await client.listKeys(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listKeys as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes listKeys without error using callback', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - ]; - client.innerApiCalls.listKeys = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listKeys( - request, - ( - err?: Error | null, - result?: - | protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] - | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listKeys as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); - - it('invokes listKeys with error', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listKeys(request), expectedError); - assert( - (client.innerApiCalls.listKeys as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes listKeysStream without error', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - ]; - client.descriptors.page.listKeys.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listKeysStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = - []; - stream.on( - 'data', - (response: protos.google.cloud.recaptchaenterprise.v1beta1.Key) => { - 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.listKeys.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listKeys, request) - ); - assert.strictEqual( - (client.descriptors.page.listKeys.createStream as SinonStub).getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listKeysStream with error', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedError = new Error('expected'); - client.descriptors.page.listKeys.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listKeysStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.Key[] = - []; - stream.on( - 'data', - (response: protos.google.cloud.recaptchaenterprise.v1beta1.Key) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listKeys.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listKeys, request) - ); - assert.strictEqual( - (client.descriptors.page.listKeys.createStream as SinonStub).getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listKeys without error', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.Key() - ), - ]; - client.descriptors.page.listKeys.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = - []; - const iterable = client.listKeysAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) - .args[1], - request - ); - assert.strictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listKeys with error', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedError = new Error('expected'); - client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listKeysAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.recaptchaenterprise.v1beta1.IKey[] = - []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) - .args[1], - request - ); - assert.strictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - describe('assessment', () => { - const fakePath = '/rendered/path/assessment'; - const expectedParameters = { - project: 'projectValue', - assessment: 'assessmentValue', - }; - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - client.pathTemplates.assessmentPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.assessmentPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('assessmentPath', () => { - const result = client.assessmentPath('projectValue', 'assessmentValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.assessmentPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); - - it('matchProjectFromAssessmentName', () => { - const result = client.matchProjectFromAssessmentName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.assessmentPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); + }); it('matchAssessmentFromAssessmentName', () => { const result = client.matchAssessmentFromAssessmentName(fakePath); @@ -1434,58 +500,6 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); }); - describe('key', () => { - const fakePath = '/rendered/path/key'; - const expectedParameters = { - project: 'projectValue', - key: 'keyValue', - }; - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - client.pathTemplates.keyPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.keyPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('keyPath', () => { - const result = client.keyPath('projectValue', 'keyValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.keyPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); - - it('matchProjectFromKeyName', () => { - const result = client.matchProjectFromKeyName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.keyPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchKeyFromKeyName', () => { - const result = client.matchKeyFromKeyName(fakePath); - assert.strictEqual(result, 'keyValue'); - assert( - (client.pathTemplates.keyPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); - describe('project', () => { const fakePath = '/rendered/path/project'; const expectedParameters = { From 7878e3c0610db44a5c309522ee24d455386ed8aa Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 3 May 2022 02:34:17 +0200 Subject: [PATCH 222/253] chore(deps): update dependency @types/mocha to v9 (#368) 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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 0ee384eb44d..e22cc9506c7 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -28,7 +28,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.0.0", From f88ffe3b504949f3e92dcf9cdef3a01c7d3d28a6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 May 2022 17:44:29 +0200 Subject: [PATCH 223/253] chore(deps): update dependency sinon to v14 (#372) 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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index e22cc9506c7..83a2f261dbd 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -40,7 +40,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 e4335de67024c85791a112ebf5475b49fa21402a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 11 May 2022 18:10:39 -0400 Subject: [PATCH 224/253] fix!: rename parent to project in SearchRelatedAccountGroupMembershipsRequest (#370) fix!: rename parent to project in SearchRelatedAccountGroupMembershipsRequest feat: introduced WafSettings PiperOrigin-RevId: 446496512 Source-Link: https://github.com/googleapis/googleapis/commit/63d4fbab332b66071ebfb06ad6c0d682271962d1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f168b29e44d1d09bc407e8ef09587b7c8fcfe622 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjE2OGIyOWU0NGQxZDA5YmM0MDdlOGVmMDk1ODdiN2M4ZmNmZTYyMiJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../v1/recaptchaenterprise.proto | 57 ++- .../protos/protos.d.ts | 127 ++++++- .../protos/protos.js | 335 +++++++++++++++++- .../protos/protos.json | 48 ++- ...earch_related_account_group_memberships.js | 6 +- ...a.google.cloud.recaptchaenterprise.v1.json | 2 +- .../v1/recaptcha_enterprise_service_client.ts | 12 +- .../gapic_recaptcha_enterprise_service_v1.ts | 28 +- 8 files changed, 558 insertions(+), 57 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index 1be736a6b39..7cf8073270a 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -135,10 +135,10 @@ service RecaptchaEnterpriseService { // Search group memberships related to a given account. rpc SearchRelatedAccountGroupMemberships(SearchRelatedAccountGroupMembershipsRequest) returns (SearchRelatedAccountGroupMembershipsResponse) { option (google.api.http) = { - post: "/v1/{parent=projects/*}/relatedaccountgroupmemberships:search" + post: "/v1/{project=projects/*}/relatedaccountgroupmemberships:search" body: "*" }; - option (google.api.method_signature) = "parent,hashed_account_id"; + option (google.api.method_signature) = "project,hashed_account_id"; } } @@ -186,18 +186,18 @@ message AnnotateAssessmentRequest { // Default unspecified reason. REASON_UNSPECIFIED = 0; - // Indicates a chargeback was issued for the transaction associated with the - // assessment, with no other details. When possible, specify the type by - // using CHARGEBACK_FRAUD or CHARGEBACK_DISPUTE instead. + // Indicates a chargeback issued for the transaction with no other details. + // When possible, specify the type by using CHARGEBACK_FRAUD or + // CHARGEBACK_DISPUTE instead. CHARGEBACK = 1; // Indicates a chargeback related to an alleged unauthorized transaction - // from the perspective of the cardholder (for example, the card number was + // from the cardholder's perspective (for example, the card number was // stolen). CHARGEBACK_FRAUD = 8; // Indicates a chargeback related to the cardholder having provided their - // card but allegedly not being satisfied with the purchase + // card details but allegedly not being satisfied with the purchase // (for example, misrepresentation, attempted cancellation). CHARGEBACK_DISPUTE = 9; @@ -578,6 +578,9 @@ message Key { // Options for user acceptance testing. TestingOptions testing_options = 9; + + // Settings for WAF + WafSettings waf_settings = 10; } // Options for user acceptance testing. @@ -802,7 +805,7 @@ message ListRelatedAccountGroupsResponse { message SearchRelatedAccountGroupMembershipsRequest { // Required. The name of the project to search related account group memberships from, // in the format "projects/{project}". - string parent = 1 [ + string project = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { child_type: "recaptchaenterprise.googleapis.com/RelatedAccountGroupMembership" @@ -878,3 +881,39 @@ message RelatedAccountGroup { } ]; } + +// Settings specific to keys that can be used for WAF (Web Application +// Firewall). +message WafSettings { + // Supported WAF features. For more information, see + // https://cloud.google.com/recaptcha-enterprise/docs/usecase#comparison_of_features. + enum WafFeature { + // Undefined feature. + WAF_FEATURE_UNSPECIFIED = 0; + + // Redirects suspicious traffic to reCAPTCHA. + CHALLENGE_PAGE = 1; + + // Use reCAPTCHA session-tokens to protect the whole user session on the + // site's domain. + SESSION_TOKEN = 2; + + // Use reCAPTCHA action-tokens to protect user actions. + ACTION_TOKEN = 3; + } + + // Web Application Firewalls supported by reCAPTCHA Enterprise. + enum WafService { + // Undefined WAF + WAF_SERVICE_UNSPECIFIED = 0; + + // Cloud Armor + CA = 1; + } + + // Required. The WAF service that uses this key. + WafService waf_service = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The WAF feature for which this key is enabled. + WafFeature waf_feature = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index ab69c80f3f7..8f8090dd336 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -2073,6 +2073,9 @@ export namespace google { /** Key testingOptions */ testingOptions?: (google.cloud.recaptchaenterprise.v1.ITestingOptions|null); + + /** Key wafSettings */ + wafSettings?: (google.cloud.recaptchaenterprise.v1.IWafSettings|null); } /** Represents a Key. */ @@ -2108,6 +2111,9 @@ export namespace google { /** Key testingOptions. */ public testingOptions?: (google.cloud.recaptchaenterprise.v1.ITestingOptions|null); + /** Key wafSettings. */ + public wafSettings?: (google.cloud.recaptchaenterprise.v1.IWafSettings|null); + /** Key platformSettings. */ public platformSettings?: ("webSettings"|"androidSettings"|"iosSettings"); @@ -3306,8 +3312,8 @@ export namespace google { /** Properties of a SearchRelatedAccountGroupMembershipsRequest. */ interface ISearchRelatedAccountGroupMembershipsRequest { - /** SearchRelatedAccountGroupMembershipsRequest parent */ - parent?: (string|null); + /** SearchRelatedAccountGroupMembershipsRequest project */ + project?: (string|null); /** SearchRelatedAccountGroupMembershipsRequest hashedAccountId */ hashedAccountId?: (Uint8Array|string|null); @@ -3328,8 +3334,8 @@ export namespace google { */ constructor(properties?: google.cloud.recaptchaenterprise.v1.ISearchRelatedAccountGroupMembershipsRequest); - /** SearchRelatedAccountGroupMembershipsRequest parent. */ - public parent: string; + /** SearchRelatedAccountGroupMembershipsRequest project. */ + public project: string; /** SearchRelatedAccountGroupMembershipsRequest hashedAccountId. */ public hashedAccountId: (Uint8Array|string); @@ -3692,6 +3698,119 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Properties of a WafSettings. */ + interface IWafSettings { + + /** WafSettings wafService */ + wafService?: (google.cloud.recaptchaenterprise.v1.WafSettings.WafService|keyof typeof google.cloud.recaptchaenterprise.v1.WafSettings.WafService|null); + + /** WafSettings wafFeature */ + wafFeature?: (google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature|keyof typeof google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature|null); + } + + /** Represents a WafSettings. */ + class WafSettings implements IWafSettings { + + /** + * Constructs a new WafSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IWafSettings); + + /** WafSettings wafService. */ + public wafService: (google.cloud.recaptchaenterprise.v1.WafSettings.WafService|keyof typeof google.cloud.recaptchaenterprise.v1.WafSettings.WafService); + + /** WafSettings wafFeature. */ + public wafFeature: (google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature|keyof typeof google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature); + + /** + * Creates a new WafSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns WafSettings instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IWafSettings): google.cloud.recaptchaenterprise.v1.WafSettings; + + /** + * Encodes the specified WafSettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WafSettings.verify|verify} messages. + * @param message WafSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IWafSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WafSettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WafSettings.verify|verify} messages. + * @param message WafSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IWafSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WafSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WafSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.WafSettings; + + /** + * Decodes a WafSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WafSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.WafSettings; + + /** + * Verifies a WafSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WafSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WafSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.WafSettings; + + /** + * Creates a plain object from a WafSettings message. Also converts values to other types if specified. + * @param message WafSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.WafSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WafSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace WafSettings { + + /** WafFeature enum. */ + enum WafFeature { + WAF_FEATURE_UNSPECIFIED = 0, + CHALLENGE_PAGE = 1, + SESSION_TOKEN = 2, + ACTION_TOKEN = 3 + } + + /** WafService enum. */ + enum WafService { + WAF_SERVICE_UNSPECIFIED = 0, + CA = 1 + } + } } /** Namespace v1beta1. */ diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index b798ec91426..ee437801e51 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -4754,6 +4754,7 @@ * @property {Object.|null} [labels] Key labels * @property {google.protobuf.ITimestamp|null} [createTime] Key createTime * @property {google.cloud.recaptchaenterprise.v1.ITestingOptions|null} [testingOptions] Key testingOptions + * @property {google.cloud.recaptchaenterprise.v1.IWafSettings|null} [wafSettings] Key wafSettings */ /** @@ -4836,6 +4837,14 @@ */ Key.prototype.testingOptions = null; + /** + * Key wafSettings. + * @member {google.cloud.recaptchaenterprise.v1.IWafSettings|null|undefined} wafSettings + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @instance + */ + Key.prototype.wafSettings = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -4891,6 +4900,8 @@ $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.testingOptions != null && Object.hasOwnProperty.call(message, "testingOptions")) $root.google.cloud.recaptchaenterprise.v1.TestingOptions.encode(message.testingOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.wafSettings != null && Object.hasOwnProperty.call(message, "wafSettings")) + $root.google.cloud.recaptchaenterprise.v1.WafSettings.encode(message.wafSettings, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -4968,6 +4979,9 @@ case 9: message.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.decode(reader, reader.uint32()); break; + case 10: + message.wafSettings = $root.google.cloud.recaptchaenterprise.v1.WafSettings.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -5056,6 +5070,11 @@ if (error) return "testingOptions." + error; } + if (message.wafSettings != null && message.hasOwnProperty("wafSettings")) { + var error = $root.google.cloud.recaptchaenterprise.v1.WafSettings.verify(message.wafSettings); + if (error) + return "wafSettings." + error; + } return null; }; @@ -5107,6 +5126,11 @@ throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.testingOptions: object expected"); message.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.fromObject(object.testingOptions); } + if (object.wafSettings != null) { + if (typeof object.wafSettings !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Key.wafSettings: object expected"); + message.wafSettings = $root.google.cloud.recaptchaenterprise.v1.WafSettings.fromObject(object.wafSettings); + } return message; }; @@ -5130,6 +5154,7 @@ object.displayName = ""; object.createTime = null; object.testingOptions = null; + object.wafSettings = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -5160,6 +5185,8 @@ object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.testingOptions != null && message.hasOwnProperty("testingOptions")) object.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.toObject(message.testingOptions, options); + if (message.wafSettings != null && message.hasOwnProperty("wafSettings")) + object.wafSettings = $root.google.cloud.recaptchaenterprise.v1.WafSettings.toObject(message.wafSettings, options); return object; }; @@ -7982,7 +8009,7 @@ * Properties of a SearchRelatedAccountGroupMembershipsRequest. * @memberof google.cloud.recaptchaenterprise.v1 * @interface ISearchRelatedAccountGroupMembershipsRequest - * @property {string|null} [parent] SearchRelatedAccountGroupMembershipsRequest parent + * @property {string|null} [project] SearchRelatedAccountGroupMembershipsRequest project * @property {Uint8Array|null} [hashedAccountId] SearchRelatedAccountGroupMembershipsRequest hashedAccountId * @property {number|null} [pageSize] SearchRelatedAccountGroupMembershipsRequest pageSize * @property {string|null} [pageToken] SearchRelatedAccountGroupMembershipsRequest pageToken @@ -8004,12 +8031,12 @@ } /** - * SearchRelatedAccountGroupMembershipsRequest parent. - * @member {string} parent + * SearchRelatedAccountGroupMembershipsRequest project. + * @member {string} project * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest * @instance */ - SearchRelatedAccountGroupMembershipsRequest.prototype.parent = ""; + SearchRelatedAccountGroupMembershipsRequest.prototype.project = ""; /** * SearchRelatedAccountGroupMembershipsRequest hashedAccountId. @@ -8059,8 +8086,8 @@ SearchRelatedAccountGroupMembershipsRequest.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.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); if (message.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hashedAccountId); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -8102,7 +8129,7 @@ var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.project = reader.string(); break; case 2: message.hashedAccountId = reader.bytes(); @@ -8148,9 +8175,9 @@ SearchRelatedAccountGroupMembershipsRequest.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.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) return "hashedAccountId: buffer expected"; @@ -8175,8 +8202,8 @@ if (object instanceof $root.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest) return object; var message = new $root.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest(); - if (object.parent != null) - message.parent = String(object.parent); + if (object.project != null) + message.project = String(object.project); if (object.hashedAccountId != null) if (typeof object.hashedAccountId === "string") $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); @@ -8203,7 +8230,7 @@ options = {}; var object = {}; if (options.defaults) { - object.parent = ""; + object.project = ""; if (options.bytes === String) object.hashedAccountId = ""; else { @@ -8214,8 +8241,8 @@ object.pageSize = 0; object.pageToken = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; if (message.pageSize != null && message.hasOwnProperty("pageSize")) @@ -8876,6 +8903,284 @@ return RelatedAccountGroup; })(); + v1.WafSettings = (function() { + + /** + * Properties of a WafSettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IWafSettings + * @property {google.cloud.recaptchaenterprise.v1.WafSettings.WafService|null} [wafService] WafSettings wafService + * @property {google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature|null} [wafFeature] WafSettings wafFeature + */ + + /** + * Constructs a new WafSettings. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a WafSettings. + * @implements IWafSettings + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IWafSettings=} [properties] Properties to set + */ + function WafSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WafSettings wafService. + * @member {google.cloud.recaptchaenterprise.v1.WafSettings.WafService} wafService + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @instance + */ + WafSettings.prototype.wafService = 0; + + /** + * WafSettings wafFeature. + * @member {google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature} wafFeature + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @instance + */ + WafSettings.prototype.wafFeature = 0; + + /** + * Creates a new WafSettings instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IWafSettings=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.WafSettings} WafSettings instance + */ + WafSettings.create = function create(properties) { + return new WafSettings(properties); + }; + + /** + * Encodes the specified WafSettings message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WafSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IWafSettings} message WafSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WafSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.wafService != null && Object.hasOwnProperty.call(message, "wafService")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.wafService); + if (message.wafFeature != null && Object.hasOwnProperty.call(message, "wafFeature")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.wafFeature); + return writer; + }; + + /** + * Encodes the specified WafSettings message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.WafSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.IWafSettings} message WafSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WafSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WafSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.WafSettings} WafSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WafSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.WafSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.wafService = reader.int32(); + break; + case 2: + message.wafFeature = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WafSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.WafSettings} WafSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WafSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WafSettings message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WafSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.wafService != null && message.hasOwnProperty("wafService")) + switch (message.wafService) { + default: + return "wafService: enum value expected"; + case 0: + case 1: + break; + } + if (message.wafFeature != null && message.hasOwnProperty("wafFeature")) + switch (message.wafFeature) { + default: + return "wafFeature: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a WafSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.WafSettings} WafSettings + */ + WafSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.WafSettings) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.WafSettings(); + switch (object.wafService) { + case "WAF_SERVICE_UNSPECIFIED": + case 0: + message.wafService = 0; + break; + case "CA": + case 1: + message.wafService = 1; + break; + } + switch (object.wafFeature) { + case "WAF_FEATURE_UNSPECIFIED": + case 0: + message.wafFeature = 0; + break; + case "CHALLENGE_PAGE": + case 1: + message.wafFeature = 1; + break; + case "SESSION_TOKEN": + case 2: + message.wafFeature = 2; + break; + case "ACTION_TOKEN": + case 3: + message.wafFeature = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a WafSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @static + * @param {google.cloud.recaptchaenterprise.v1.WafSettings} message WafSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WafSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.wafService = options.enums === String ? "WAF_SERVICE_UNSPECIFIED" : 0; + object.wafFeature = options.enums === String ? "WAF_FEATURE_UNSPECIFIED" : 0; + } + if (message.wafService != null && message.hasOwnProperty("wafService")) + object.wafService = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WafSettings.WafService[message.wafService] : message.wafService; + if (message.wafFeature != null && message.hasOwnProperty("wafFeature")) + object.wafFeature = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature[message.wafFeature] : message.wafFeature; + return object; + }; + + /** + * Converts this WafSettings to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @instance + * @returns {Object.} JSON object + */ + WafSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * WafFeature enum. + * @name google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature + * @enum {number} + * @property {number} WAF_FEATURE_UNSPECIFIED=0 WAF_FEATURE_UNSPECIFIED value + * @property {number} CHALLENGE_PAGE=1 CHALLENGE_PAGE value + * @property {number} SESSION_TOKEN=2 SESSION_TOKEN value + * @property {number} ACTION_TOKEN=3 ACTION_TOKEN value + */ + WafSettings.WafFeature = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WAF_FEATURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CHALLENGE_PAGE"] = 1; + values[valuesById[2] = "SESSION_TOKEN"] = 2; + values[valuesById[3] = "ACTION_TOKEN"] = 3; + return values; + })(); + + /** + * WafService enum. + * @name google.cloud.recaptchaenterprise.v1.WafSettings.WafService + * @enum {number} + * @property {number} WAF_SERVICE_UNSPECIFIED=0 WAF_SERVICE_UNSPECIFIED value + * @property {number} CA=1 CA value + */ + WafSettings.WafService = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WAF_SERVICE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CA"] = 1; + return values; + })(); + + return WafSettings; + })(); + return v1; })(); diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index 6b0daf149de..cc2b5b071cf 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -212,19 +212,19 @@ "requestType": "SearchRelatedAccountGroupMembershipsRequest", "responseType": "SearchRelatedAccountGroupMembershipsResponse", "options": { - "(google.api.http).post": "/v1/{parent=projects/*}/relatedaccountgroupmemberships:search", + "(google.api.http).post": "/v1/{project=projects/*}/relatedaccountgroupmemberships:search", "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,hashed_account_id" + "(google.api.method_signature)": "project,hashed_account_id" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1/{parent=projects/*}/relatedaccountgroupmemberships:search", + "post": "/v1/{project=projects/*}/relatedaccountgroupmemberships:search", "body": "*" } }, { - "(google.api.method_signature)": "parent,hashed_account_id" + "(google.api.method_signature)": "project,hashed_account_id" } ] } @@ -676,6 +676,10 @@ "testingOptions": { "type": "TestingOptions", "id": 9 + }, + "wafSettings": { + "type": "WafSettings", + "id": 10 } } }, @@ -894,7 +898,7 @@ }, "SearchRelatedAccountGroupMembershipsRequest": { "fields": { - "parent": { + "project": { "type": "string", "id": 1, "options": { @@ -973,6 +977,40 @@ } } } + }, + "WafSettings": { + "fields": { + "wafService": { + "type": "WafService", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "wafFeature": { + "type": "WafFeature", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "WafFeature": { + "values": { + "WAF_FEATURE_UNSPECIFIED": 0, + "CHALLENGE_PAGE": 1, + "SESSION_TOKEN": 2, + "ACTION_TOKEN": 3 + } + }, + "WafService": { + "values": { + "WAF_SERVICE_UNSPECIFIED": 0, + "CA": 1 + } + } + } } } }, diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js index 4c02dc44a00..863ac5b2d36 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js @@ -20,7 +20,7 @@ 'use strict'; -function main(parent) { +function main(project) { // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_async] /** * TODO(developer): Uncomment these variables before running the sample. @@ -29,7 +29,7 @@ function main(parent) { * Required. The name of the project to search related account group memberships from, * in the format "projects/{project}". */ - // const parent = 'abc123' + // const project = 'my-project' /** * Optional. The unique stable hashed user identifier we should search connections to. * The identifier should correspond to a `hashed_account_id` provided in a @@ -62,7 +62,7 @@ function main(parent) { async function callSearchRelatedAccountGroupMemberships() { // Construct request const request = { - parent, + project, }; // Run request diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index 4427fd0d82f..578b6b467f6 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -520,7 +520,7 @@ "async": true, "parameters": [ { - "name": "parent", + "name": "project", "type": "TYPE_STRING" }, { diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index c0be33b64f8..b4ed5ed0c59 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -1776,7 +1776,7 @@ export class RecaptchaEnterpriseServiceClient { * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent + * @param {string} request.project * Required. The name of the project to search related account group memberships from, * in the format "projects/{project}". * @param {Buffer} [request.hashedAccountId] @@ -1878,7 +1878,7 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ - parent: request.parent || '', + project: request.project || '', }); this.initialize(); return this.innerApiCalls.searchRelatedAccountGroupMemberships( @@ -1892,7 +1892,7 @@ export class RecaptchaEnterpriseServiceClient { * 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 + * @param {string} request.project * Required. The name of the project to search related account group memberships from, * in the format "projects/{project}". * @param {Buffer} [request.hashedAccountId] @@ -1934,7 +1934,7 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ - parent: request.parent || '', + project: request.project || '', }); const defaultCallSettings = this._defaults['searchRelatedAccountGroupMemberships']; @@ -1953,7 +1953,7 @@ export class RecaptchaEnterpriseServiceClient { * `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 + * @param {string} request.project * Required. The name of the project to search related account group memberships from, * in the format "projects/{project}". * @param {Buffer} [request.hashedAccountId] @@ -1996,7 +1996,7 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ - parent: request.parent || '', + project: request.project || '', }); const defaultCallSettings = this._defaults['searchRelatedAccountGroupMemberships']; diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index 3f4a9577491..eb80d9146c0 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -2363,8 +2363,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.project = ''; + const expectedHeaderRequestParams = 'project='; const expectedOptions = { otherArgs: { headers: { @@ -2408,8 +2408,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.project = ''; + const expectedHeaderRequestParams = 'project='; const expectedOptions = { otherArgs: { headers: { @@ -2468,8 +2468,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.project = ''; + const expectedHeaderRequestParams = 'project='; const expectedOptions = { otherArgs: { headers: { @@ -2503,8 +2503,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.project = ''; + const expectedHeaderRequestParams = 'project='; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() @@ -2571,8 +2571,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.project = ''; + const expectedHeaderRequestParams = 'project='; const expectedError = new Error('expected'); client.descriptors.page.searchRelatedAccountGroupMemberships.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2628,8 +2628,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.project = ''; + const expectedHeaderRequestParams = 'project='; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() @@ -2679,8 +2679,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.project = ''; + const expectedHeaderRequestParams = 'project='; const expectedError = new Error('expected'); client.descriptors.page.searchRelatedAccountGroupMemberships.asyncIterate = stubAsyncIterationCall(undefined, expectedError); From 24b1643b219624ac8d23000a6f9c612638d871e4 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 16 May 2022 17:38:34 -0700 Subject: [PATCH 225/253] build!: update library to use Node 12 (#374) 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-recaptchaenterprise/package.json | 10 +++++----- .../samples/package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 83a2f261dbd..5863f84d0fd 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -25,24 +25,24 @@ "reCAPTCHA Enterprise API" ], "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.0.0", - "gts": "^3.0.0", + "gts": "^3.1.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^2.0.0", - "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" }, @@ -64,6 +64,6 @@ }, "license": "Apache-2.0", "engines": { - "node": ">=10" + "node": ">=12.0.0" } } diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 73d9c3115f4..33d1827aa29 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "files": [ "*.js" From 12099caba69f0b3b16021fe4b40ce602e693a393 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 17 May 2022 17:08:32 -0700 Subject: [PATCH 226/253] feat: Add support for Password Check through the private_password_leak_verification field in the reCAPTCHA Assessment (#376) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add support for Password Check through the private_password_leak_verification field in the reCAPTCHA Assessment PiperOrigin-RevId: 449202953 Source-Link: https://github.com/googleapis/googleapis/commit/e2ed48f522fa5ca5f2d9c5eaf93b0b6e90cdc6a8 Source-Link: https://github.com/googleapis/googleapis-gen/commit/82f55ea1435da6d69c8ceb0a33f863d1fd6a484e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODJmNTVlYTE0MzVkYTZkNjljOGNlYjBhMzNmODYzZDFmZDZhNDg0ZSJ9 * 🦉 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 --- .../v1/recaptchaenterprise.proto | 137 +++++--- .../protos/protos.d.ts | 114 ++++++ .../protos/protos.js | 328 ++++++++++++++++++ .../protos/protos.json | 37 ++ ..._enterprise_service.annotate_assessment.js | 13 +- ....list_related_account_group_memberships.js | 12 +- ...ise_service.list_related_account_groups.js | 13 +- ...earch_related_account_group_memberships.js | 15 +- ...recaptcha_enterprise_service.update_key.js | 4 +- ...a.google.cloud.recaptchaenterprise.v1.json | 6 +- .../v1/recaptcha_enterprise_service_client.ts | 137 ++++---- 11 files changed, 662 insertions(+), 154 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index 7cf8073270a..0169ebbd382 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -36,7 +36,8 @@ option ruby_package = "Google::Cloud::RecaptchaEnterprise::V1"; // Service to determine the likelihood an event is legitimate. service RecaptchaEnterpriseService { option (google.api.default_host) = "recaptchaenterprise.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Creates an Assessment of the likelihood an event is legitimate. rpc CreateAssessment(CreateAssessmentRequest) returns (Assessment) { @@ -49,7 +50,8 @@ service RecaptchaEnterpriseService { // Annotates a previously created Assessment to provide additional information // on whether the event turned out to be authentic or fraudulent. - rpc AnnotateAssessment(AnnotateAssessmentRequest) returns (AnnotateAssessmentResponse) { + rpc AnnotateAssessment(AnnotateAssessmentRequest) + returns (AnnotateAssessmentResponse) { option (google.api.http) = { post: "/v1/{name=projects/*/assessments/*}:annotate" body: "*" @@ -117,7 +119,8 @@ service RecaptchaEnterpriseService { } // List groups of related accounts. - rpc ListRelatedAccountGroups(ListRelatedAccountGroupsRequest) returns (ListRelatedAccountGroupsResponse) { + rpc ListRelatedAccountGroups(ListRelatedAccountGroupsRequest) + returns (ListRelatedAccountGroupsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*}/relatedaccountgroups" }; @@ -125,7 +128,9 @@ service RecaptchaEnterpriseService { } // Get the memberships in a group of related accounts. - rpc ListRelatedAccountGroupMemberships(ListRelatedAccountGroupMembershipsRequest) returns (ListRelatedAccountGroupMembershipsResponse) { + rpc ListRelatedAccountGroupMemberships( + ListRelatedAccountGroupMembershipsRequest) + returns (ListRelatedAccountGroupMembershipsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/relatedaccountgroups/*}/memberships" }; @@ -133,7 +138,9 @@ service RecaptchaEnterpriseService { } // Search group memberships related to a given account. - rpc SearchRelatedAccountGroupMemberships(SearchRelatedAccountGroupMembershipsRequest) returns (SearchRelatedAccountGroupMembershipsResponse) { + rpc SearchRelatedAccountGroupMemberships( + SearchRelatedAccountGroupMembershipsRequest) + returns (SearchRelatedAccountGroupMembershipsResponse) { option (google.api.http) = { post: "/v1/{project=projects/*}/relatedaccountgroupmemberships:search" body: "*" @@ -234,16 +241,17 @@ message AnnotateAssessmentRequest { } ]; - // Optional. The annotation that will be assigned to the Event. This field can be left - // empty to provide reasons that apply to an event without concluding whether - // the event is legitimate or fraudulent. + // Optional. The annotation that will be assigned to the Event. This field can + // be left empty to provide reasons that apply to an event without concluding + // whether the event is legitimate or fraudulent. Annotation annotation = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Optional reasons for the annotation that will be assigned to the Event. + // Optional. Optional reasons for the annotation that will be assigned to the + // Event. repeated Reason reasons = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Optional unique stable hashed user identifier to apply to the assessment. - // This is an alternative to setting the hashed_account_id in + // Optional. Optional unique stable hashed user identifier to apply to the + // assessment. This is an alternative to setting the hashed_account_id in // CreateAssessment, for example when the account identifier is not yet known // in the initial request. It is recommended that the identifier is hashed // using hmac-sha256 with stable secret. @@ -251,9 +259,7 @@ message AnnotateAssessmentRequest { } // Empty response for AnnotateAssessment. -message AnnotateAssessmentResponse { - -} +message AnnotateAssessmentResponse {} // A recaptcha assessment resource. message Assessment { @@ -273,36 +279,41 @@ message Assessment { RiskAnalysis risk_analysis = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Properties of the provided event token. - TokenProperties token_properties = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + TokenProperties token_properties = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Assessment returned by Account Defender when a hashed_account_id is // provided. AccountDefenderAssessment account_defender_assessment = 6; + + // Password leak verification info. + PrivatePasswordLeakVerification private_password_leak_verification = 7; } message Event { - // Optional. The user response token provided by the reCAPTCHA client-side integration - // on your site. + // Optional. The user response token provided by the reCAPTCHA client-side + // integration on your site. string token = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The site key that was used to invoke reCAPTCHA on your site and generate - // the token. + // Optional. The site key that was used to invoke reCAPTCHA on your site and + // generate the token. string site_key = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The user agent present in the request from the user's device related to - // this event. + // Optional. The user agent present in the request from the user's device + // related to this event. string user_agent = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The IP address in the request from the user's device related to this event. + // Optional. The IP address in the request from the user's device related to + // this event. string user_ip_address = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The expected action for this type of event. This should be the same action - // provided at token generation time on client-side platforms already - // integrated with recaptcha enterprise. + // Optional. The expected action for this type of event. This should be the + // same action provided at token generation time on client-side platforms + // already integrated with recaptcha enterprise. string expected_action = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Optional unique stable hashed user identifier for the request. The - // identifier should ideally be hashed using sha256 with stable secret. + // Optional. Optional unique stable hashed user identifier for the request. + // The identifier should ideally be hashed using sha256 with stable secret. bytes hashed_account_id = 6 [(google.api.field_behavior) = OPTIONAL]; } @@ -414,6 +425,31 @@ message AccountDefenderAssessment { repeated AccountDefenderLabel labels = 1; } +// Private password leak verification info. +message PrivatePasswordLeakVerification { + // Exactly 26-bit prefix of the SHA-256 hash of the canonicalized username. It + // is used to look up password leaks associated with that hash prefix. + bytes lookup_hash_prefix = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Encrypted Scrypt hash of the canonicalized username+password. It is + // re-encrypted by the server and returned through + // `reencrypted_user_credentials_hash`. + bytes encrypted_user_credentials_hash = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // List of prefixes of the encrypted potential password leaks that matched the + // given parameters. They should be compared with the client-side decryption + // prefix of `reencrypted_user_credentials_hash` + repeated bytes encrypted_leak_match_prefixes = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Corresponds to the re-encryption of the `encrypted_user_credentials_hash` + // field. Used to match potential password leaks within + // `encrypted_leak_match_prefixes`. + bytes reencrypted_user_credentials_hash = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // The create key request message. message CreateKeyRequest { // Required. The name of the project in which the key will be created, in the @@ -476,9 +512,10 @@ message UpdateKeyRequest { // Required. The key to update. Key key = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The mask to control which fields of the key get updated. If the mask is not - // present, all fields will be updated. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; + // Optional. The mask to control which fields of the key get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; } // The delete key request message. @@ -740,14 +777,14 @@ message ListRelatedAccountGroupMembershipsRequest { } ]; - // Optional. The maximum number of accounts to return. The service may return fewer than - // this value. - // If unspecified, at most 50 accounts will be returned. - // The maximum value is 1000; values above 1000 will be coerced to 1000. + // Optional. The maximum number of accounts to return. The service may return + // fewer than this value. If unspecified, at most 50 accounts will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` - // call. + // Optional. A page token, received from a previous + // `ListRelatedAccountGroupMemberships` call. // // When paginating, all other parameters provided to // `ListRelatedAccountGroupMemberships` must match the call that provided the @@ -767,8 +804,8 @@ message ListRelatedAccountGroupMembershipsResponse { // The request message to list related account groups. message ListRelatedAccountGroupsRequest { - // Required. The name of the project to list related account groups from, in the format - // "projects/{project}". + // Required. The name of the project to list related account groups from, in + // the format "projects/{project}". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -776,14 +813,13 @@ message ListRelatedAccountGroupsRequest { } ]; - // Optional. The maximum number of groups to return. The service may return fewer than - // this value. - // If unspecified, at most 50 groups will be returned. + // Optional. The maximum number of groups to return. The service may return + // fewer than this value. If unspecified, at most 50 groups will be returned. // The maximum value is 1000; values above 1000 will be coerced to 1000. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A page token, received from a previous `ListRelatedAccountGroups` call. - // Provide this to retrieve the subsequent page. + // Optional. A page token, received from a previous `ListRelatedAccountGroups` + // call. Provide this to retrieve the subsequent page. // // When paginating, all other parameters provided to // `ListRelatedAccountGroups` must match the call that provided the page @@ -803,8 +839,8 @@ message ListRelatedAccountGroupsResponse { // The request message to search related account group memberships. message SearchRelatedAccountGroupMembershipsRequest { - // Required. The name of the project to search related account group memberships from, - // in the format "projects/{project}". + // Required. The name of the project to search related account group + // memberships from, in the format "projects/{project}". string project = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -812,14 +848,13 @@ message SearchRelatedAccountGroupMembershipsRequest { } ]; - // Optional. The unique stable hashed user identifier we should search connections to. - // The identifier should correspond to a `hashed_account_id` provided in a - // previous CreateAssessment or AnnotateAssessment call. + // Optional. The unique stable hashed user identifier we should search + // connections to. The identifier should correspond to a `hashed_account_id` + // provided in a previous CreateAssessment or AnnotateAssessment call. bytes hashed_account_id = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The maximum number of groups to return. The service may return fewer than - // this value. - // If unspecified, at most 50 groups will be returned. + // Optional. The maximum number of groups to return. The service may return + // fewer than this value. If unspecified, at most 50 groups will be returned. // The maximum value is 1000; values above 1000 will be coerced to 1000. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 8f8090dd336..01fb9764176 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -633,6 +633,9 @@ export namespace google { /** Assessment accountDefenderAssessment */ accountDefenderAssessment?: (google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment|null); + + /** Assessment privatePasswordLeakVerification */ + privatePasswordLeakVerification?: (google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification|null); } /** Represents an Assessment. */ @@ -659,6 +662,9 @@ export namespace google { /** Assessment accountDefenderAssessment. */ public accountDefenderAssessment?: (google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment|null); + /** Assessment privatePasswordLeakVerification. */ + public privatePasswordLeakVerification?: (google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification|null); + /** * Creates a new Assessment instance using the specified properties. * @param [properties] Properties to set @@ -1189,6 +1195,114 @@ export namespace google { } } + /** Properties of a PrivatePasswordLeakVerification. */ + interface IPrivatePasswordLeakVerification { + + /** PrivatePasswordLeakVerification lookupHashPrefix */ + lookupHashPrefix?: (Uint8Array|string|null); + + /** PrivatePasswordLeakVerification encryptedUserCredentialsHash */ + encryptedUserCredentialsHash?: (Uint8Array|string|null); + + /** PrivatePasswordLeakVerification encryptedLeakMatchPrefixes */ + encryptedLeakMatchPrefixes?: (Uint8Array[]|null); + + /** PrivatePasswordLeakVerification reencryptedUserCredentialsHash */ + reencryptedUserCredentialsHash?: (Uint8Array|string|null); + } + + /** Represents a PrivatePasswordLeakVerification. */ + class PrivatePasswordLeakVerification implements IPrivatePasswordLeakVerification { + + /** + * Constructs a new PrivatePasswordLeakVerification. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification); + + /** PrivatePasswordLeakVerification lookupHashPrefix. */ + public lookupHashPrefix: (Uint8Array|string); + + /** PrivatePasswordLeakVerification encryptedUserCredentialsHash. */ + public encryptedUserCredentialsHash: (Uint8Array|string); + + /** PrivatePasswordLeakVerification encryptedLeakMatchPrefixes. */ + public encryptedLeakMatchPrefixes: Uint8Array[]; + + /** PrivatePasswordLeakVerification reencryptedUserCredentialsHash. */ + public reencryptedUserCredentialsHash: (Uint8Array|string); + + /** + * Creates a new PrivatePasswordLeakVerification instance using the specified properties. + * @param [properties] Properties to set + * @returns PrivatePasswordLeakVerification instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification): google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification; + + /** + * Encodes the specified PrivatePasswordLeakVerification message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.verify|verify} messages. + * @param message PrivatePasswordLeakVerification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrivatePasswordLeakVerification message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.verify|verify} messages. + * @param message PrivatePasswordLeakVerification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrivatePasswordLeakVerification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrivatePasswordLeakVerification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification; + + /** + * Decodes a PrivatePasswordLeakVerification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrivatePasswordLeakVerification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification; + + /** + * Verifies a PrivatePasswordLeakVerification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrivatePasswordLeakVerification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrivatePasswordLeakVerification + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification; + + /** + * Creates a plain object from a PrivatePasswordLeakVerification message. Also converts values to other types if specified. + * @param message PrivatePasswordLeakVerification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrivatePasswordLeakVerification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a CreateKeyRequest. */ interface ICreateKeyRequest { diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index ee437801e51..ac31c2c1f9a 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -1304,6 +1304,7 @@ * @property {google.cloud.recaptchaenterprise.v1.IRiskAnalysis|null} [riskAnalysis] Assessment riskAnalysis * @property {google.cloud.recaptchaenterprise.v1.ITokenProperties|null} [tokenProperties] Assessment tokenProperties * @property {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment|null} [accountDefenderAssessment] Assessment accountDefenderAssessment + * @property {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification|null} [privatePasswordLeakVerification] Assessment privatePasswordLeakVerification */ /** @@ -1361,6 +1362,14 @@ */ Assessment.prototype.accountDefenderAssessment = null; + /** + * Assessment privatePasswordLeakVerification. + * @member {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification|null|undefined} privatePasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @instance + */ + Assessment.prototype.privatePasswordLeakVerification = null; + /** * Creates a new Assessment instance using the specified properties. * @function create @@ -1395,6 +1404,8 @@ $root.google.cloud.recaptchaenterprise.v1.TokenProperties.encode(message.tokenProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.accountDefenderAssessment != null && Object.hasOwnProperty.call(message, "accountDefenderAssessment")) $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.encode(message.accountDefenderAssessment, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.privatePasswordLeakVerification != null && Object.hasOwnProperty.call(message, "privatePasswordLeakVerification")) + $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.encode(message.privatePasswordLeakVerification, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -1444,6 +1455,9 @@ case 6: message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.decode(reader, reader.uint32()); break; + case 7: + message.privatePasswordLeakVerification = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1502,6 +1516,11 @@ if (error) return "accountDefenderAssessment." + error; } + if (message.privatePasswordLeakVerification != null && message.hasOwnProperty("privatePasswordLeakVerification")) { + var error = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.verify(message.privatePasswordLeakVerification); + if (error) + return "privatePasswordLeakVerification." + error; + } return null; }; @@ -1539,6 +1558,11 @@ throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.accountDefenderAssessment: object expected"); message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.fromObject(object.accountDefenderAssessment); } + if (object.privatePasswordLeakVerification != null) { + if (typeof object.privatePasswordLeakVerification !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.privatePasswordLeakVerification: object expected"); + message.privatePasswordLeakVerification = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.fromObject(object.privatePasswordLeakVerification); + } return message; }; @@ -1561,6 +1585,7 @@ object.riskAnalysis = null; object.tokenProperties = null; object.accountDefenderAssessment = null; + object.privatePasswordLeakVerification = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1572,6 +1597,8 @@ object.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.toObject(message.tokenProperties, options); if (message.accountDefenderAssessment != null && message.hasOwnProperty("accountDefenderAssessment")) object.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.toObject(message.accountDefenderAssessment, options); + if (message.privatePasswordLeakVerification != null && message.hasOwnProperty("privatePasswordLeakVerification")) + object.privatePasswordLeakVerification = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.toObject(message.privatePasswordLeakVerification, options); return object; }; @@ -2791,6 +2818,307 @@ return AccountDefenderAssessment; })(); + v1.PrivatePasswordLeakVerification = (function() { + + /** + * Properties of a PrivatePasswordLeakVerification. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IPrivatePasswordLeakVerification + * @property {Uint8Array|null} [lookupHashPrefix] PrivatePasswordLeakVerification lookupHashPrefix + * @property {Uint8Array|null} [encryptedUserCredentialsHash] PrivatePasswordLeakVerification encryptedUserCredentialsHash + * @property {Array.|null} [encryptedLeakMatchPrefixes] PrivatePasswordLeakVerification encryptedLeakMatchPrefixes + * @property {Uint8Array|null} [reencryptedUserCredentialsHash] PrivatePasswordLeakVerification reencryptedUserCredentialsHash + */ + + /** + * Constructs a new PrivatePasswordLeakVerification. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a PrivatePasswordLeakVerification. + * @implements IPrivatePasswordLeakVerification + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification=} [properties] Properties to set + */ + function PrivatePasswordLeakVerification(properties) { + this.encryptedLeakMatchPrefixes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrivatePasswordLeakVerification lookupHashPrefix. + * @member {Uint8Array} lookupHashPrefix + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @instance + */ + PrivatePasswordLeakVerification.prototype.lookupHashPrefix = $util.newBuffer([]); + + /** + * PrivatePasswordLeakVerification encryptedUserCredentialsHash. + * @member {Uint8Array} encryptedUserCredentialsHash + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @instance + */ + PrivatePasswordLeakVerification.prototype.encryptedUserCredentialsHash = $util.newBuffer([]); + + /** + * PrivatePasswordLeakVerification encryptedLeakMatchPrefixes. + * @member {Array.} encryptedLeakMatchPrefixes + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @instance + */ + PrivatePasswordLeakVerification.prototype.encryptedLeakMatchPrefixes = $util.emptyArray; + + /** + * PrivatePasswordLeakVerification reencryptedUserCredentialsHash. + * @member {Uint8Array} reencryptedUserCredentialsHash + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @instance + */ + PrivatePasswordLeakVerification.prototype.reencryptedUserCredentialsHash = $util.newBuffer([]); + + /** + * Creates a new PrivatePasswordLeakVerification instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @static + * @param {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification} PrivatePasswordLeakVerification instance + */ + PrivatePasswordLeakVerification.create = function create(properties) { + return new PrivatePasswordLeakVerification(properties); + }; + + /** + * Encodes the specified PrivatePasswordLeakVerification message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @static + * @param {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification} message PrivatePasswordLeakVerification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivatePasswordLeakVerification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lookupHashPrefix != null && Object.hasOwnProperty.call(message, "lookupHashPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.lookupHashPrefix); + if (message.encryptedUserCredentialsHash != null && Object.hasOwnProperty.call(message, "encryptedUserCredentialsHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.encryptedUserCredentialsHash); + if (message.encryptedLeakMatchPrefixes != null && message.encryptedLeakMatchPrefixes.length) + for (var i = 0; i < message.encryptedLeakMatchPrefixes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.encryptedLeakMatchPrefixes[i]); + if (message.reencryptedUserCredentialsHash != null && Object.hasOwnProperty.call(message, "reencryptedUserCredentialsHash")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.reencryptedUserCredentialsHash); + return writer; + }; + + /** + * Encodes the specified PrivatePasswordLeakVerification message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @static + * @param {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification} message PrivatePasswordLeakVerification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivatePasswordLeakVerification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivatePasswordLeakVerification message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification} PrivatePasswordLeakVerification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivatePasswordLeakVerification.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lookupHashPrefix = reader.bytes(); + break; + case 2: + message.encryptedUserCredentialsHash = reader.bytes(); + break; + case 3: + if (!(message.encryptedLeakMatchPrefixes && message.encryptedLeakMatchPrefixes.length)) + message.encryptedLeakMatchPrefixes = []; + message.encryptedLeakMatchPrefixes.push(reader.bytes()); + break; + case 4: + message.reencryptedUserCredentialsHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivatePasswordLeakVerification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification} PrivatePasswordLeakVerification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivatePasswordLeakVerification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivatePasswordLeakVerification message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivatePasswordLeakVerification.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lookupHashPrefix != null && message.hasOwnProperty("lookupHashPrefix")) + if (!(message.lookupHashPrefix && typeof message.lookupHashPrefix.length === "number" || $util.isString(message.lookupHashPrefix))) + return "lookupHashPrefix: buffer expected"; + if (message.encryptedUserCredentialsHash != null && message.hasOwnProperty("encryptedUserCredentialsHash")) + if (!(message.encryptedUserCredentialsHash && typeof message.encryptedUserCredentialsHash.length === "number" || $util.isString(message.encryptedUserCredentialsHash))) + return "encryptedUserCredentialsHash: buffer expected"; + if (message.encryptedLeakMatchPrefixes != null && message.hasOwnProperty("encryptedLeakMatchPrefixes")) { + if (!Array.isArray(message.encryptedLeakMatchPrefixes)) + return "encryptedLeakMatchPrefixes: array expected"; + for (var i = 0; i < message.encryptedLeakMatchPrefixes.length; ++i) + if (!(message.encryptedLeakMatchPrefixes[i] && typeof message.encryptedLeakMatchPrefixes[i].length === "number" || $util.isString(message.encryptedLeakMatchPrefixes[i]))) + return "encryptedLeakMatchPrefixes: buffer[] expected"; + } + if (message.reencryptedUserCredentialsHash != null && message.hasOwnProperty("reencryptedUserCredentialsHash")) + if (!(message.reencryptedUserCredentialsHash && typeof message.reencryptedUserCredentialsHash.length === "number" || $util.isString(message.reencryptedUserCredentialsHash))) + return "reencryptedUserCredentialsHash: buffer expected"; + return null; + }; + + /** + * Creates a PrivatePasswordLeakVerification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification} PrivatePasswordLeakVerification + */ + PrivatePasswordLeakVerification.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification(); + if (object.lookupHashPrefix != null) + if (typeof object.lookupHashPrefix === "string") + $util.base64.decode(object.lookupHashPrefix, message.lookupHashPrefix = $util.newBuffer($util.base64.length(object.lookupHashPrefix)), 0); + else if (object.lookupHashPrefix.length) + message.lookupHashPrefix = object.lookupHashPrefix; + if (object.encryptedUserCredentialsHash != null) + if (typeof object.encryptedUserCredentialsHash === "string") + $util.base64.decode(object.encryptedUserCredentialsHash, message.encryptedUserCredentialsHash = $util.newBuffer($util.base64.length(object.encryptedUserCredentialsHash)), 0); + else if (object.encryptedUserCredentialsHash.length) + message.encryptedUserCredentialsHash = object.encryptedUserCredentialsHash; + if (object.encryptedLeakMatchPrefixes) { + if (!Array.isArray(object.encryptedLeakMatchPrefixes)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.encryptedLeakMatchPrefixes: array expected"); + message.encryptedLeakMatchPrefixes = []; + for (var i = 0; i < object.encryptedLeakMatchPrefixes.length; ++i) + if (typeof object.encryptedLeakMatchPrefixes[i] === "string") + $util.base64.decode(object.encryptedLeakMatchPrefixes[i], message.encryptedLeakMatchPrefixes[i] = $util.newBuffer($util.base64.length(object.encryptedLeakMatchPrefixes[i])), 0); + else if (object.encryptedLeakMatchPrefixes[i].length) + message.encryptedLeakMatchPrefixes[i] = object.encryptedLeakMatchPrefixes[i]; + } + if (object.reencryptedUserCredentialsHash != null) + if (typeof object.reencryptedUserCredentialsHash === "string") + $util.base64.decode(object.reencryptedUserCredentialsHash, message.reencryptedUserCredentialsHash = $util.newBuffer($util.base64.length(object.reencryptedUserCredentialsHash)), 0); + else if (object.reencryptedUserCredentialsHash.length) + message.reencryptedUserCredentialsHash = object.reencryptedUserCredentialsHash; + return message; + }; + + /** + * Creates a plain object from a PrivatePasswordLeakVerification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @static + * @param {google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification} message PrivatePasswordLeakVerification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivatePasswordLeakVerification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.encryptedLeakMatchPrefixes = []; + if (options.defaults) { + if (options.bytes === String) + object.lookupHashPrefix = ""; + else { + object.lookupHashPrefix = []; + if (options.bytes !== Array) + object.lookupHashPrefix = $util.newBuffer(object.lookupHashPrefix); + } + if (options.bytes === String) + object.encryptedUserCredentialsHash = ""; + else { + object.encryptedUserCredentialsHash = []; + if (options.bytes !== Array) + object.encryptedUserCredentialsHash = $util.newBuffer(object.encryptedUserCredentialsHash); + } + if (options.bytes === String) + object.reencryptedUserCredentialsHash = ""; + else { + object.reencryptedUserCredentialsHash = []; + if (options.bytes !== Array) + object.reencryptedUserCredentialsHash = $util.newBuffer(object.reencryptedUserCredentialsHash); + } + } + if (message.lookupHashPrefix != null && message.hasOwnProperty("lookupHashPrefix")) + object.lookupHashPrefix = options.bytes === String ? $util.base64.encode(message.lookupHashPrefix, 0, message.lookupHashPrefix.length) : options.bytes === Array ? Array.prototype.slice.call(message.lookupHashPrefix) : message.lookupHashPrefix; + if (message.encryptedUserCredentialsHash != null && message.hasOwnProperty("encryptedUserCredentialsHash")) + object.encryptedUserCredentialsHash = options.bytes === String ? $util.base64.encode(message.encryptedUserCredentialsHash, 0, message.encryptedUserCredentialsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedUserCredentialsHash) : message.encryptedUserCredentialsHash; + if (message.encryptedLeakMatchPrefixes && message.encryptedLeakMatchPrefixes.length) { + object.encryptedLeakMatchPrefixes = []; + for (var j = 0; j < message.encryptedLeakMatchPrefixes.length; ++j) + object.encryptedLeakMatchPrefixes[j] = options.bytes === String ? $util.base64.encode(message.encryptedLeakMatchPrefixes[j], 0, message.encryptedLeakMatchPrefixes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedLeakMatchPrefixes[j]) : message.encryptedLeakMatchPrefixes[j]; + } + if (message.reencryptedUserCredentialsHash != null && message.hasOwnProperty("reencryptedUserCredentialsHash")) + object.reencryptedUserCredentialsHash = options.bytes === String ? $util.base64.encode(message.reencryptedUserCredentialsHash, 0, message.reencryptedUserCredentialsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.reencryptedUserCredentialsHash) : message.reencryptedUserCredentialsHash; + return object; + }; + + /** + * Converts this PrivatePasswordLeakVerification to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @instance + * @returns {Object.} JSON object + */ + PrivatePasswordLeakVerification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PrivatePasswordLeakVerification; + })(); + v1.CreateKeyRequest = (function() { /** diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index cc2b5b071cf..bb5d252a25f 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -345,6 +345,10 @@ "accountDefenderAssessment": { "type": "AccountDefenderAssessment", "id": 6 + }, + "privatePasswordLeakVerification": { + "type": "PrivatePasswordLeakVerification", + "id": 7 } } }, @@ -476,6 +480,39 @@ } } }, + "PrivatePasswordLeakVerification": { + "fields": { + "lookupHashPrefix": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptedUserCredentialsHash": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptedLeakMatchPrefixes": { + "rule": "repeated", + "type": "bytes", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reencryptedUserCredentialsHash": { + "type": "bytes", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "CreateKeyRequest": { "fields": { "parent": { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js index 0ed78fbf25f..4240c455f11 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js @@ -31,18 +31,19 @@ function main(name) { */ // const name = 'abc123' /** - * Optional. The annotation that will be assigned to the Event. This field can be left - * empty to provide reasons that apply to an event without concluding whether - * the event is legitimate or fraudulent. + * Optional. The annotation that will be assigned to the Event. This field can + * be left empty to provide reasons that apply to an event without concluding + * whether the event is legitimate or fraudulent. */ // const annotation = {} /** - * Optional. Optional reasons for the annotation that will be assigned to the Event. + * Optional. Optional reasons for the annotation that will be assigned to the + * Event. */ // const reasons = 1234 /** - * Optional. Optional unique stable hashed user identifier to apply to the assessment. - * This is an alternative to setting the hashed_account_id in + * Optional. Optional unique stable hashed user identifier to apply to the + * assessment. This is an alternative to setting the hashed_account_id in * CreateAssessment, for example when the account identifier is not yet known * in the initial request. It is recommended that the identifier is hashed * using hmac-sha256 with stable secret. diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js index c2853cdb084..abef7ca2238 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js @@ -31,15 +31,15 @@ function main(parent) { */ // const parent = 'abc123' /** - * Optional. The maximum number of accounts to return. The service may return fewer than - * this value. - * If unspecified, at most 50 accounts will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 50 accounts will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. */ // const pageSize = 1234 /** - * Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` - * call. + * Optional. A page token, received from a previous + * `ListRelatedAccountGroupMemberships` call. * When paginating, all other parameters provided to * `ListRelatedAccountGroupMemberships` must match the call that provided the * page token. diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js index c4972529135..9f79ded4268 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js @@ -26,20 +26,19 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the project to list related account groups from, in the format - * "projects/{project}". + * Required. The name of the project to list related account groups from, in + * the format "projects/{project}". */ // const parent = 'abc123' /** - * Optional. The maximum number of groups to return. The service may return fewer than - * this value. - * If unspecified, at most 50 groups will be returned. + * Optional. The maximum number of groups to return. The service may return + * fewer than this value. If unspecified, at most 50 groups will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. */ // const pageSize = 1234 /** - * Optional. A page token, received from a previous `ListRelatedAccountGroups` call. - * Provide this to retrieve the subsequent page. + * Optional. A page token, received from a previous `ListRelatedAccountGroups` + * call. Provide this to retrieve the subsequent page. * When paginating, all other parameters provided to * `ListRelatedAccountGroups` must match the call that provided the page * token. diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js index 863ac5b2d36..6f0a056154a 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js @@ -26,20 +26,19 @@ function main(project) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the project to search related account group memberships from, - * in the format "projects/{project}". + * Required. The name of the project to search related account group + * memberships from, in the format "projects/{project}". */ // const project = 'my-project' /** - * Optional. The unique stable hashed user identifier we should search connections to. - * The identifier should correspond to a `hashed_account_id` provided in a - * previous CreateAssessment or AnnotateAssessment call. + * Optional. The unique stable hashed user identifier we should search + * connections to. The identifier should correspond to a `hashed_account_id` + * provided in a previous CreateAssessment or AnnotateAssessment call. */ // const hashedAccountId = 'Buffer.from('string')' /** - * Optional. The maximum number of groups to return. The service may return fewer than - * this value. - * If unspecified, at most 50 groups will be returned. + * Optional. The maximum number of groups to return. The service may return + * fewer than this value. If unspecified, at most 50 groups will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. */ // const pageSize = 1234 diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js index b4c91cd165b..8714d93b9fa 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js @@ -30,8 +30,8 @@ function main(key) { */ // const key = {} /** - * Optional. The mask to control which fields of the key get updated. If the mask is not - * present, all fields will be updated. + * Optional. The mask to control which fields of the key get updated. If the + * mask is not present, all fields will be updated. */ // const updateMask = {} diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index 578b6b467f6..42ee0833041 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -66,7 +66,7 @@ "segments": [ { "start": 25, - "end": 69, + "end": 70, "type": "FULL" } ], @@ -414,7 +414,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 67, "type": "FULL" } ], @@ -510,7 +510,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 74, "type": "FULL" } ], diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index b4ed5ed0c59..308bb023f36 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -467,14 +467,15 @@ export class RecaptchaEnterpriseServiceClient { * Required. The resource name of the Assessment, in the format * "projects/{project}/assessments/{assessment}". * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} [request.annotation] - * Optional. The annotation that will be assigned to the Event. This field can be left - * empty to provide reasons that apply to an event without concluding whether - * the event is legitimate or fraudulent. + * Optional. The annotation that will be assigned to the Event. This field can + * be left empty to provide reasons that apply to an event without concluding + * whether the event is legitimate or fraudulent. * @param {number[]} [request.reasons] - * Optional. Optional reasons for the annotation that will be assigned to the Event. + * Optional. Optional reasons for the annotation that will be assigned to the + * Event. * @param {Buffer} [request.hashedAccountId] - * Optional. Optional unique stable hashed user identifier to apply to the assessment. - * This is an alternative to setting the hashed_account_id in + * Optional. Optional unique stable hashed user identifier to apply to the + * assessment. This is an alternative to setting the hashed_account_id in * CreateAssessment, for example when the account identifier is not yet known * in the initial request. It is recommended that the identifier is hashed * using hmac-sha256 with stable secret. @@ -762,8 +763,8 @@ export class RecaptchaEnterpriseServiceClient { * @param {google.cloud.recaptchaenterprise.v1.Key} request.key * Required. The key to update. * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The mask to control which fields of the key get updated. If the mask is not - * present, all fields will be updated. + * Optional. The mask to control which fields of the key get updated. If the + * mask is not present, all fields will be 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. @@ -1335,16 +1336,15 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project to list related account groups from, in the format - * "projects/{project}". + * Required. The name of the project to list related account groups from, in + * the format "projects/{project}". * @param {number} [request.pageSize] - * Optional. The maximum number of groups to return. The service may return fewer than - * this value. - * If unspecified, at most 50 groups will be returned. + * Optional. The maximum number of groups to return. The service may return + * fewer than this value. If unspecified, at most 50 groups will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRelatedAccountGroups` call. - * Provide this to retrieve the subsequent page. + * Optional. A page token, received from a previous `ListRelatedAccountGroups` + * call. Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to * `ListRelatedAccountGroups` must match the call that provided the page @@ -1446,16 +1446,15 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project to list related account groups from, in the format - * "projects/{project}". + * Required. The name of the project to list related account groups from, in + * the format "projects/{project}". * @param {number} [request.pageSize] - * Optional. The maximum number of groups to return. The service may return fewer than - * this value. - * If unspecified, at most 50 groups will be returned. + * Optional. The maximum number of groups to return. The service may return + * fewer than this value. If unspecified, at most 50 groups will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRelatedAccountGroups` call. - * Provide this to retrieve the subsequent page. + * Optional. A page token, received from a previous `ListRelatedAccountGroups` + * call. Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to * `ListRelatedAccountGroups` must match the call that provided the page @@ -1501,16 +1500,15 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project to list related account groups from, in the format - * "projects/{project}". + * Required. The name of the project to list related account groups from, in + * the format "projects/{project}". * @param {number} [request.pageSize] - * Optional. The maximum number of groups to return. The service may return fewer than - * this value. - * If unspecified, at most 50 groups will be returned. + * Optional. The maximum number of groups to return. The service may return + * fewer than this value. If unspecified, at most 50 groups will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRelatedAccountGroups` call. - * Provide this to retrieve the subsequent page. + * Optional. A page token, received from a previous `ListRelatedAccountGroups` + * call. Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to * `ListRelatedAccountGroups` must match the call that provided the page @@ -1558,13 +1556,13 @@ export class RecaptchaEnterpriseServiceClient { * Required. The resource name for the related account group in the format * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. * @param {number} [request.pageSize] - * Optional. The maximum number of accounts to return. The service may return fewer than - * this value. - * If unspecified, at most 50 accounts will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 50 accounts will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` - * call. + * Optional. A page token, received from a previous + * `ListRelatedAccountGroupMemberships` call. * * When paginating, all other parameters provided to * `ListRelatedAccountGroupMemberships` must match the call that provided the @@ -1669,13 +1667,13 @@ export class RecaptchaEnterpriseServiceClient { * Required. The resource name for the related account group in the format * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. * @param {number} [request.pageSize] - * Optional. The maximum number of accounts to return. The service may return fewer than - * this value. - * If unspecified, at most 50 accounts will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 50 accounts will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` - * call. + * Optional. A page token, received from a previous + * `ListRelatedAccountGroupMemberships` call. * * When paginating, all other parameters provided to * `ListRelatedAccountGroupMemberships` must match the call that provided the @@ -1725,13 +1723,13 @@ export class RecaptchaEnterpriseServiceClient { * Required. The resource name for the related account group in the format * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. * @param {number} [request.pageSize] - * Optional. The maximum number of accounts to return. The service may return fewer than - * this value. - * If unspecified, at most 50 accounts will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 50 accounts will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` - * call. + * Optional. A page token, received from a previous + * `ListRelatedAccountGroupMemberships` call. * * When paginating, all other parameters provided to * `ListRelatedAccountGroupMemberships` must match the call that provided the @@ -1777,16 +1775,15 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.project - * Required. The name of the project to search related account group memberships from, - * in the format "projects/{project}". + * Required. The name of the project to search related account group + * memberships from, in the format "projects/{project}". * @param {Buffer} [request.hashedAccountId] - * Optional. The unique stable hashed user identifier we should search connections to. - * The identifier should correspond to a `hashed_account_id` provided in a - * previous CreateAssessment or AnnotateAssessment call. + * Optional. The unique stable hashed user identifier we should search + * connections to. The identifier should correspond to a `hashed_account_id` + * provided in a previous CreateAssessment or AnnotateAssessment call. * @param {number} [request.pageSize] - * Optional. The maximum number of groups to return. The service may return fewer than - * this value. - * If unspecified, at most 50 groups will be returned. + * Optional. The maximum number of groups to return. The service may return + * fewer than this value. If unspecified, at most 50 groups will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. * @param {string} [request.pageToken] * Optional. A page token, received from a previous @@ -1893,16 +1890,15 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.project - * Required. The name of the project to search related account group memberships from, - * in the format "projects/{project}". + * Required. The name of the project to search related account group + * memberships from, in the format "projects/{project}". * @param {Buffer} [request.hashedAccountId] - * Optional. The unique stable hashed user identifier we should search connections to. - * The identifier should correspond to a `hashed_account_id` provided in a - * previous CreateAssessment or AnnotateAssessment call. + * Optional. The unique stable hashed user identifier we should search + * connections to. The identifier should correspond to a `hashed_account_id` + * provided in a previous CreateAssessment or AnnotateAssessment call. * @param {number} [request.pageSize] - * Optional. The maximum number of groups to return. The service may return fewer than - * this value. - * If unspecified, at most 50 groups will be returned. + * Optional. The maximum number of groups to return. The service may return + * fewer than this value. If unspecified, at most 50 groups will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. * @param {string} [request.pageToken] * Optional. A page token, received from a previous @@ -1954,16 +1950,15 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.project - * Required. The name of the project to search related account group memberships from, - * in the format "projects/{project}". + * Required. The name of the project to search related account group + * memberships from, in the format "projects/{project}". * @param {Buffer} [request.hashedAccountId] - * Optional. The unique stable hashed user identifier we should search connections to. - * The identifier should correspond to a `hashed_account_id` provided in a - * previous CreateAssessment or AnnotateAssessment call. + * Optional. The unique stable hashed user identifier we should search + * connections to. The identifier should correspond to a `hashed_account_id` + * provided in a previous CreateAssessment or AnnotateAssessment call. * @param {number} [request.pageSize] - * Optional. The maximum number of groups to return. The service may return fewer than - * this value. - * If unspecified, at most 50 groups will be returned. + * Optional. The maximum number of groups to return. The service may return + * fewer than this value. If unspecified, at most 50 groups will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. * @param {string} [request.pageToken] * Optional. A page token, received from a previous From 5408e2449e82dbf7fcc4c4e973bec99d5fa9d00c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 18 May 2022 00:16:13 +0000 Subject: [PATCH 227/253] chore(main): release 1.0.0 (#375) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :robot: I have created a release *beep* *boop* --- ## 1.0.0 (2022-05-18) ### ⚠ BREAKING CHANGES * update library to use Node 12 (#374) * rename parent to project in SearchRelatedAccountGroupMembershipsRequest (#370) * remove key management API (#366) * Remove RecaptchaEnterpriseServiceV1Beta1Client. * The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. * upgrade engines field to >=8.10.0 (#2) ### Features * add crud support for keys ([#84](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/84)) ([adfc3f9](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/adfc3f954f79110ad73425e2da9381fa6c02152d)) * add GetMetrics and MigrateKey methods to reCAPTCHA enterprise API ([#318](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/318)) ([55b1adc](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/55b1adc261879db1b073f3ad9cd3453c09d1e8d8)) * add new reCAPTCHA Enterprise fraud annotations ([#334](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/334)) ([24fdff1](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/24fdff1520fb8ff3192be7d256f7a7875d5803b6)) * add plural and singular resource descriptor ([#78](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/78)) ([a67ffa7](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/a67ffa751551f4d6346c806e82b2311030b7ab61)) * add reCAPTCHA Enterprise account defender API methods ([#328](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/328)) ([2099c50](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/2099c503c2bb91347761b083140c66f22b042a0d)) * Add support for Password Check through the private_password_leak_verification field in the reCAPTCHA Assessment ([#376](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/376)) ([7c1583c](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/7c1583c6854d9a567fd135f5ba1629250fe5f8ce)) * add the v1 API surface ([#141](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/141)) ([bb1bd33](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/bb1bd33c1f51d37ca8db15ce7579259560250530)) * deferred client initialization ([#128](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/128)) ([3de999e](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/3de999e1d4efc823dd52844a7ee19ec9b8c3ebfd)) * drop node8 support, support for async iterators ([#145](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/145)) ([cc4cc51](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/cc4cc51ec7b1ff8d5078b8524a9e7240639d72c3)) * export protos in src/index.ts ([ffd77ca](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/ffd77caffcec5d341517e7b82e58d1c50288ea22)) * introduces style enumeration ([#234](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/234)) ([35f1bb6](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/35f1bb6de0d16a10cc9e18ab7cf5aadd332bd0d8)) * load protos from JSON, grpc-fallback support ([7a4b2a6](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/7a4b2a65d7157ee8d8bac099df0c09b6778ad370)) * move to typescript code generation ([#87](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/87)) ([11051db](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/11051db91512f6abb21988d6b7049ce9904a656c)) * support apiEndpoint override in client constructor ([#30](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/30)) ([1192afd](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/1192afd5358bc567664b33f41c445202204f2bea)) * turns on self-signed JWT feature flag ([#311](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/311)) ([c12da34](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/c12da3410a4ebc87884d9caaaba7c700b396c6b4)) * update scopes and classifications ([#60](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/60)) ([b216630](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/b216630a5abd910e908d0b81d0dfe24a4ddd66b5)) ### Bug Fixes * allow calls with no request, add JSON proto ([ab643f8](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/ab643f88b1422ada8d5b8319dab7ddd440c7bd5c)) * **browser:** check for fetch on window ([#226](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/226)) ([8eb79dd](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/8eb79dd2b9f1eb7d4848aef63bf3bf236928fc67)) * **build:** switch primary branch to main ([#315](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/315)) ([2fc99ad](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/2fc99ad6d478bc98f8d3cf39ba19780b13449db3)) * DEADLINE_EXCEEDED retry code is idempotent ([#10](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/10)) ([746151c](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/746151c38c705cee492758ce2a79d05cd320f6b5)) * **deps:** bump google-gax to 1.7.5 ([#68](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/68)) ([0605bb8](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/0605bb8ce6a246fb31f4d54f4fbc126f1924f331)) * **deps:** google-gax v2.17.0 with mTLS ([#294](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/294)) ([45c12e5](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/45c12e5a7f9dbb40f054f7a4d9da0477010f6b00)) * **deps:** google-gax v2.17.1 ([#297](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/297)) ([15640f1](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/15640f1a4a931caa9ece4b749994e7d6d609200e)) * **deps:** google-gax v2.24.1 ([#309](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/309)) ([de80090](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/de800902327bad13ee6145ecbbb6b90d11cb8f59)) * **deps:** pin TypeScript below 3.7.0 ([0e96508](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/0e965087f253c8474143051c06a955d2797cbcf4)) * **deps:** require google-gax v2.12.0 ([#270](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/270)) ([ab16a25](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/ab16a254b7da037039a51277495e65bbc983f1c7)) * **deps:** update dependency google-gax to v1 ([#17](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/17)) ([0f9e159](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/0f9e1596c84796d65be44c38e1624840c95c9cd2)) * do not modify options object, use defaultScopes ([#222](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/222)) ([807b692](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/807b6925ce52d14b3e7b2afa75fc54da805ce604)) * do not retry request on DEADLINE_EXCEEDED ([a6e9f4a](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/a6e9f4aefe438e25933caab171b2699990b3ba81)) * **docs:** bump the release level to beta ([#76](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/76)) ([8a2e2c0](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/8a2e2c005d5d73a57cff2056cc212736610060a6)) * **docs:** link to reference docs section on googleapis.dev ([#35](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/35)) ([14ada6b](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/14ada6bd3d1eb8e40451cdc86ccb822816c0a789)) * **docs:** move to new client docs URL ([#32](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/32)) ([6a95276](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/6a9527686e10dca0d77c0e7d2c7650bdd3591cd3)) * **docs:** snippets are now replaced in jsdoc comments ([#74](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/74)) ([b3c31fc](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/b3c31fced63701a8e70b5f0ce3373466626ee960)) * enum, bytes, and Long types now accept strings ([394cfd8](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/394cfd824a655245d1430afd68682b51e99b90d3)) * export explicit version from protos.js ([#150](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/150)) ([0bfb3c7](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/0bfb3c74a6eaaa906ee34224675ea8dad2e5a055)) * GoogleAdsError missing using generator version after 1.3.0 ([#279](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/279)) ([6dc35a7](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/6dc35a7c158b3981d7854969d37ff0ddebbbe6de)) * include the correct version of node in a header ([#46](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/46)) ([2cc8099](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/2cc809955043e1dcaf531c765f03188d74c9f59b)) * make request optional in all cases ([#290](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/290)) ([e18a1d1](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/e18a1d1131bed1ce355f9e91811a68b0799ca696)) * pass x-goog-request-params header for streaming calls ([983411e](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/983411e0a115c6be6fe9ac0001d333bfef5e81a8)) * proper fallback option handling ([#180](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/180)) ([52fe53d](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/52fe53d93402d247036b31badde5d57fa4f1ee78)) * proper routing headers ([4d1b1d3](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/4d1b1d31da7e5ca064ad2d26f0a1b1103251bdfa)) * regen protos and tests, formatting ([#169](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/169)) ([731fe3b](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/731fe3b8236478772a7cc311d0c26ee804080184)) * remove eslint, update gax, fix generated protos, run the generator ([#155](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/155)) ([21b09f5](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/21b09f555632c6f36d1a487ccac3567064077a49)) * remove key management API ([#366](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/366)) ([44a5a4b](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/44a5a4be5ee8fedd9258d28cd2151f15961dba5c)) * rename parent to project in SearchRelatedAccountGroupMembershipsRequest ([#370](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/370)) ([aad0883](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/aad0883aa839e16ab76c3057678cf7583652466a)) * synth.py clean up for multiple version ([#172](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/172)) ([ee1c250](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/ee1c2509b43b340a731aa98674ebceeab5ccdb2a)) * Updating WORKSPACE files to use the newest version of the Typescript generator. ([#299](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/299)) ([6787e23](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/6787e23374c3ef97b4f267bf629ae03bf58f321a)) * use compatible version of google-gax ([dfb174a](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/dfb174aa8848f66e83d4f9f125ce3b7aaac282e2)) * use require() to load JSON protos ([#273](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/273)) ([fdbc0fe](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/fdbc0fe7d12c1f70f3f592028c30c455a1526ee2)) ### Build System * update library to use Node 12 ([#374](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/374)) ([4042ae2](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/4042ae2304c92b7c74187c3874807be80ad72537)) * upgrade engines field to >=8.10.0 ([#2](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/2)) ([94d6a49](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/94d6a49c7715734327269f2af0bcde80f6a24b5a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- .../CHANGELOG.md | 74 +++++++++++++++++++ .../package.json | 2 +- ...a.google.cloud.recaptchaenterprise.v1.json | 2 +- ...gle.cloud.recaptchaenterprise.v1beta1.json | 2 +- .../samples/package.json | 2 +- 5 files changed, 78 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 4951b4b6e67..0e223047dd9 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,80 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## 1.0.0 (2022-05-18) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#374) +* rename parent to project in SearchRelatedAccountGroupMembershipsRequest (#370) +* remove key management API (#366) +* Remove RecaptchaEnterpriseServiceV1Beta1Client. +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. +* upgrade engines field to >=8.10.0 (#2) + +### Features + +* add crud support for keys ([#84](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/84)) ([adfc3f9](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/adfc3f954f79110ad73425e2da9381fa6c02152d)) +* add GetMetrics and MigrateKey methods to reCAPTCHA enterprise API ([#318](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/318)) ([55b1adc](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/55b1adc261879db1b073f3ad9cd3453c09d1e8d8)) +* add new reCAPTCHA Enterprise fraud annotations ([#334](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/334)) ([24fdff1](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/24fdff1520fb8ff3192be7d256f7a7875d5803b6)) +* add plural and singular resource descriptor ([#78](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/78)) ([a67ffa7](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/a67ffa751551f4d6346c806e82b2311030b7ab61)) +* add reCAPTCHA Enterprise account defender API methods ([#328](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/328)) ([2099c50](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/2099c503c2bb91347761b083140c66f22b042a0d)) +* Add support for Password Check through the private_password_leak_verification field in the reCAPTCHA Assessment ([#376](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/376)) ([7c1583c](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/7c1583c6854d9a567fd135f5ba1629250fe5f8ce)) +* add the v1 API surface ([#141](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/141)) ([bb1bd33](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/bb1bd33c1f51d37ca8db15ce7579259560250530)) +* deferred client initialization ([#128](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/128)) ([3de999e](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/3de999e1d4efc823dd52844a7ee19ec9b8c3ebfd)) +* drop node8 support, support for async iterators ([#145](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/145)) ([cc4cc51](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/cc4cc51ec7b1ff8d5078b8524a9e7240639d72c3)) +* export protos in src/index.ts ([ffd77ca](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/ffd77caffcec5d341517e7b82e58d1c50288ea22)) +* introduces style enumeration ([#234](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/234)) ([35f1bb6](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/35f1bb6de0d16a10cc9e18ab7cf5aadd332bd0d8)) +* load protos from JSON, grpc-fallback support ([7a4b2a6](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/7a4b2a65d7157ee8d8bac099df0c09b6778ad370)) +* move to typescript code generation ([#87](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/87)) ([11051db](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/11051db91512f6abb21988d6b7049ce9904a656c)) +* support apiEndpoint override in client constructor ([#30](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/30)) ([1192afd](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/1192afd5358bc567664b33f41c445202204f2bea)) +* turns on self-signed JWT feature flag ([#311](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/311)) ([c12da34](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/c12da3410a4ebc87884d9caaaba7c700b396c6b4)) +* update scopes and classifications ([#60](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/60)) ([b216630](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/b216630a5abd910e908d0b81d0dfe24a4ddd66b5)) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([ab643f8](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/ab643f88b1422ada8d5b8319dab7ddd440c7bd5c)) +* **browser:** check for fetch on window ([#226](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/226)) ([8eb79dd](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/8eb79dd2b9f1eb7d4848aef63bf3bf236928fc67)) +* **build:** switch primary branch to main ([#315](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/315)) ([2fc99ad](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/2fc99ad6d478bc98f8d3cf39ba19780b13449db3)) +* DEADLINE_EXCEEDED retry code is idempotent ([#10](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/10)) ([746151c](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/746151c38c705cee492758ce2a79d05cd320f6b5)) +* **deps:** bump google-gax to 1.7.5 ([#68](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/68)) ([0605bb8](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/0605bb8ce6a246fb31f4d54f4fbc126f1924f331)) +* **deps:** google-gax v2.17.0 with mTLS ([#294](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/294)) ([45c12e5](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/45c12e5a7f9dbb40f054f7a4d9da0477010f6b00)) +* **deps:** google-gax v2.17.1 ([#297](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/297)) ([15640f1](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/15640f1a4a931caa9ece4b749994e7d6d609200e)) +* **deps:** google-gax v2.24.1 ([#309](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/309)) ([de80090](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/de800902327bad13ee6145ecbbb6b90d11cb8f59)) +* **deps:** pin TypeScript below 3.7.0 ([0e96508](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/0e965087f253c8474143051c06a955d2797cbcf4)) +* **deps:** require google-gax v2.12.0 ([#270](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/270)) ([ab16a25](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/ab16a254b7da037039a51277495e65bbc983f1c7)) +* **deps:** update dependency google-gax to v1 ([#17](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/17)) ([0f9e159](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/0f9e1596c84796d65be44c38e1624840c95c9cd2)) +* do not modify options object, use defaultScopes ([#222](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/222)) ([807b692](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/807b6925ce52d14b3e7b2afa75fc54da805ce604)) +* do not retry request on DEADLINE_EXCEEDED ([a6e9f4a](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/a6e9f4aefe438e25933caab171b2699990b3ba81)) +* **docs:** bump the release level to beta ([#76](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/76)) ([8a2e2c0](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/8a2e2c005d5d73a57cff2056cc212736610060a6)) +* **docs:** link to reference docs section on googleapis.dev ([#35](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/35)) ([14ada6b](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/14ada6bd3d1eb8e40451cdc86ccb822816c0a789)) +* **docs:** move to new client docs URL ([#32](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/32)) ([6a95276](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/6a9527686e10dca0d77c0e7d2c7650bdd3591cd3)) +* **docs:** snippets are now replaced in jsdoc comments ([#74](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/74)) ([b3c31fc](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/b3c31fced63701a8e70b5f0ce3373466626ee960)) +* enum, bytes, and Long types now accept strings ([394cfd8](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/394cfd824a655245d1430afd68682b51e99b90d3)) +* export explicit version from protos.js ([#150](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/150)) ([0bfb3c7](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/0bfb3c74a6eaaa906ee34224675ea8dad2e5a055)) +* GoogleAdsError missing using generator version after 1.3.0 ([#279](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/279)) ([6dc35a7](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/6dc35a7c158b3981d7854969d37ff0ddebbbe6de)) +* include the correct version of node in a header ([#46](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/46)) ([2cc8099](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/2cc809955043e1dcaf531c765f03188d74c9f59b)) +* make request optional in all cases ([#290](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/290)) ([e18a1d1](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/e18a1d1131bed1ce355f9e91811a68b0799ca696)) +* pass x-goog-request-params header for streaming calls ([983411e](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/983411e0a115c6be6fe9ac0001d333bfef5e81a8)) +* proper fallback option handling ([#180](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/180)) ([52fe53d](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/52fe53d93402d247036b31badde5d57fa4f1ee78)) +* proper routing headers ([4d1b1d3](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/4d1b1d31da7e5ca064ad2d26f0a1b1103251bdfa)) +* regen protos and tests, formatting ([#169](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/169)) ([731fe3b](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/731fe3b8236478772a7cc311d0c26ee804080184)) +* remove eslint, update gax, fix generated protos, run the generator ([#155](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/155)) ([21b09f5](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/21b09f555632c6f36d1a487ccac3567064077a49)) +* remove key management API ([#366](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/366)) ([44a5a4b](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/44a5a4be5ee8fedd9258d28cd2151f15961dba5c)) +* rename parent to project in SearchRelatedAccountGroupMembershipsRequest ([#370](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/370)) ([aad0883](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/aad0883aa839e16ab76c3057678cf7583652466a)) +* synth.py clean up for multiple version ([#172](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/172)) ([ee1c250](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/ee1c2509b43b340a731aa98674ebceeab5ccdb2a)) +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#299](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/299)) ([6787e23](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/6787e23374c3ef97b4f267bf629ae03bf58f321a)) +* use compatible version of google-gax ([dfb174a](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/dfb174aa8848f66e83d4f9f125ce3b7aaac282e2)) +* use require() to load JSON protos ([#273](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/273)) ([fdbc0fe](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/fdbc0fe7d12c1f70f3f592028c30c455a1526ee2)) + + +### Build System + +* update library to use Node 12 ([#374](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/374)) ([4042ae2](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/4042ae2304c92b7c74187c3874807be80ad72537)) +* upgrade engines field to >=8.10.0 ([#2](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/2)) ([94d6a49](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/94d6a49c7715734327269f2af0bcde80f6a24b5a)) + ## [2.5.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.4.0...v2.5.0) (2021-12-10) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 5863f84d0fd..4870c871157 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.5.0", + "version": "1.0.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index 42ee0833041..00932c0c5dd 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "2.5.0", + "version": "1.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json index 0cb6619f3de..ac827a71cd7 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "2.5.0", + "version": "1.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 33d1827aa29..86c2bdb0d67 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.5.0" + "@google-cloud/recaptcha-enterprise": "^1.0.0" }, "devDependencies": { "chai": "^4.2.0", From 62ecc49ee9ed4563f494e094d38a3a688fa551cc Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 19 May 2022 11:18:58 -0400 Subject: [PATCH 228/253] Revert "chore(main): release 1.0.0 (#375)" (#381) This reverts commit 086cb96c21d21821619143f7ebbc33b5ade49a74. --- .../CHANGELOG.md | 74 ------------------- .../package.json | 2 +- ...a.google.cloud.recaptchaenterprise.v1.json | 2 +- ...gle.cloud.recaptchaenterprise.v1beta1.json | 2 +- .../samples/package.json | 2 +- 5 files changed, 4 insertions(+), 78 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 0e223047dd9..4951b4b6e67 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,80 +4,6 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions -## 1.0.0 (2022-05-18) - - -### ⚠ BREAKING CHANGES - -* update library to use Node 12 (#374) -* rename parent to project in SearchRelatedAccountGroupMembershipsRequest (#370) -* remove key management API (#366) -* Remove RecaptchaEnterpriseServiceV1Beta1Client. -* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. -* upgrade engines field to >=8.10.0 (#2) - -### Features - -* add crud support for keys ([#84](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/84)) ([adfc3f9](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/adfc3f954f79110ad73425e2da9381fa6c02152d)) -* add GetMetrics and MigrateKey methods to reCAPTCHA enterprise API ([#318](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/318)) ([55b1adc](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/55b1adc261879db1b073f3ad9cd3453c09d1e8d8)) -* add new reCAPTCHA Enterprise fraud annotations ([#334](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/334)) ([24fdff1](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/24fdff1520fb8ff3192be7d256f7a7875d5803b6)) -* add plural and singular resource descriptor ([#78](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/78)) ([a67ffa7](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/a67ffa751551f4d6346c806e82b2311030b7ab61)) -* add reCAPTCHA Enterprise account defender API methods ([#328](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/328)) ([2099c50](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/2099c503c2bb91347761b083140c66f22b042a0d)) -* Add support for Password Check through the private_password_leak_verification field in the reCAPTCHA Assessment ([#376](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/376)) ([7c1583c](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/7c1583c6854d9a567fd135f5ba1629250fe5f8ce)) -* add the v1 API surface ([#141](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/141)) ([bb1bd33](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/bb1bd33c1f51d37ca8db15ce7579259560250530)) -* deferred client initialization ([#128](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/128)) ([3de999e](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/3de999e1d4efc823dd52844a7ee19ec9b8c3ebfd)) -* drop node8 support, support for async iterators ([#145](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/145)) ([cc4cc51](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/cc4cc51ec7b1ff8d5078b8524a9e7240639d72c3)) -* export protos in src/index.ts ([ffd77ca](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/ffd77caffcec5d341517e7b82e58d1c50288ea22)) -* introduces style enumeration ([#234](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/234)) ([35f1bb6](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/35f1bb6de0d16a10cc9e18ab7cf5aadd332bd0d8)) -* load protos from JSON, grpc-fallback support ([7a4b2a6](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/7a4b2a65d7157ee8d8bac099df0c09b6778ad370)) -* move to typescript code generation ([#87](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/87)) ([11051db](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/11051db91512f6abb21988d6b7049ce9904a656c)) -* support apiEndpoint override in client constructor ([#30](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/30)) ([1192afd](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/1192afd5358bc567664b33f41c445202204f2bea)) -* turns on self-signed JWT feature flag ([#311](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/311)) ([c12da34](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/c12da3410a4ebc87884d9caaaba7c700b396c6b4)) -* update scopes and classifications ([#60](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/60)) ([b216630](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/b216630a5abd910e908d0b81d0dfe24a4ddd66b5)) - - -### Bug Fixes - -* allow calls with no request, add JSON proto ([ab643f8](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/ab643f88b1422ada8d5b8319dab7ddd440c7bd5c)) -* **browser:** check for fetch on window ([#226](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/226)) ([8eb79dd](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/8eb79dd2b9f1eb7d4848aef63bf3bf236928fc67)) -* **build:** switch primary branch to main ([#315](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/315)) ([2fc99ad](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/2fc99ad6d478bc98f8d3cf39ba19780b13449db3)) -* DEADLINE_EXCEEDED retry code is idempotent ([#10](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/10)) ([746151c](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/746151c38c705cee492758ce2a79d05cd320f6b5)) -* **deps:** bump google-gax to 1.7.5 ([#68](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/68)) ([0605bb8](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/0605bb8ce6a246fb31f4d54f4fbc126f1924f331)) -* **deps:** google-gax v2.17.0 with mTLS ([#294](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/294)) ([45c12e5](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/45c12e5a7f9dbb40f054f7a4d9da0477010f6b00)) -* **deps:** google-gax v2.17.1 ([#297](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/297)) ([15640f1](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/15640f1a4a931caa9ece4b749994e7d6d609200e)) -* **deps:** google-gax v2.24.1 ([#309](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/309)) ([de80090](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/de800902327bad13ee6145ecbbb6b90d11cb8f59)) -* **deps:** pin TypeScript below 3.7.0 ([0e96508](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/0e965087f253c8474143051c06a955d2797cbcf4)) -* **deps:** require google-gax v2.12.0 ([#270](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/270)) ([ab16a25](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/ab16a254b7da037039a51277495e65bbc983f1c7)) -* **deps:** update dependency google-gax to v1 ([#17](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/17)) ([0f9e159](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/0f9e1596c84796d65be44c38e1624840c95c9cd2)) -* do not modify options object, use defaultScopes ([#222](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/222)) ([807b692](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/807b6925ce52d14b3e7b2afa75fc54da805ce604)) -* do not retry request on DEADLINE_EXCEEDED ([a6e9f4a](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/a6e9f4aefe438e25933caab171b2699990b3ba81)) -* **docs:** bump the release level to beta ([#76](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/76)) ([8a2e2c0](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/8a2e2c005d5d73a57cff2056cc212736610060a6)) -* **docs:** link to reference docs section on googleapis.dev ([#35](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/35)) ([14ada6b](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/14ada6bd3d1eb8e40451cdc86ccb822816c0a789)) -* **docs:** move to new client docs URL ([#32](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/32)) ([6a95276](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/6a9527686e10dca0d77c0e7d2c7650bdd3591cd3)) -* **docs:** snippets are now replaced in jsdoc comments ([#74](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/74)) ([b3c31fc](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/b3c31fced63701a8e70b5f0ce3373466626ee960)) -* enum, bytes, and Long types now accept strings ([394cfd8](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/394cfd824a655245d1430afd68682b51e99b90d3)) -* export explicit version from protos.js ([#150](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/150)) ([0bfb3c7](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/0bfb3c74a6eaaa906ee34224675ea8dad2e5a055)) -* GoogleAdsError missing using generator version after 1.3.0 ([#279](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/279)) ([6dc35a7](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/6dc35a7c158b3981d7854969d37ff0ddebbbe6de)) -* include the correct version of node in a header ([#46](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/46)) ([2cc8099](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/2cc809955043e1dcaf531c765f03188d74c9f59b)) -* make request optional in all cases ([#290](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/290)) ([e18a1d1](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/e18a1d1131bed1ce355f9e91811a68b0799ca696)) -* pass x-goog-request-params header for streaming calls ([983411e](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/983411e0a115c6be6fe9ac0001d333bfef5e81a8)) -* proper fallback option handling ([#180](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/180)) ([52fe53d](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/52fe53d93402d247036b31badde5d57fa4f1ee78)) -* proper routing headers ([4d1b1d3](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/4d1b1d31da7e5ca064ad2d26f0a1b1103251bdfa)) -* regen protos and tests, formatting ([#169](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/169)) ([731fe3b](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/731fe3b8236478772a7cc311d0c26ee804080184)) -* remove eslint, update gax, fix generated protos, run the generator ([#155](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/155)) ([21b09f5](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/21b09f555632c6f36d1a487ccac3567064077a49)) -* remove key management API ([#366](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/366)) ([44a5a4b](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/44a5a4be5ee8fedd9258d28cd2151f15961dba5c)) -* rename parent to project in SearchRelatedAccountGroupMembershipsRequest ([#370](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/370)) ([aad0883](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/aad0883aa839e16ab76c3057678cf7583652466a)) -* synth.py clean up for multiple version ([#172](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/172)) ([ee1c250](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/ee1c2509b43b340a731aa98674ebceeab5ccdb2a)) -* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#299](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/299)) ([6787e23](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/6787e23374c3ef97b4f267bf629ae03bf58f321a)) -* use compatible version of google-gax ([dfb174a](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/dfb174aa8848f66e83d4f9f125ce3b7aaac282e2)) -* use require() to load JSON protos ([#273](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/273)) ([fdbc0fe](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/fdbc0fe7d12c1f70f3f592028c30c455a1526ee2)) - - -### Build System - -* update library to use Node 12 ([#374](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/374)) ([4042ae2](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/4042ae2304c92b7c74187c3874807be80ad72537)) -* upgrade engines field to >=8.10.0 ([#2](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/2)) ([94d6a49](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/94d6a49c7715734327269f2af0bcde80f6a24b5a)) - ## [2.5.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.4.0...v2.5.0) (2021-12-10) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 4870c871157..5863f84d0fd 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "1.0.0", + "version": "2.5.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index 00932c0c5dd..42ee0833041 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "1.0.0", + "version": "2.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json index ac827a71cd7..0cb6619f3de 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "1.0.0", + "version": "2.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 86c2bdb0d67..33d1827aa29 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^1.0.0" + "@google-cloud/recaptcha-enterprise": "^2.5.0" }, "devDependencies": { "chai": "^4.2.0", From 29a0e7795c0dfa0b7fa6e47bb2cdc7626045030d Mon Sep 17 00:00:00 2001 From: Sita Lakshmi Sangameswaran Date: Thu, 19 May 2022 21:54:45 +0530 Subject: [PATCH 229/253] docs(samples): deleted quickstart file and corresponding test (#353) --- .../README.md | 43 +---------------- .../samples/README.md | 19 -------- .../samples/package.json | 2 +- .../samples/quickstart.js | 47 ------------------- 4 files changed, 3 insertions(+), 108 deletions(-) delete mode 100644 packages/google-cloud-recaptchaenterprise/samples/quickstart.js diff --git a/packages/google-cloud-recaptchaenterprise/README.md b/packages/google-cloud-recaptchaenterprise/README.md index dbfb425e1e5..2d9cca655d9 100644 --- a/packages/google-cloud-recaptchaenterprise/README.md +++ b/packages/google-cloud-recaptchaenterprise/README.md @@ -31,8 +31,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) @@ -54,45 +54,6 @@ npm install @google-cloud/recaptcha-enterprise ``` -### Using the client library - -```javascript -/** - * Instantiate the reCAPTCHA Enterprise client and make request. - * @param {string} projectNumber The project number to use when making requests. - */ -async function main(projectNumber) { - // Create the reCAPTCHA client library. - const { - RecaptchaEnterpriseServiceClient, - } = require('@google-cloud/recaptcha-enterprise'); - const client = new RecaptchaEnterpriseServiceClient(); - - // format the path to the project (it should be prefaced with projects/). - const formattedParent = client.projectPath(projectNumber); - // assessment should contain event with RESPONSE_TOKEN and RECAPTCHA_SITE_KEY: - // "{'event': {'token': 'RESPONSE_TOKEN', 'siteKey': 'RECAPTCHA_SITE_KEY'}}" - const assessment = {}; - - const request = { - parent: formattedParent, - assessment: assessment, - }; - - await client.createAssessment(request); -} - -``` - - - -## Samples - -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-recaptcha-enterprise/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-recaptcha-enterprise/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-recaptcha-enterprise&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | diff --git a/packages/google-cloud-recaptchaenterprise/samples/README.md b/packages/google-cloud-recaptchaenterprise/samples/README.md index a0d2aa1da25..b8c2e765eb3 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/README.md +++ b/packages/google-cloud-recaptchaenterprise/samples/README.md @@ -11,8 +11,6 @@ ## Table of Contents * [Before you begin](#before-you-begin) -* [Samples](#samples) - * [Quickstart](#quickstart) ## Before you begin @@ -25,23 +23,6 @@ Before running the samples, make sure you've followed the steps outlined in `cd ..` -## Samples - - - -### Quickstart - -View the [source code](https://github.com/googleapis/nodejs-recaptcha-enterprise/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-recaptcha-enterprise&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) - -__Usage:__ - - -`node samples/quickstart.js` - - - diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 33d1827aa29..8b1845efac6 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -10,7 +10,7 @@ "*.js" ], "scripts": { - "test": "mocha --timeout 600000 test/*.js" + "test": "echo add tests" }, "dependencies": { "@google-cloud/recaptcha-enterprise": "^2.5.0" diff --git a/packages/google-cloud-recaptchaenterprise/samples/quickstart.js b/packages/google-cloud-recaptchaenterprise/samples/quickstart.js deleted file mode 100644 index 4785a4ef03a..00000000000 --- a/packages/google-cloud-recaptchaenterprise/samples/quickstart.js +++ /dev/null @@ -1,47 +0,0 @@ -// 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. - -'use strict'; - -// [START recaptcha_enterprise_quickstart] -/** - * Instantiate the reCAPTCHA Enterprise client and make request. - * @param {string} projectNumber The project number to use when making requests. - */ -async function main(projectNumber) { - // Create the reCAPTCHA client library. - const { - RecaptchaEnterpriseServiceClient, - } = require('@google-cloud/recaptcha-enterprise'); - const client = new RecaptchaEnterpriseServiceClient(); - - // format the path to the project (it should be prefaced with projects/). - const formattedParent = client.projectPath(projectNumber); - // assessment should contain event with RESPONSE_TOKEN and RECAPTCHA_SITE_KEY: - // "{'event': {'token': 'RESPONSE_TOKEN', 'siteKey': 'RECAPTCHA_SITE_KEY'}}" - const assessment = {}; - - const request = { - parent: formattedParent, - assessment: assessment, - }; - - await client.createAssessment(request); -} -// [END recaptcha_enterprise_quickstart] - -main(...process.argv.slice(2)).catch(err => { - console.error(err); - process.exitCode = 1; -}); From 0ccf0f26716161d731b6ab973aef9fde0883738e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 19 May 2022 12:25:12 -0400 Subject: [PATCH 230/253] chore(main): release 3.0.0 (#380) 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 --- .../CHANGELOG.md | 24 +++++++++++++++++++ .../package.json | 2 +- ...a.google.cloud.recaptchaenterprise.v1.json | 2 +- ...gle.cloud.recaptchaenterprise.v1beta1.json | 2 +- .../samples/package.json | 2 +- 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 4951b4b6e67..e6f446e2497 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,30 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [3.0.0](https://github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.5.0...v3.0.0) (2022-05-19) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#374) +* rename parent to project in SearchRelatedAccountGroupMembershipsRequest (#370) +* remove key management API (#366) + +### Features + +* Add support for Password Check through the private_password_leak_verification field in the reCAPTCHA Assessment ([#376](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/376)) ([7c1583c](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/7c1583c6854d9a567fd135f5ba1629250fe5f8ce)) + + +### Bug Fixes + +* remove key management API ([#366](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/366)) ([44a5a4b](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/44a5a4be5ee8fedd9258d28cd2151f15961dba5c)) +* rename parent to project in SearchRelatedAccountGroupMembershipsRequest ([#370](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/370)) ([aad0883](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/aad0883aa839e16ab76c3057678cf7583652466a)) + + +### Build System + +* update library to use Node 12 ([#374](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/374)) ([4042ae2](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/4042ae2304c92b7c74187c3874807be80ad72537)) + ## [2.5.0](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.4.0...v2.5.0) (2021-12-10) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 5863f84d0fd..d5caf94aaa8 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "2.5.0", + "version": "3.0.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index 42ee0833041..10f57097d1c 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "2.5.0", + "version": "3.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json index 0cb6619f3de..d8a83ed286e 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "2.5.0", + "version": "3.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 8b1845efac6..111aed7cba5 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "echo add tests" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^2.5.0" + "@google-cloud/recaptcha-enterprise": "^3.0.0" }, "devDependencies": { "chai": "^4.2.0", From 4e4cf2aaa0b5cd950fabe957d6f099aed0b0297b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 9 Jun 2022 22:12:22 +0200 Subject: [PATCH 231/253] chore(deps): update dependency jsdoc-region-tag to v2 (#384) 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.2` -> `^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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index d5caf94aaa8..0631fd2b638 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -35,7 +35,7 @@ "gts": "^3.1.0", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", - "jsdoc-region-tag": "^1.0.2", + "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.0.0", "mocha": "^9.2.2", "null-loader": "^4.0.0", From 6fdd84d79f206d5f7ddecf06dfbf6e44d4ced36c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 9 Jun 2022 22:28:25 +0200 Subject: [PATCH 232/253] chore(deps): update dependency jsdoc-fresh to v2 (#383) 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.1` -> `^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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 0631fd2b638..73e893991e2 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -34,7 +34,7 @@ "c8": "^7.0.0", "gts": "^3.1.0", "jsdoc": "^3.6.2", - "jsdoc-fresh": "^1.0.1", + "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.0.0", "mocha": "^9.2.2", From 8556bac3edaaa0778438bf807c740ec378340ef8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 16 Jun 2022 10:46:08 -0700 Subject: [PATCH 233/253] fix: set the right field number for reCAPTCHA private password leak (#385) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: set the right field number for reCAPTCHA private password leak PiperOrigin-RevId: 455215317 Source-Link: https://github.com/googleapis/googleapis/commit/ec8056e2674fd307b889a0b587a83ae033e0db62 Source-Link: https://github.com/googleapis/googleapis-gen/commit/8084ad71ff90f4af666052e46bb955b8e555d4bf Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODA4NGFkNzFmZjkwZjRhZjY2NjA1MmU0NmJiOTU1YjhlNTU1ZDRiZiJ9 * 🦉 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 --- .../cloud/recaptchaenterprise/v1/recaptchaenterprise.proto | 2 +- packages/google-cloud-recaptchaenterprise/protos/protos.js | 4 ++-- packages/google-cloud-recaptchaenterprise/protos/protos.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index 0169ebbd382..7165d1bcc00 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -287,7 +287,7 @@ message Assessment { AccountDefenderAssessment account_defender_assessment = 6; // Password leak verification info. - PrivatePasswordLeakVerification private_password_leak_verification = 7; + PrivatePasswordLeakVerification private_password_leak_verification = 8; } message Event { diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index ac31c2c1f9a..b881746cd64 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -1405,7 +1405,7 @@ if (message.accountDefenderAssessment != null && Object.hasOwnProperty.call(message, "accountDefenderAssessment")) $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.encode(message.accountDefenderAssessment, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.privatePasswordLeakVerification != null && Object.hasOwnProperty.call(message, "privatePasswordLeakVerification")) - $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.encode(message.privatePasswordLeakVerification, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.encode(message.privatePasswordLeakVerification, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -1455,7 +1455,7 @@ case 6: message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.decode(reader, reader.uint32()); break; - case 7: + case 8: message.privatePasswordLeakVerification = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.decode(reader, reader.uint32()); break; default: diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index bb5d252a25f..3168495e966 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -348,7 +348,7 @@ }, "privatePasswordLeakVerification": { "type": "PrivatePasswordLeakVerification", - "id": 7 + "id": 8 } } }, From bb85816293ecfd95c055902d53248222831cd26e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 15:51:03 -0400 Subject: [PATCH 234/253] chore(main): release 3.0.1 (#386) 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-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- ...ippet_metadata.google.cloud.recaptchaenterprise.v1.json | 2 +- ..._metadata.google.cloud.recaptchaenterprise.v1beta1.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index e6f446e2497..92cb58021af 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [3.0.1](https://github.com/googleapis/nodejs-recaptcha-enterprise/compare/v3.0.0...v3.0.1) (2022-06-16) + + +### Bug Fixes + +* set the right field number for reCAPTCHA private password leak ([#385](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/385)) ([1d571f3](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/1d571f3eb1eeb8f83bb52a32a39ee527e8411af1)) + ## [3.0.0](https://github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.5.0...v3.0.0) (2022-05-19) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 73e893991e2..8ed68be097b 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "3.0.0", + "version": "3.0.1", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index 10f57097d1c..49d3dc720ce 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "3.0.0", + "version": "3.0.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json index d8a83ed286e..1ed42059c84 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "3.0.0", + "version": "3.0.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 111aed7cba5..2fe701da060 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "echo add tests" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^3.0.0" + "@google-cloud/recaptcha-enterprise": "^3.0.1" }, "devDependencies": { "chai": "^4.2.0", From a55ba0296bf6a5e3750207c9cfdd488df5d978de 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:31:21 -0700 Subject: [PATCH 235/253] fix(docs): describe fallback rest option (#387) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(docs): describe fallback rest option 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/recaptcha_enterprise_service_client.ts | 11 +++++------ .../recaptcha_enterprise_service_v1_beta1_client.ts | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index 308bb023f36..326f877b976 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -70,7 +70,7 @@ export class RecaptchaEnterpriseServiceClient { * * @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] @@ -93,11 +93,10 @@ export class RecaptchaEnterpriseServiceClient { * 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. diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 1a2a4a3d781..57f2d5ba86b 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -61,7 +61,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * * @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] @@ -84,11 +84,10 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * 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. From 5a14dc4d259da000c8036ca59e9da60cee22a60e 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:22:14 +0000 Subject: [PATCH 236/253] chore(main): release 3.0.2 (#388) :robot: I have created a release *beep* *boop* --- ## [3.0.2](https://github.com/googleapis/nodejs-recaptcha-enterprise/compare/v3.0.1...v3.0.2) (2022-06-30) ### Bug Fixes * **docs:** describe fallback rest option ([#387](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/387)) ([fe11f09](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/fe11f09fb6b12af1194ac63bccec4c6a79f5d9a4)) --- 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-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- ...ippet_metadata.google.cloud.recaptchaenterprise.v1.json | 2 +- ..._metadata.google.cloud.recaptchaenterprise.v1beta1.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 92cb58021af..eaedb9059c5 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [3.0.2](https://github.com/googleapis/nodejs-recaptcha-enterprise/compare/v3.0.1...v3.0.2) (2022-06-30) + + +### Bug Fixes + +* **docs:** describe fallback rest option ([#387](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/387)) ([fe11f09](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/fe11f09fb6b12af1194ac63bccec4c6a79f5d9a4)) + ## [3.0.1](https://github.com/googleapis/nodejs-recaptcha-enterprise/compare/v3.0.0...v3.0.1) (2022-06-16) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 8ed68be097b..734fb734c83 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "3.0.1", + "version": "3.0.2", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index 49d3dc720ce..196d70dca17 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "3.0.1", + "version": "3.0.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json index 1ed42059c84..fd3f10e3bb0 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "3.0.1", + "version": "3.0.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 2fe701da060..5fc894df660 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "echo add tests" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^3.0.1" + "@google-cloud/recaptcha-enterprise": "^3.0.2" }, "devDependencies": { "chai": "^4.2.0", From 344830ac4ff1ad5adea557a32cdd2e555f55ebfc Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Jul 2022 22:56:19 +0200 Subject: [PATCH 237/253] chore(deps): update dependency linkinator to v4 (#393) 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.0` -> `^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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 734fb734c83..30e4bd12667 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -36,7 +36,7 @@ "jsdoc": "^3.6.2", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^2.0.0", + "linkinator": "^4.0.0", "mocha": "^9.2.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", From b5afe74c05f2e16a298ee7f077dce68a2412ad1f 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:04:35 +0000 Subject: [PATCH 238/253] fix: better support for fallback mode (#396) - [ ] 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 --- ..._enterprise_service.annotate_assessment.js | 3 + ...ha_enterprise_service.create_assessment.js | 3 + ...recaptcha_enterprise_service.create_key.js | 3 + ...recaptcha_enterprise_service.delete_key.js | 3 + .../recaptcha_enterprise_service.get_key.js | 3 + ...ecaptcha_enterprise_service.get_metrics.js | 3 + .../recaptcha_enterprise_service.list_keys.js | 3 + ....list_related_account_group_memberships.js | 3 + ...ise_service.list_related_account_groups.js | 3 + ...ecaptcha_enterprise_service.migrate_key.js | 3 + ...earch_related_account_group_memberships.js | 3 + ...recaptcha_enterprise_service.update_key.js | 3 + ...a.google.cloud.recaptchaenterprise.v1.json | 24 +- ...se_service_v1_beta1.annotate_assessment.js | 3 + ...rise_service_v1_beta1.create_assessment.js | 3 + ...gle.cloud.recaptchaenterprise.v1beta1.json | 4 +- .../v1/recaptcha_enterprise_service_client.ts | 20 +- ...tcha_enterprise_service_v1_beta1_client.ts | 3 +- .../gapic_recaptcha_enterprise_service_v1.ts | 195 ++++++++-------- ...cha_enterprise_service_v1_beta1_v1beta1.ts | 214 +++++++++--------- 20 files changed, 284 insertions(+), 218 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js index 4240c455f11..9a5a2ad4a34 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js @@ -23,6 +23,9 @@ function main(name) { // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js index 62cadd841bc..f8d5e56966a 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_assessment.js @@ -23,6 +23,9 @@ function main(parent, assessment) { // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js index 3a016b15615..62f1bfc4222 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.create_key.js @@ -23,6 +23,9 @@ function main(parent, key) { // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js index 4450343750c..c43d4a44ee8 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.delete_key.js @@ -23,6 +23,9 @@ function main(name) { // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js index bc0923e6123..f0ffac910ba 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_key.js @@ -23,6 +23,9 @@ function main(name) { // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js index 8f8c24e17f7..42c35e64d11 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.get_metrics.js @@ -23,6 +23,9 @@ function main(name) { // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js index 2f69a5ef14d..a90e3bfaad3 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_keys.js @@ -23,6 +23,9 @@ function main(parent) { // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js index abef7ca2238..c12e903eb25 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js @@ -23,6 +23,9 @@ function main(parent) { // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js index 9f79ded4268..e4b1eb7c198 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js @@ -23,6 +23,9 @@ function main(parent) { // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js index 1630b4edae7..7437784d6db 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.migrate_key.js @@ -23,6 +23,9 @@ function main(name) { // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js index 6f0a056154a..c06150a8a2b 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js @@ -23,6 +23,9 @@ function main(project) { // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_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-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js index 8714d93b9fa..b50005c503d 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js @@ -23,6 +23,9 @@ function main(key) { // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_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-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index 196d70dca17..5fc778d4a84 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -66,7 +66,7 @@ "segments": [ { "start": 25, - "end": 70, + "end": 73, "type": "FULL" } ], @@ -118,7 +118,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -162,7 +162,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], @@ -210,7 +210,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -250,7 +250,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -294,7 +294,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -334,7 +334,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -374,7 +374,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -414,7 +414,7 @@ "segments": [ { "start": 25, - "end": 67, + "end": 70, "type": "FULL" } ], @@ -462,7 +462,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], @@ -510,7 +510,7 @@ "segments": [ { "start": 25, - "end": 74, + "end": 77, "type": "FULL" } ], diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js index 969aa7f414a..6a17e309ad8 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.annotate_assessment.js @@ -23,6 +23,9 @@ function main(name) { // [START recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_AnnotateAssessment_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-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js index b0ceb63bb86..dd1c7421e2f 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/recaptcha_enterprise_service_v1_beta1.create_assessment.js @@ -23,6 +23,9 @@ function main(parent, assessment) { // [START recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseServiceV1Beta1_CreateAssessment_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-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json index fd3f10e3bb0..53c22960e18 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -66,7 +66,7 @@ "segments": [ { "start": 25, - "end": 69, + "end": 72, "type": "FULL" } ], diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index 326f877b976..e3d86368f18 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -28,7 +28,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'); /** @@ -294,7 +293,8 @@ export class RecaptchaEnterpriseServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1274,7 +1274,7 @@ export class RecaptchaEnterpriseServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listKeys.createStream( - this.innerApiCalls.listKeys as gax.GaxCall, + this.innerApiCalls.listKeys as GaxCall, request, callSettings ); @@ -1325,7 +1325,7 @@ export class RecaptchaEnterpriseServiceClient { this.initialize(); return this.descriptors.page.listKeys.asyncIterate( this.innerApiCalls['listKeys'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -1486,7 +1486,7 @@ export class RecaptchaEnterpriseServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listRelatedAccountGroups.createStream( - this.innerApiCalls.listRelatedAccountGroups as gax.GaxCall, + this.innerApiCalls.listRelatedAccountGroups as GaxCall, request, callSettings ); @@ -1542,7 +1542,7 @@ export class RecaptchaEnterpriseServiceClient { this.initialize(); return this.descriptors.page.listRelatedAccountGroups.asyncIterate( this.innerApiCalls['listRelatedAccountGroups'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -1706,7 +1706,7 @@ export class RecaptchaEnterpriseServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listRelatedAccountGroupMemberships.createStream( - this.innerApiCalls.listRelatedAccountGroupMemberships as gax.GaxCall, + this.innerApiCalls.listRelatedAccountGroupMemberships as GaxCall, request, callSettings ); @@ -1764,7 +1764,7 @@ export class RecaptchaEnterpriseServiceClient { this.initialize(); return this.descriptors.page.listRelatedAccountGroupMemberships.asyncIterate( this.innerApiCalls['listRelatedAccountGroupMemberships'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -1936,7 +1936,7 @@ export class RecaptchaEnterpriseServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchRelatedAccountGroupMemberships.createStream( - this.innerApiCalls.searchRelatedAccountGroupMemberships as gax.GaxCall, + this.innerApiCalls.searchRelatedAccountGroupMemberships as GaxCall, request, callSettings ); @@ -1998,7 +1998,7 @@ export class RecaptchaEnterpriseServiceClient { this.initialize(); return this.descriptors.page.searchRelatedAccountGroupMemberships.asyncIterate( this.innerApiCalls['searchRelatedAccountGroupMemberships'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 57f2d5ba86b..3c872da73c0 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -236,7 +236,8 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index eb80d9146c0..eab3fa483c1 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -113,111 +113,126 @@ function stubAsyncIterationCall( } describe('v1.RecaptchaEnterpriseServiceClient', () => { - it('has servicePath', () => { - const servicePath = - recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient - .servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient + .servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient - .apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - fallback: true, - }); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + fallback: true, + } + ); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.recaptchaEnterpriseServiceStub, undefined); - await client.initialize(); - assert(client.recaptchaEnterpriseServiceStub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.recaptchaEnterpriseServiceStub, undefined); + await client.initialize(); + assert(client.recaptchaEnterpriseServiceStub); + }); - it('has close method for the initialized client', done => { - const client = - new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.recaptchaEnterpriseServiceStub); + client.close().then(() => { + done(); }); - client.initialize(); - assert(client.recaptchaEnterpriseServiceStub); - client.close().then(() => { - done(); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.recaptchaEnterpriseServiceStub, undefined); + client.close().then(() => { + done(); }); - assert.strictEqual(client.recaptchaEnterpriseServiceStub, undefined); - client.close().then(() => { - done(); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + 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 recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + 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('createAssessment', () => { diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts index 0e49aad21a6..8c910f5669e 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts @@ -50,124 +50,132 @@ function stubSimpleCallWithCallback( } describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { - it('has servicePath', () => { - const servicePath = - recaptchaenterpriseservicev1beta1Module.v1beta1 - .RecaptchaEnterpriseServiceV1Beta1Client.servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + recaptchaenterpriseservicev1beta1Module.v1beta1 + .RecaptchaEnterpriseServiceV1Beta1Client.servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - recaptchaenterpriseservicev1beta1Module.v1beta1 - .RecaptchaEnterpriseServiceV1Beta1Client.apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + recaptchaenterpriseservicev1beta1Module.v1beta1 + .RecaptchaEnterpriseServiceV1Beta1Client.apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - recaptchaenterpriseservicev1beta1Module.v1beta1 - .RecaptchaEnterpriseServiceV1Beta1Client.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + recaptchaenterpriseservicev1beta1Module.v1beta1 + .RecaptchaEnterpriseServiceV1Beta1Client.port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - fallback: true, - } - ); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + fallback: true, + } + ); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } + it('has initialize method and supports deferred initialization', async () => { + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual( + client.recaptchaEnterpriseServiceV1Beta1Stub, + undefined ); - assert.strictEqual(client.recaptchaEnterpriseServiceV1Beta1Stub, undefined); - await client.initialize(); - assert(client.recaptchaEnterpriseServiceV1Beta1Stub); - }); + await client.initialize(); + assert(client.recaptchaEnterpriseServiceV1Beta1Stub); + }); - it('has close method for the initialized client', done => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - assert(client.recaptchaEnterpriseServiceV1Beta1Stub); - client.close().then(() => { - done(); + it('has close method for the initialized client', done => { + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.recaptchaEnterpriseServiceV1Beta1Stub); + client.close().then(() => { + done(); + }); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } + it('has close method for the non-initialized client', done => { + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual( + client.recaptchaEnterpriseServiceV1Beta1Stub, + undefined ); - assert.strictEqual(client.recaptchaEnterpriseServiceV1Beta1Stub, undefined); - client.close().then(() => { - done(); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + 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 recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new recaptchaenterpriseservicev1beta1Module.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client( + { + 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('createAssessment', () => { From 468341f6c37521191236a4bef412fa0b23265ae8 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:32 +0000 Subject: [PATCH 239/253] fix: change import long to require (#398) Source-Link: https://github.com/googleapis/synthtool/commit/d229a1258999f599a90a9b674a1c5541e00db588 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e --- .../protos/protos.d.ts | 604 ++- .../protos/protos.js | 3749 ++++++++++++----- .../protos/protos.json | 24 + 3 files changed, 3265 insertions(+), 1112 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 01fb9764176..083b80f101f 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/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 { @@ -218,84 +218,84 @@ export namespace google { namespace RecaptchaEnterpriseService { /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#createAssessment}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|createAssessment}. * @param error Error, if any * @param [response] Assessment */ type CreateAssessmentCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.Assessment) => void; /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#annotateAssessment}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|annotateAssessment}. * @param error Error, if any * @param [response] AnnotateAssessmentResponse */ type AnnotateAssessmentCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse) => void; /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#createKey}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|createKey}. * @param error Error, if any * @param [response] Key */ type CreateKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.Key) => void; /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#listKeys}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|listKeys}. * @param error Error, if any * @param [response] ListKeysResponse */ type ListKeysCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.ListKeysResponse) => void; /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#getKey}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|getKey}. * @param error Error, if any * @param [response] Key */ type GetKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.Key) => void; /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#updateKey}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|updateKey}. * @param error Error, if any * @param [response] Key */ type UpdateKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.Key) => void; /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#deleteKey}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|deleteKey}. * @param error Error, if any * @param [response] Empty */ type DeleteKeyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#migrateKey}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|migrateKey}. * @param error Error, if any * @param [response] Key */ type MigrateKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.Key) => void; /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#getMetrics}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|getMetrics}. * @param error Error, if any * @param [response] Metrics */ type GetMetricsCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.Metrics) => void; /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#listRelatedAccountGroups}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|listRelatedAccountGroups}. * @param error Error, if any * @param [response] ListRelatedAccountGroupsResponse */ type ListRelatedAccountGroupsCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse) => void; /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#listRelatedAccountGroupMemberships}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|listRelatedAccountGroupMemberships}. * @param error Error, if any * @param [response] ListRelatedAccountGroupMembershipsResponse */ type ListRelatedAccountGroupMembershipsCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse) => void; /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#searchRelatedAccountGroupMemberships}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|searchRelatedAccountGroupMemberships}. * @param error Error, if any * @param [response] SearchRelatedAccountGroupMembershipsResponse */ @@ -396,6 +396,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAssessmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AnnotateAssessmentRequest. */ @@ -504,6 +511,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateAssessmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AnnotateAssessmentRequest { @@ -614,6 +628,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateAssessmentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Assessment. */ @@ -734,6 +755,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Assessment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Event. */ @@ -854,6 +882,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Event + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RiskAnalysis. */ @@ -950,6 +985,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RiskAnalysis + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace RiskAnalysis { @@ -1077,6 +1119,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TokenProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace TokenProperties { @@ -1181,6 +1230,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccountDefenderAssessment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AccountDefenderAssessment { @@ -1301,6 +1357,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrivatePasswordLeakVerification + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateKeyRequest. */ @@ -1397,6 +1460,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListKeysRequest. */ @@ -1499,6 +1569,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListKeysRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListKeysResponse. */ @@ -1595,6 +1672,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListKeysResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetKeyRequest. */ @@ -1685,6 +1769,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateKeyRequest. */ @@ -1781,6 +1872,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteKeyRequest. */ @@ -1871,6 +1969,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a MigrateKeyRequest. */ @@ -1961,6 +2066,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MigrateKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetMetricsRequest. */ @@ -2051,6 +2163,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMetricsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Metrics. */ @@ -2159,6 +2278,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Key. */ @@ -2300,6 +2426,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TestingOptions. */ @@ -2396,6 +2529,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestingOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace TestingOptions { @@ -2520,6 +2660,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebKeySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace WebKeySettings { @@ -2635,6 +2782,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AndroidKeySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a IOSKeySettings. */ @@ -2731,6 +2885,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IOSKeySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ScoreDistribution. */ @@ -2821,6 +2982,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScoreDistribution + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ScoreMetrics. */ @@ -2917,6 +3085,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScoreMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ChallengeMetrics. */ @@ -3025,6 +3200,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChallengeMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListRelatedAccountGroupMembershipsRequest. */ @@ -3127,6 +3309,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRelatedAccountGroupMembershipsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListRelatedAccountGroupMembershipsResponse. */ @@ -3223,6 +3412,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRelatedAccountGroupMembershipsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListRelatedAccountGroupsRequest. */ @@ -3325,6 +3521,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRelatedAccountGroupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListRelatedAccountGroupsResponse. */ @@ -3421,6 +3624,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRelatedAccountGroupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SearchRelatedAccountGroupMembershipsRequest. */ @@ -3529,6 +3739,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchRelatedAccountGroupMembershipsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SearchRelatedAccountGroupMembershipsResponse. */ @@ -3625,6 +3842,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchRelatedAccountGroupMembershipsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RelatedAccountGroupMembership. */ @@ -3721,6 +3945,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelatedAccountGroupMembership + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RelatedAccountGroup. */ @@ -3811,6 +4042,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelatedAccountGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a WafSettings. */ @@ -3907,6 +4145,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WafSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace WafSettings { @@ -3982,14 +4227,14 @@ export namespace google { namespace RecaptchaEnterpriseServiceV1Beta1 { /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#createAssessment}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1|createAssessment}. * @param error Error, if any * @param [response] Assessment */ type CreateAssessmentCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1beta1.Assessment) => void; /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#annotateAssessment}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1|annotateAssessment}. * @param error Error, if any * @param [response] AnnotateAssessmentResponse */ @@ -4090,6 +4335,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAssessmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AnnotateAssessmentRequest. */ @@ -4198,6 +4450,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateAssessmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AnnotateAssessmentRequest { @@ -4308,6 +4567,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateAssessmentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a PasswordLeakVerification. */ @@ -4410,6 +4676,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PasswordLeakVerification + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Assessment. */ @@ -4536,6 +4809,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Assessment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Assessment { @@ -4669,6 +4949,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Event + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TokenProperties. */ @@ -4783,6 +5070,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TokenProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace TokenProperties { @@ -4888,6 +5182,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccountDefenderAssessment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AccountDefenderAssessment { @@ -5002,6 +5303,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. */ @@ -5149,6 +5457,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. */ @@ -5245,6 +5560,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. */ @@ -5383,6 +5705,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 { @@ -5495,6 +5824,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; } } @@ -5589,6 +5925,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. */ @@ -5629,6 +5972,9 @@ export namespace google { /** FileDescriptorProto syntax */ syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); } /** Represents a FileDescriptorProto. */ @@ -5676,6 +6022,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 @@ -5745,6 +6094,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. */ @@ -5889,6 +6245,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 { @@ -5993,6 +6356,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. */ @@ -6089,6 +6459,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; } } @@ -6180,6 +6557,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. */ @@ -6330,6 +6714,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 { @@ -6458,6 +6849,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. */ @@ -6572,6 +6970,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 { @@ -6670,6 +7075,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; } } @@ -6773,6 +7185,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. */ @@ -6875,6 +7294,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. */ @@ -6995,6 +7421,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. */ @@ -7208,6 +7641,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 { @@ -7335,6 +7775,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. */ @@ -7352,6 +7799,9 @@ export namespace google { /** FieldOptions lazy */ lazy?: (boolean|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + /** FieldOptions deprecated */ deprecated?: (boolean|null); @@ -7389,6 +7839,9 @@ export namespace google { /** FieldOptions lazy. */ public lazy: boolean; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + /** FieldOptions deprecated. */ public deprecated: boolean; @@ -7467,6 +7920,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 { @@ -7574,6 +8034,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. */ @@ -7676,6 +8143,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. */ @@ -7772,6 +8246,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. */ @@ -7874,6 +8355,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. */ @@ -7982,6 +8470,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 { @@ -8118,6 +8613,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 { @@ -8216,6 +8718,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; } } @@ -8307,6 +8816,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 { @@ -8423,6 +8939,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; } } @@ -8514,6 +9037,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 { @@ -8532,6 +9062,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. */ @@ -8555,6 +9088,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 @@ -8624,6 +9160,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 + } } } @@ -8709,6 +9262,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. */ @@ -8799,6 +9359,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. */ @@ -8895,6 +9462,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; } } } diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index b881746cd64..7d23149aeda 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -99,7 +99,7 @@ }; /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#createAssessment}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|createAssessment}. * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService * @typedef CreateAssessmentCallback * @type {function} @@ -132,7 +132,7 @@ */ /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#annotateAssessment}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|annotateAssessment}. * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService * @typedef AnnotateAssessmentCallback * @type {function} @@ -165,7 +165,7 @@ */ /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#createKey}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|createKey}. * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService * @typedef CreateKeyCallback * @type {function} @@ -198,7 +198,7 @@ */ /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#listKeys}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|listKeys}. * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService * @typedef ListKeysCallback * @type {function} @@ -231,7 +231,7 @@ */ /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#getKey}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|getKey}. * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService * @typedef GetKeyCallback * @type {function} @@ -264,7 +264,7 @@ */ /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#updateKey}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|updateKey}. * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService * @typedef UpdateKeyCallback * @type {function} @@ -297,7 +297,7 @@ */ /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#deleteKey}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|deleteKey}. * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService * @typedef DeleteKeyCallback * @type {function} @@ -330,7 +330,7 @@ */ /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#migrateKey}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|migrateKey}. * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService * @typedef MigrateKeyCallback * @type {function} @@ -363,7 +363,7 @@ */ /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#getMetrics}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|getMetrics}. * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService * @typedef GetMetricsCallback * @type {function} @@ -396,7 +396,7 @@ */ /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#listRelatedAccountGroups}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|listRelatedAccountGroups}. * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService * @typedef ListRelatedAccountGroupsCallback * @type {function} @@ -429,7 +429,7 @@ */ /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#listRelatedAccountGroupMemberships}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|listRelatedAccountGroupMemberships}. * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService * @typedef ListRelatedAccountGroupMembershipsCallback * @type {function} @@ -462,7 +462,7 @@ */ /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService#searchRelatedAccountGroupMemberships}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|searchRelatedAccountGroupMemberships}. * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService * @typedef SearchRelatedAccountGroupMembershipsCallback * @type {function} @@ -600,12 +600,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.assessment = $root.google.cloud.recaptchaenterprise.v1.Assessment.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.assessment = $root.google.cloud.recaptchaenterprise.v1.Assessment.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -709,6 +711,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateAssessmentRequest + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAssessmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest"; + }; + return CreateAssessmentRequest; })(); @@ -842,25 +859,29 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.annotation = reader.int32(); - break; - case 3: - if (!(message.reasons && message.reasons.length)) - message.reasons = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.annotation = reader.int32(); + break; + } + case 3: { + if (!(message.reasons && message.reasons.length)) + message.reasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.reasons.push(reader.int32()); + } else message.reasons.push(reader.int32()); - } else - message.reasons.push(reader.int32()); - break; - case 4: - message.hashedAccountId = reader.bytes(); - break; + break; + } + case 4: { + message.hashedAccountId = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -1024,7 +1045,7 @@ if (object.hashedAccountId != null) if (typeof object.hashedAccountId === "string") $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); - else if (object.hashedAccountId.length) + else if (object.hashedAccountId.length >= 0) message.hashedAccountId = object.hashedAccountId; return message; }; @@ -1080,6 +1101,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnnotateAssessmentRequest + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateAssessmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest"; + }; + /** * Annotation enum. * @name google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation @@ -1290,6 +1326,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnnotateAssessmentResponse + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateAssessmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse"; + }; + return AnnotateAssessmentResponse; })(); @@ -1440,24 +1491,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.event = $root.google.cloud.recaptchaenterprise.v1.Event.decode(reader, reader.uint32()); - break; - case 3: - message.riskAnalysis = $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.decode(reader, reader.uint32()); - break; - case 4: - message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.decode(reader, reader.uint32()); - break; - case 6: - message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.decode(reader, reader.uint32()); - break; - case 8: - message.privatePasswordLeakVerification = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.event = $root.google.cloud.recaptchaenterprise.v1.Event.decode(reader, reader.uint32()); + break; + } + case 3: { + message.riskAnalysis = $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.decode(reader, reader.uint32()); + break; + } + case 4: { + message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.decode(reader, reader.uint32()); + break; + } + case 6: { + message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.decode(reader, reader.uint32()); + break; + } + case 8: { + message.privatePasswordLeakVerification = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -1613,6 +1670,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Assessment + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Assessment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.Assessment"; + }; + return Assessment; })(); @@ -1763,24 +1835,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.token = reader.string(); - break; - case 2: - message.siteKey = reader.string(); - break; - case 3: - message.userAgent = reader.string(); - break; - case 4: - message.userIpAddress = reader.string(); - break; - case 5: - message.expectedAction = reader.string(); - break; - case 6: - message.hashedAccountId = reader.bytes(); - break; + case 1: { + message.token = reader.string(); + break; + } + case 2: { + message.siteKey = reader.string(); + break; + } + case 3: { + message.userAgent = reader.string(); + break; + } + case 4: { + message.userIpAddress = reader.string(); + break; + } + case 5: { + message.expectedAction = reader.string(); + break; + } + case 6: { + message.hashedAccountId = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -1862,7 +1940,7 @@ if (object.hashedAccountId != null) if (typeof object.hashedAccountId === "string") $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); - else if (object.hashedAccountId.length) + else if (object.hashedAccountId.length >= 0) message.hashedAccountId = object.hashedAccountId; return message; }; @@ -1920,6 +1998,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Event + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.Event"; + }; + return Event; })(); @@ -2031,19 +2124,21 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.score = reader.float(); - break; - case 2: - if (!(message.reasons && message.reasons.length)) - message.reasons = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.score = reader.float(); + break; + } + case 2: { + if (!(message.reasons && message.reasons.length)) + message.reasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.reasons.push(reader.int32()); + } else message.reasons.push(reader.int32()); - } else - message.reasons.push(reader.int32()); - break; + break; + } default: reader.skipType(tag & 7); break; @@ -2189,6 +2284,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RiskAnalysis + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RiskAnalysis.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.RiskAnalysis"; + }; + /** * ClassificationReason enum. * @name google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason @@ -2350,21 +2460,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.valid = reader.bool(); - break; - case 2: - message.invalidReason = reader.int32(); - break; - case 3: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 4: - message.hostname = reader.string(); - break; - case 5: - message.action = reader.string(); - break; + case 1: { + message.valid = reader.bool(); + break; + } + case 2: { + message.invalidReason = reader.int32(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.hostname = reader.string(); + break; + } + case 5: { + message.action = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -2530,6 +2645,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TokenProperties + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.TokenProperties"; + }; + /** * InvalidReason enum. * @name google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason @@ -2654,16 +2784,17 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.labels && message.labels.length)) - message.labels = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + if (!(message.labels && message.labels.length)) + message.labels = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.labels.push(reader.int32()); + } else message.labels.push(reader.int32()); - } else - message.labels.push(reader.int32()); - break; + break; + } default: reader.skipType(tag & 7); break; @@ -2795,6 +2926,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AccountDefenderAssessment + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountDefenderAssessment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment"; + }; + /** * AccountDefenderLabel enum. * @name google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel @@ -2945,20 +3091,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.lookupHashPrefix = reader.bytes(); - break; - case 2: - message.encryptedUserCredentialsHash = reader.bytes(); - break; - case 3: - if (!(message.encryptedLeakMatchPrefixes && message.encryptedLeakMatchPrefixes.length)) - message.encryptedLeakMatchPrefixes = []; - message.encryptedLeakMatchPrefixes.push(reader.bytes()); - break; - case 4: - message.reencryptedUserCredentialsHash = reader.bytes(); - break; + case 1: { + message.lookupHashPrefix = reader.bytes(); + break; + } + case 2: { + message.encryptedUserCredentialsHash = reader.bytes(); + break; + } + case 3: { + if (!(message.encryptedLeakMatchPrefixes && message.encryptedLeakMatchPrefixes.length)) + message.encryptedLeakMatchPrefixes = []; + message.encryptedLeakMatchPrefixes.push(reader.bytes()); + break; + } + case 4: { + message.reencryptedUserCredentialsHash = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -3028,12 +3178,12 @@ if (object.lookupHashPrefix != null) if (typeof object.lookupHashPrefix === "string") $util.base64.decode(object.lookupHashPrefix, message.lookupHashPrefix = $util.newBuffer($util.base64.length(object.lookupHashPrefix)), 0); - else if (object.lookupHashPrefix.length) + else if (object.lookupHashPrefix.length >= 0) message.lookupHashPrefix = object.lookupHashPrefix; if (object.encryptedUserCredentialsHash != null) if (typeof object.encryptedUserCredentialsHash === "string") $util.base64.decode(object.encryptedUserCredentialsHash, message.encryptedUserCredentialsHash = $util.newBuffer($util.base64.length(object.encryptedUserCredentialsHash)), 0); - else if (object.encryptedUserCredentialsHash.length) + else if (object.encryptedUserCredentialsHash.length >= 0) message.encryptedUserCredentialsHash = object.encryptedUserCredentialsHash; if (object.encryptedLeakMatchPrefixes) { if (!Array.isArray(object.encryptedLeakMatchPrefixes)) @@ -3042,13 +3192,13 @@ for (var i = 0; i < object.encryptedLeakMatchPrefixes.length; ++i) if (typeof object.encryptedLeakMatchPrefixes[i] === "string") $util.base64.decode(object.encryptedLeakMatchPrefixes[i], message.encryptedLeakMatchPrefixes[i] = $util.newBuffer($util.base64.length(object.encryptedLeakMatchPrefixes[i])), 0); - else if (object.encryptedLeakMatchPrefixes[i].length) + else if (object.encryptedLeakMatchPrefixes[i].length >= 0) message.encryptedLeakMatchPrefixes[i] = object.encryptedLeakMatchPrefixes[i]; } if (object.reencryptedUserCredentialsHash != null) if (typeof object.reencryptedUserCredentialsHash === "string") $util.base64.decode(object.reencryptedUserCredentialsHash, message.reencryptedUserCredentialsHash = $util.newBuffer($util.base64.length(object.reencryptedUserCredentialsHash)), 0); - else if (object.reencryptedUserCredentialsHash.length) + else if (object.reencryptedUserCredentialsHash.length >= 0) message.reencryptedUserCredentialsHash = object.reencryptedUserCredentialsHash; return message; }; @@ -3116,6 +3266,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for PrivatePasswordLeakVerification + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrivatePasswordLeakVerification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification"; + }; + return PrivatePasswordLeakVerification; })(); @@ -3222,12 +3387,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.key = $root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.key = $root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3331,6 +3498,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateKeyRequest + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.CreateKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.CreateKeyRequest"; + }; + return CreateKeyRequest; })(); @@ -3448,15 +3630,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3563,6 +3748,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListKeysRequest + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListKeysRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ListKeysRequest"; + }; + return ListKeysRequest; })(); @@ -3671,14 +3871,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3794,6 +3996,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListKeysResponse + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListKeysResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ListKeysResponse"; + }; + return ListKeysResponse; })(); @@ -3889,9 +4106,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; @@ -3981,6 +4199,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetKeyRequest + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.GetKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.GetKeyRequest"; + }; + return GetKeyRequest; })(); @@ -4087,12 +4320,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.key = $root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.key = $root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -4201,6 +4436,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateKeyRequest + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.UpdateKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.UpdateKeyRequest"; + }; + return UpdateKeyRequest; })(); @@ -4296,9 +4546,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; @@ -4388,6 +4639,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteKeyRequest + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.DeleteKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.DeleteKeyRequest"; + }; + return DeleteKeyRequest; })(); @@ -4483,9 +4749,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; @@ -4575,6 +4842,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MigrateKeyRequest + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.MigrateKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MigrateKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.MigrateKeyRequest"; + }; + return MigrateKeyRequest; })(); @@ -4670,9 +4952,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; @@ -4762,6 +5045,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetMetricsRequest + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.GetMetricsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMetricsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.GetMetricsRequest"; + }; + return GetMetricsRequest; })(); @@ -4894,22 +5192,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: - message.name = reader.string(); - break; - case 1: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.scoreMetrics && message.scoreMetrics.length)) - message.scoreMetrics = []; - message.scoreMetrics.push($root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.challengeMetrics && message.challengeMetrics.length)) - message.challengeMetrics = []; - message.challengeMetrics.push($root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.decode(reader, reader.uint32())); - break; + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.scoreMetrics && message.scoreMetrics.length)) + message.scoreMetrics = []; + message.scoreMetrics.push($root.google.cloud.recaptchaenterprise.v1.ScoreMetrics.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.challengeMetrics && message.challengeMetrics.length)) + message.challengeMetrics = []; + message.challengeMetrics.push($root.google.cloud.recaptchaenterprise.v1.ChallengeMetrics.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -5065,6 +5367,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Metrics + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.Metrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.Metrics"; + }; + return Metrics; })(); @@ -5264,52 +5581,61 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - message.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.decode(reader, reader.uint32()); - break; - case 4: - message.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.decode(reader, reader.uint32()); - break; - case 5: - message.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.decode(reader, reader.uint32()); - break; - case 6: - 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: { + message.webSettings = $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.decode(reader, reader.uint32()); + break; + } + case 4: { + message.androidSettings = $root.google.cloud.recaptchaenterprise.v1.AndroidKeySettings.decode(reader, reader.uint32()); + break; + } + case 5: { + message.iosSettings = $root.google.cloud.recaptchaenterprise.v1.IOSKeySettings.decode(reader, reader.uint32()); + break; + } + case 6: { + 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 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.decode(reader, reader.uint32()); + break; + } + case 10: { + message.wafSettings = $root.google.cloud.recaptchaenterprise.v1.WafSettings.decode(reader, reader.uint32()); + break; } - message.labels[key] = value; - break; - case 7: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 9: - message.testingOptions = $root.google.cloud.recaptchaenterprise.v1.TestingOptions.decode(reader, reader.uint32()); - break; - case 10: - message.wafSettings = $root.google.cloud.recaptchaenterprise.v1.WafSettings.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -5529,6 +5855,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.Key"; + }; + return Key; })(); @@ -5635,12 +5976,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.testingScore = reader.float(); - break; - case 2: - message.testingChallenge = reader.int32(); - break; + case 1: { + message.testingScore = reader.float(); + break; + } + case 2: { + message.testingChallenge = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -5757,6 +6100,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TestingOptions + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.TestingOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestingOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.TestingOptions"; + }; + /** * TestingChallenge enum. * @name google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge @@ -5914,23 +6272,28 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.allowAllDomains = reader.bool(); - break; - case 1: - if (!(message.allowedDomains && message.allowedDomains.length)) - message.allowedDomains = []; - message.allowedDomains.push(reader.string()); - break; - case 2: - message.allowAmpTraffic = reader.bool(); - break; - case 4: - message.integrationType = reader.int32(); - break; - case 5: - message.challengeSecurityPreference = reader.int32(); - break; + case 3: { + message.allowAllDomains = reader.bool(); + break; + } + case 1: { + if (!(message.allowedDomains && message.allowedDomains.length)) + message.allowedDomains = []; + message.allowedDomains.push(reader.string()); + break; + } + case 2: { + message.allowAmpTraffic = reader.bool(); + break; + } + case 4: { + message.integrationType = reader.int32(); + break; + } + case 5: { + message.challengeSecurityPreference = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -6112,6 +6475,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for WebKeySettings + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.WebKeySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebKeySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.WebKeySettings"; + }; + /** * IntegrationType enum. * @name google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType @@ -6256,14 +6634,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.allowAllPackageNames = reader.bool(); - break; - case 1: - if (!(message.allowedPackageNames && message.allowedPackageNames.length)) - message.allowedPackageNames = []; - message.allowedPackageNames.push(reader.string()); - break; + case 2: { + message.allowAllPackageNames = reader.bool(); + break; + } + case 1: { + if (!(message.allowedPackageNames && message.allowedPackageNames.length)) + message.allowedPackageNames = []; + message.allowedPackageNames.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -6374,6 +6754,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AndroidKeySettings + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.AndroidKeySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AndroidKeySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.AndroidKeySettings"; + }; + return AndroidKeySettings; })(); @@ -6482,14 +6877,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.allowAllBundleIds = reader.bool(); - break; - case 1: - if (!(message.allowedBundleIds && message.allowedBundleIds.length)) - message.allowedBundleIds = []; - message.allowedBundleIds.push(reader.string()); - break; + case 2: { + message.allowAllBundleIds = reader.bool(); + break; + } + case 1: { + if (!(message.allowedBundleIds && message.allowedBundleIds.length)) + message.allowedBundleIds = []; + message.allowedBundleIds.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -6600,6 +6997,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IOSKeySettings + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.IOSKeySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IOSKeySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.IOSKeySettings"; + }; + return IOSKeySettings; })(); @@ -6697,28 +7109,29 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (message.scoreBuckets === $util.emptyObject) - message.scoreBuckets = {}; - var end2 = reader.uint32() + reader.pos; - key = 0; - value = 0; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.int32(); - break; - case 2: - value = reader.int64(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + if (message.scoreBuckets === $util.emptyObject) + message.scoreBuckets = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.int32(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.scoreBuckets[key] = value; + break; } - message.scoreBuckets[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -6835,6 +7248,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ScoreDistribution + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.ScoreDistribution + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScoreDistribution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ScoreDistribution"; + }; + return ScoreDistribution; })(); @@ -6945,31 +7373,33 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.overallMetrics = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.decode(reader, reader.uint32()); - break; - case 2: - if (message.actionMetrics === $util.emptyObject) - message.actionMetrics = {}; - 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.recaptchaenterprise.v1.ScoreDistribution.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.overallMetrics = $root.google.cloud.recaptchaenterprise.v1.ScoreDistribution.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.actionMetrics === $util.emptyObject) + message.actionMetrics = {}; + 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.recaptchaenterprise.v1.ScoreDistribution.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.actionMetrics[key] = value; + break; } - message.actionMetrics[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -7092,6 +7522,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ScoreMetrics + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.ScoreMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScoreMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ScoreMetrics"; + }; + return ScoreMetrics; })(); @@ -7220,18 +7665,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.pageloadCount = reader.int64(); - break; - case 2: - message.nocaptchaCount = reader.int64(); - break; - case 3: - message.failedCount = reader.int64(); - break; - case 4: - message.passedCount = reader.int64(); - break; + case 1: { + message.pageloadCount = reader.int64(); + break; + } + case 2: { + message.nocaptchaCount = reader.int64(); + break; + } + case 3: { + message.failedCount = reader.int64(); + break; + } + case 4: { + message.passedCount = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -7402,6 +7851,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ChallengeMetrics + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.ChallengeMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChallengeMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ChallengeMetrics"; + }; + return ChallengeMetrics; })(); @@ -7519,15 +7983,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -7634,6 +8101,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListRelatedAccountGroupMembershipsRequest + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRelatedAccountGroupMembershipsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest"; + }; + return ListRelatedAccountGroupMembershipsRequest; })(); @@ -7742,14 +8224,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.relatedAccountGroupMemberships && message.relatedAccountGroupMemberships.length)) - message.relatedAccountGroupMemberships = []; - message.relatedAccountGroupMemberships.push($root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.relatedAccountGroupMemberships && message.relatedAccountGroupMemberships.length)) + message.relatedAccountGroupMemberships = []; + message.relatedAccountGroupMemberships.push($root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -7865,6 +8349,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListRelatedAccountGroupMembershipsResponse + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRelatedAccountGroupMembershipsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsResponse"; + }; + return ListRelatedAccountGroupMembershipsResponse; })(); @@ -7982,15 +8481,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -8097,6 +8599,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListRelatedAccountGroupsRequest + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRelatedAccountGroupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest"; + }; + return ListRelatedAccountGroupsRequest; })(); @@ -8205,14 +8722,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.relatedAccountGroups && message.relatedAccountGroups.length)) - message.relatedAccountGroups = []; - message.relatedAccountGroups.push($root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.relatedAccountGroups && message.relatedAccountGroups.length)) + message.relatedAccountGroups = []; + message.relatedAccountGroups.push($root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -8328,6 +8847,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListRelatedAccountGroupsResponse + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRelatedAccountGroupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse"; + }; + return ListRelatedAccountGroupsResponse; })(); @@ -8456,18 +8990,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.project = reader.string(); - break; - case 2: - message.hashedAccountId = reader.bytes(); - break; - case 3: - message.pageSize = reader.int32(); - break; - case 4: - message.pageToken = reader.string(); - break; + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.hashedAccountId = reader.bytes(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -8535,7 +9073,7 @@ if (object.hashedAccountId != null) if (typeof object.hashedAccountId === "string") $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); - else if (object.hashedAccountId.length) + else if (object.hashedAccountId.length >= 0) message.hashedAccountId = object.hashedAccountId; if (object.pageSize != null) message.pageSize = object.pageSize | 0; @@ -8591,6 +9129,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SearchRelatedAccountGroupMembershipsRequest + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchRelatedAccountGroupMembershipsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest"; + }; + return SearchRelatedAccountGroupMembershipsRequest; })(); @@ -8699,14 +9252,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.relatedAccountGroupMemberships && message.relatedAccountGroupMemberships.length)) - message.relatedAccountGroupMemberships = []; - message.relatedAccountGroupMemberships.push($root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.relatedAccountGroupMemberships && message.relatedAccountGroupMemberships.length)) + message.relatedAccountGroupMemberships = []; + message.relatedAccountGroupMemberships.push($root.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -8822,6 +9377,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SearchRelatedAccountGroupMembershipsResponse + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchRelatedAccountGroupMembershipsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse"; + }; + return SearchRelatedAccountGroupMembershipsResponse; })(); @@ -8928,12 +9498,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.hashedAccountId = reader.bytes(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.hashedAccountId = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -8995,7 +9567,7 @@ if (object.hashedAccountId != null) if (typeof object.hashedAccountId === "string") $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); - else if (object.hashedAccountId.length) + else if (object.hashedAccountId.length >= 0) message.hashedAccountId = object.hashedAccountId; return message; }; @@ -9041,6 +9613,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RelatedAccountGroupMembership + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelatedAccountGroupMembership.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership"; + }; + return RelatedAccountGroupMembership; })(); @@ -9136,9 +9723,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; @@ -9228,6 +9816,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RelatedAccountGroup + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.RelatedAccountGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelatedAccountGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.RelatedAccountGroup"; + }; + return RelatedAccountGroup; })(); @@ -9334,12 +9937,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.wafService = reader.int32(); - break; - case 2: - message.wafFeature = reader.int32(); - break; + case 1: { + message.wafService = reader.int32(); + break; + } + case 2: { + message.wafFeature = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -9474,6 +10079,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for WafSettings + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.WafSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WafSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.WafSettings"; + }; + /** * WafFeature enum. * @name google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature @@ -9554,7 +10174,7 @@ }; /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#createAssessment}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1|createAssessment}. * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 * @typedef CreateAssessmentCallback * @type {function} @@ -9587,7 +10207,7 @@ */ /** - * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1#annotateAssessment}. + * Callback as used by {@link google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1|annotateAssessment}. * @memberof google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1 * @typedef AnnotateAssessmentCallback * @type {function} @@ -9725,12 +10345,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.assessment = $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.assessment = $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -9834,6 +10456,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateAssessmentRequest + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAssessmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest"; + }; + return CreateAssessmentRequest; })(); @@ -9967,25 +10604,29 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.annotation = reader.int32(); - break; - case 3: - if (!(message.reasons && message.reasons.length)) - message.reasons = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.annotation = reader.int32(); + break; + } + case 3: { + if (!(message.reasons && message.reasons.length)) + message.reasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.reasons.push(reader.int32()); + } else message.reasons.push(reader.int32()); - } else - message.reasons.push(reader.int32()); - break; - case 4: - message.hashedAccountId = reader.bytes(); - break; + break; + } + case 4: { + message.hashedAccountId = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -10149,7 +10790,7 @@ if (object.hashedAccountId != null) if (typeof object.hashedAccountId === "string") $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); - else if (object.hashedAccountId.length) + else if (object.hashedAccountId.length >= 0) message.hashedAccountId = object.hashedAccountId; return message; }; @@ -10205,6 +10846,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnnotateAssessmentRequest + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateAssessmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest"; + }; + /** * Annotation enum. * @name google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation @@ -10415,6 +11071,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnnotateAssessmentResponse + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateAssessmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse"; + }; + return AnnotateAssessmentResponse; })(); @@ -10532,15 +11203,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.hashedUserCredentials = reader.bytes(); - break; - case 2: - message.credentialsLeaked = reader.bool(); - break; - case 3: - message.canonicalizedUsername = reader.string(); - break; + case 1: { + message.hashedUserCredentials = reader.bytes(); + break; + } + case 2: { + message.credentialsLeaked = reader.bool(); + break; + } + case 3: { + message.canonicalizedUsername = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -10603,7 +11277,7 @@ if (object.hashedUserCredentials != null) if (typeof object.hashedUserCredentials === "string") $util.base64.decode(object.hashedUserCredentials, message.hashedUserCredentials = $util.newBuffer($util.base64.length(object.hashedUserCredentials)), 0); - else if (object.hashedUserCredentials.length) + else if (object.hashedUserCredentials.length >= 0) message.hashedUserCredentials = object.hashedUserCredentials; if (object.credentialsLeaked != null) message.credentialsLeaked = Boolean(object.credentialsLeaked); @@ -10656,6 +11330,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for PasswordLeakVerification + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PasswordLeakVerification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification"; + }; + return PasswordLeakVerification; })(); @@ -10822,34 +11511,41 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.event = $root.google.cloud.recaptchaenterprise.v1beta1.Event.decode(reader, reader.uint32()); - break; - case 3: - message.score = reader.float(); - break; - case 4: - message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.decode(reader, reader.uint32()); - break; - case 5: - if (!(message.reasons && message.reasons.length)) - message.reasons = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.event = $root.google.cloud.recaptchaenterprise.v1beta1.Event.decode(reader, reader.uint32()); + break; + } + case 3: { + message.score = reader.float(); + break; + } + case 4: { + message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.reasons && message.reasons.length)) + message.reasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.reasons.push(reader.int32()); + } else message.reasons.push(reader.int32()); - } else - message.reasons.push(reader.int32()); - break; - case 7: - message.passwordLeakVerification = $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.decode(reader, reader.uint32()); - break; - case 8: - message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.decode(reader, reader.uint32()); - break; + break; + } + case 7: { + message.passwordLeakVerification = $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.decode(reader, reader.uint32()); + break; + } + case 8: { + message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -11056,6 +11752,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Assessment + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.Assessment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Assessment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.Assessment"; + }; + /** * ClassificationReason enum. * @name google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason @@ -11228,24 +11939,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.token = reader.string(); - break; - case 2: - message.siteKey = reader.string(); - break; - case 3: - message.userAgent = reader.string(); - break; - case 4: - message.userIpAddress = reader.string(); - break; - case 5: - message.expectedAction = reader.string(); - break; - case 6: - message.hashedAccountId = reader.bytes(); - break; + case 1: { + message.token = reader.string(); + break; + } + case 2: { + message.siteKey = reader.string(); + break; + } + case 3: { + message.userAgent = reader.string(); + break; + } + case 4: { + message.userIpAddress = reader.string(); + break; + } + case 5: { + message.expectedAction = reader.string(); + break; + } + case 6: { + message.hashedAccountId = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -11327,7 +12044,7 @@ if (object.hashedAccountId != null) if (typeof object.hashedAccountId === "string") $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); - else if (object.hashedAccountId.length) + else if (object.hashedAccountId.length >= 0) message.hashedAccountId = object.hashedAccountId; return message; }; @@ -11385,7 +12102,22 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Event; + /** + * Gets the default type url for Event + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.Event + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.Event"; + }; + + return Event; })(); v1beta1.TokenProperties = (function() { @@ -11524,21 +12256,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.valid = reader.bool(); - break; - case 2: - message.invalidReason = reader.int32(); - break; - case 3: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 4: - message.hostname = reader.string(); - break; - case 5: - message.action = reader.string(); - break; + case 1: { + message.valid = reader.bool(); + break; + } + case 2: { + message.invalidReason = reader.int32(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.hostname = reader.string(); + break; + } + case 5: { + message.action = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -11709,6 +12446,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TokenProperties + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.TokenProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.TokenProperties"; + }; + /** * InvalidReason enum. * @name google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason @@ -11835,16 +12587,17 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.labels && message.labels.length)) - message.labels = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + if (!(message.labels && message.labels.length)) + message.labels = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.labels.push(reader.int32()); + } else message.labels.push(reader.int32()); - } else - message.labels.push(reader.int32()); - break; + break; + } default: reader.skipType(tag & 7); break; @@ -11976,6 +12729,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AccountDefenderAssessment + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountDefenderAssessment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment"; + }; + /** * AccountDefenderLabel enum. * @name google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.AccountDefenderLabel @@ -12122,14 +12890,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; @@ -12245,6 +13015,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; })(); @@ -12455,38 +13240,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; @@ -12708,6 +13503,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; })(); @@ -12814,12 +13624,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; @@ -12918,6 +13730,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; })(); @@ -13112,36 +13939,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; @@ -13339,6 +14173,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 @@ -13475,12 +14324,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; @@ -13579,6 +14430,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; })(); @@ -13688,11 +14554,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; @@ -13799,6 +14666,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; })(); @@ -13820,6 +14702,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 */ /** @@ -13940,6 +14823,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 @@ -13995,6 +14886,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; }; @@ -14029,66 +14922,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; @@ -14200,6 +15109,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; }; @@ -14292,6 +15204,8 @@ } if (object.syntax != null) message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); return message; }; @@ -14323,6 +15237,7 @@ object.options = null; object.sourceCodeInfo = null; object.syntax = ""; + object.edition = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -14369,6 +15284,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; }; @@ -14383,7 +15300,22 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FileDescriptorProto; + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; })(); protobuf.DescriptorProto = (function() { @@ -14593,52 +15525,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; @@ -14939,6 +15881,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() { /** @@ -15053,15 +16010,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; @@ -15173,6 +16133,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; })(); @@ -15279,12 +16254,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; @@ -15383,6 +16360,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; })(); @@ -15483,11 +16475,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; @@ -15594,6 +16587,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; })(); @@ -15799,39 +16807,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; @@ -16118,6 +17137,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 @@ -16286,12 +17320,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; @@ -16395,6 +17431,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; })(); @@ -16540,27 +17591,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; @@ -16736,6 +17792,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() { /** @@ -16839,12 +17910,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; @@ -16943,6 +18016,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; })(); @@ -17063,15 +18151,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; @@ -17183,6 +18274,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; })(); @@ -17302,17 +18408,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; @@ -17442,6 +18551,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; })(); @@ -17592,24 +18716,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; @@ -17745,6 +18875,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; })(); @@ -18075,76 +19220,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; @@ -18457,6 +19624,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 @@ -18625,26 +19807,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; @@ -18798,6 +19986,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; })(); @@ -18811,6 +20014,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 @@ -18867,6 +20071,14 @@ */ FieldOptions.prototype.lazy = false; + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + /** * FieldOptions deprecated. * @member {boolean} deprecated @@ -18943,6 +20155,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(); @@ -18988,42 +20202,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; @@ -19083,6 +20310,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"; @@ -19168,6 +20398,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) @@ -19255,6 +20487,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")) @@ -19269,6 +20502,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) @@ -19295,6 +20530,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 @@ -19424,11 +20674,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; @@ -19535,6 +20786,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; })(); @@ -19654,17 +20920,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; @@ -19789,6 +21058,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; })(); @@ -19897,14 +21181,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; @@ -20020,6 +21306,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; })(); @@ -20150,20 +21451,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; @@ -20296,6 +21601,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; })(); @@ -20439,25 +21759,30 @@ 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 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; + } default: reader.skipType(tag & 7); break; @@ -20634,6 +21959,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 @@ -20813,29 +22153,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; @@ -20948,7 +22295,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); @@ -21029,6 +22376,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() { /** @@ -21130,12 +22492,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; @@ -21236,6 +22600,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; })(); @@ -21336,11 +22715,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; @@ -21447,6 +22827,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() { /** @@ -21595,37 +22990,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; @@ -21786,6 +23186,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; })(); @@ -21886,11 +23301,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; @@ -21997,6 +23413,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() { /** @@ -22007,6 +23438,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 */ /** @@ -22057,6 +23489,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 @@ -22093,6 +23533,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; }; @@ -22127,25 +23569,33 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - message.sourceFile = reader.string(); - break; - case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); - break; + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -22197,6 +23647,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; }; @@ -22225,6 +23684,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; }; @@ -22247,6 +23720,7 @@ object.sourceFile = ""; object.begin = 0; object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; @@ -22259,6 +23733,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; }; @@ -22273,6 +23749,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; })(); @@ -22436,6 +23943,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; })(); @@ -22533,11 +24055,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; @@ -22639,6 +24162,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; })(); @@ -22745,12 +24283,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; @@ -22863,6 +24403,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; })(); diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index 3168495e966..d3ef26da0a5 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -1680,6 +1680,10 @@ "syntax": { "type": "string", "id": 12 + }, + "edition": { + "type": "string", + "id": 13 } } }, @@ -2208,6 +2212,13 @@ "default": false } }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, "deprecated": { "type": "bool", "id": 3, @@ -2500,6 +2511,19 @@ "end": { "type": "int32", "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } } } } From 6767b43c4c4de24bb8e63c1d0d668433a1b0c574 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 26 Aug 2022 12:26:15 -0700 Subject: [PATCH 240/253] chore(main): release 3.0.3 (#399) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.0.3 * 🦉 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-recaptchaenterprise/CHANGELOG.md | 9 +++++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- ...pet_metadata.google.cloud.recaptchaenterprise.v1.json | 2 +- ...etadata.google.cloud.recaptchaenterprise.v1beta1.json | 2 +- .../samples/package.json | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index eaedb9059c5..5cf3452ae01 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,15 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [3.0.3](https://github.com/googleapis/nodejs-recaptcha-enterprise/compare/v3.0.2...v3.0.3) (2022-08-23) + + +### Bug Fixes + +* better support for fallback mode ([#396](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/396)) ([a3dde75](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/a3dde75d3080a30c5613703041d48ec466403511)) +* change import long to require ([#398](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/398)) ([6d14b20](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/6d14b2030dd5ca2bf6fdc7ba72c45d05ac19bd1a)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/1546)) ([#401](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/401)) ([82e9ae9](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/82e9ae9361edbb1c98284d6946ae299fbf607faf)) + ## [3.0.2](https://github.com/googleapis/nodejs-recaptcha-enterprise/compare/v3.0.1...v3.0.2) (2022-06-30) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 30e4bd12667..d7535dcca17 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "3.0.2", + "version": "3.0.3", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index 5fc778d4a84..d6356b8ba29 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "3.0.2", + "version": "3.0.3", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json index 53c22960e18..65e23bbc8da 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "3.0.2", + "version": "3.0.3", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 5fc894df660..2da627f1185 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "echo add tests" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^3.0.2" + "@google-cloud/recaptcha-enterprise": "^3.0.3" }, "devDependencies": { "chai": "^4.2.0", From ea6db49c10c9626ad61c64be4edb48a00d5f1b7a 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:00:22 +0000 Subject: [PATCH 241/253] fix: do not import the whole google-gax from proto JS (#1553) (#402) 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-recaptchaenterprise/package.json | 2 +- packages/google-cloud-recaptchaenterprise/protos/protos.d.ts | 2 +- packages/google-cloud-recaptchaenterprise/protos/protos.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index d7535dcca17..6ed2155db76 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -25,7 +25,7 @@ "reCAPTCHA Enterprise API" ], "dependencies": { - "google-gax": "^3.0.1" + "google-gax": "^3.3.0" }, "devDependencies": { "@types/mocha": "^9.0.0", diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 083b80f101f..405be8a8ac4 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/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-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index 7d23149aeda..bbe54b1e333 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/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 e19cd1e1ce160f19f5e8b751f912761bead31f1b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 20:36:24 +0000 Subject: [PATCH 242/253] fix: allow passing gax instance to client constructor (#403) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 470911839 Source-Link: https://github.com/googleapis/googleapis/commit/352756699ebc5b2144c252867c265ea44448712e Source-Link: https://github.com/googleapis/googleapis-gen/commit/f16a1d224f00a630ea43d6a9a1a31f566f45cdea Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjE2YTFkMjI0ZjAwYTYzMGVhNDNkNmE5YTFhMzFmNTY2ZjQ1Y2RlYSJ9 feat: accept google-gax instance as a parameter Please see the documentation of the client constructor for details. PiperOrigin-RevId: 470332808 Source-Link: https://github.com/googleapis/googleapis/commit/d4a23675457cd8f0b44080e0594ec72de1291b89 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e97a1ac204ead4fe7341f91e72db7c6ac6016341 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTk3YTFhYzIwNGVhZDRmZTczNDFmOTFlNzJkYjdjNmFjNjAxNjM0MSJ9 --- .../v1/recaptcha_enterprise_service_client.ts | 67 +++++++++++-------- ...tcha_enterprise_service_v1_beta1_client.ts | 35 +++++++--- 2 files changed, 67 insertions(+), 35 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index e3d86368f18..43aee9feb47 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_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, @@ -26,7 +26,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -36,7 +35,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 './recaptcha_enterprise_service_client_config.json'; - const version = require('../../../package.json').version; /** @@ -96,8 +94,18 @@ export class RecaptchaEnterpriseServiceClient { * 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 RecaptchaEnterpriseServiceClient({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 RecaptchaEnterpriseServiceClient; @@ -118,8 +126,13 @@ export class RecaptchaEnterpriseServiceClient { 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); @@ -224,7 +237,7 @@ export class RecaptchaEnterpriseServiceClient { 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; } /** @@ -450,7 +463,7 @@ export class RecaptchaEnterpriseServiceClient { 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(); @@ -562,7 +575,7 @@ export class RecaptchaEnterpriseServiceClient { 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(); @@ -656,7 +669,7 @@ export class RecaptchaEnterpriseServiceClient { 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(); @@ -748,7 +761,7 @@ export class RecaptchaEnterpriseServiceClient { 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(); @@ -842,7 +855,7 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'key.name': request.key!.name || '', }); this.initialize(); @@ -934,7 +947,7 @@ export class RecaptchaEnterpriseServiceClient { 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(); @@ -1031,7 +1044,7 @@ export class RecaptchaEnterpriseServiceClient { 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(); @@ -1124,7 +1137,7 @@ export class RecaptchaEnterpriseServiceClient { 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(); @@ -1226,7 +1239,7 @@ export class RecaptchaEnterpriseServiceClient { 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(); @@ -1267,7 +1280,7 @@ export class RecaptchaEnterpriseServiceClient { 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['listKeys']; @@ -1317,7 +1330,7 @@ export class RecaptchaEnterpriseServiceClient { 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['listKeys']; @@ -1429,7 +1442,7 @@ export class RecaptchaEnterpriseServiceClient { 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(); @@ -1479,7 +1492,7 @@ export class RecaptchaEnterpriseServiceClient { 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['listRelatedAccountGroups']; @@ -1534,7 +1547,7 @@ export class RecaptchaEnterpriseServiceClient { 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['listRelatedAccountGroups']; @@ -1647,7 +1660,7 @@ export class RecaptchaEnterpriseServiceClient { 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(); @@ -1698,7 +1711,7 @@ export class RecaptchaEnterpriseServiceClient { 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 = @@ -1755,7 +1768,7 @@ export class RecaptchaEnterpriseServiceClient { 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 = @@ -1873,7 +1886,7 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ project: request.project || '', }); this.initialize(); @@ -1928,7 +1941,7 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ project: request.project || '', }); const defaultCallSettings = @@ -1989,7 +2002,7 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ project: request.project || '', }); const defaultCallSettings = diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index 3c872da73c0..b7209573dd0 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -17,8 +17,13 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -28,7 +33,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 './recaptcha_enterprise_service_v1_beta1_client_config.json'; - const version = require('../../../package.json').version; /** @@ -88,8 +92,18 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { * 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 RecaptchaEnterpriseServiceV1Beta1Client({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 RecaptchaEnterpriseServiceV1Beta1Client; @@ -110,8 +124,13 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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); @@ -177,7 +196,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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; } /** @@ -393,7 +412,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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(); @@ -504,7 +523,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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(); From 5eb2dac4d10f119391c74695716f37aa84ca8a9e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Sep 2022 03:56:21 +0200 Subject: [PATCH 243/253] chore(deps): update dependency uuid to v9 (#405) 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 | |---|---|---|---|---|---| | [uuid](https://togithub.com/uuidjs/uuid) | [`^8.0.0` -> `^9.0.0`](https://renovatebot.com/diffs/npm/uuid/8.3.2/9.0.0) | [![age](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/compatibility-slim/8.3.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/confidence-slim/8.3.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
uuidjs/uuid ### [`v9.0.0`](https://togithub.com/uuidjs/uuid/blob/HEAD/CHANGELOG.md#​900-httpsgithubcomuuidjsuuidcomparev832v900-2022-09-05) [Compare Source](https://togithub.com/uuidjs/uuid/compare/v8.3.2...v9.0.0) ##### ⚠ BREAKING CHANGES - Drop Node.js 10.x support. This library always aims at supporting one EOLed LTS release which by this time now is 12.x which has reached EOL 30 Apr 2022. - Remove the minified UMD build from the package. Minified code is hard to audit and since this is a widely used library it seems more appropriate nowadays to optimize for auditability than to ship a legacy module format that, at best, serves educational purposes nowadays. For production browser use cases, users should be using a bundler. For educational purposes, today's online sandboxes like replit.com offer convenient ways to load npm modules, so the use case for UMD through repos like UNPKG or jsDelivr has largely vanished. - Drop IE 11 and Safari 10 support. Drop support for browsers that don't correctly implement const/let and default arguments, and no longer transpile the browser build to ES2015. This also removes the fallback on msCrypto instead of the crypto API. Browser tests are run in the first supported version of each supported browser and in the latest (as of this commit) version available on Browserstack. ##### Features - optimize uuid.v1 by 1.3x uuid.v4 by 4.3x (430%) ([#​597](https://togithub.com/uuidjs/uuid/issues/597)) ([3a033f6](https://togithub.com/uuidjs/uuid/commit/3a033f6bab6bb3780ece6d645b902548043280bc)) - remove UMD build ([#​645](https://togithub.com/uuidjs/uuid/issues/645)) ([e948a0f](https://togithub.com/uuidjs/uuid/commit/e948a0f22bf22f4619b27bd913885e478e20fe6f)), closes [#​620](https://togithub.com/uuidjs/uuid/issues/620) - use native crypto.randomUUID when available ([#​600](https://togithub.com/uuidjs/uuid/issues/600)) ([c9e076c](https://togithub.com/uuidjs/uuid/commit/c9e076c852edad7e9a06baaa1d148cf4eda6c6c4)) ##### Bug Fixes - add Jest/jsdom compatibility ([#​642](https://togithub.com/uuidjs/uuid/issues/642)) ([16f9c46](https://togithub.com/uuidjs/uuid/commit/16f9c469edf46f0786164cdf4dc980743984a6fd)) - change default export to named function ([#​545](https://togithub.com/uuidjs/uuid/issues/545)) ([c57bc5a](https://togithub.com/uuidjs/uuid/commit/c57bc5a9a0653273aa639cda9177ce52efabe42a)) - handle error when parameter is not set in v3 and v5 ([#​622](https://togithub.com/uuidjs/uuid/issues/622)) ([fcd7388](https://togithub.com/uuidjs/uuid/commit/fcd73881692d9fabb63872576ba28e30ff852091)) - run npm audit fix ([#​644](https://togithub.com/uuidjs/uuid/issues/644)) ([04686f5](https://togithub.com/uuidjs/uuid/commit/04686f54c5fed2cfffc1b619f4970c4bb8532353)) - upgrading from uuid3 broken link ([#​568](https://togithub.com/uuidjs/uuid/issues/568)) ([1c849da](https://togithub.com/uuidjs/uuid/commit/1c849da6e164259e72e18636726345b13a7eddd6)) ##### build - drop Node.js 8.x from babel transpile target ([#​603](https://togithub.com/uuidjs/uuid/issues/603)) ([aa11485](https://togithub.com/uuidjs/uuid/commit/aa114858260402107ec8a1e1a825dea0a259bcb5)) - drop support for legacy browsers (IE11, Safari 10) ([#​604](https://togithub.com/uuidjs/uuid/issues/604)) ([0f433e5](https://togithub.com/uuidjs/uuid/commit/0f433e5ec444edacd53016de67db021102f36148)) - drop node 10.x to upgrade dev dependencies ([#​653](https://togithub.com/uuidjs/uuid/issues/653)) ([28a5712](https://togithub.com/uuidjs/uuid/commit/28a571283f8abda6b9d85e689f95b7d3ee9e282e)), closes [#​643](https://togithub.com/uuidjs/uuid/issues/643) ##### [8.3.2](https://togithub.com/uuidjs/uuid/compare/v8.3.1...v8.3.2) (2020-12-08) ##### Bug Fixes - lazy load getRandomValues ([#​537](https://togithub.com/uuidjs/uuid/issues/537)) ([16c8f6d](https://togithub.com/uuidjs/uuid/commit/16c8f6df2f6b09b4d6235602d6a591188320a82e)), closes [#​536](https://togithub.com/uuidjs/uuid/issues/536) ##### [8.3.1](https://togithub.com/uuidjs/uuid/compare/v8.3.0...v8.3.1) (2020-10-04) ##### Bug Fixes - support expo>=39.0.0 ([#​515](https://togithub.com/uuidjs/uuid/issues/515)) ([c65a0f3](https://togithub.com/uuidjs/uuid/commit/c65a0f3fa73b901959d638d1e3591dfacdbed867)), closes [#​375](https://togithub.com/uuidjs/uuid/issues/375)
--- ### 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-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 2da627f1185..0944f247088 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -18,6 +18,6 @@ "devDependencies": { "chai": "^4.2.0", "mocha": "^8.0.0", - "uuid": "^8.0.0" + "uuid": "^9.0.0" } } From 88fc998b8f5bb9ecb4766813aa94e16bdbe45ba0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:30:18 +0000 Subject: [PATCH 244/253] fix: preserve default values in x-goog-request-params header (#408) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 474338479 Source-Link: https://github.com/googleapis/googleapis/commit/d5d35e0353b59719e8917103b1bc7df2782bf6ba Source-Link: https://github.com/googleapis/googleapis-gen/commit/efcd3f93962a103f68f003e2a1eecde6fa216a27 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9 --- .../v1/recaptcha_enterprise_service_client.ts | 40 +- ...tcha_enterprise_service_v1_beta1_client.ts | 4 +- .../gapic_recaptcha_enterprise_service_v1.ts | 1266 +++++++++-------- ...cha_enterprise_service_v1_beta1_v1beta1.ts | 187 +-- 4 files changed, 789 insertions(+), 708 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index 43aee9feb47..bc800f8e8dc 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -464,7 +464,7 @@ export class RecaptchaEnterpriseServiceClient { 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.createAssessment(request, options, callback); @@ -576,7 +576,7 @@ export class RecaptchaEnterpriseServiceClient { 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.annotateAssessment(request, options, callback); @@ -670,7 +670,7 @@ export class RecaptchaEnterpriseServiceClient { 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.createKey(request, options, callback); @@ -762,7 +762,7 @@ export class RecaptchaEnterpriseServiceClient { 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.getKey(request, options, callback); @@ -856,7 +856,7 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'key.name': request.key!.name || '', + 'key.name': request.key!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateKey(request, options, callback); @@ -948,7 +948,7 @@ export class RecaptchaEnterpriseServiceClient { 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.deleteKey(request, options, callback); @@ -1045,7 +1045,7 @@ export class RecaptchaEnterpriseServiceClient { 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.migrateKey(request, options, callback); @@ -1138,7 +1138,7 @@ export class RecaptchaEnterpriseServiceClient { 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.getMetrics(request, options, callback); @@ -1240,7 +1240,7 @@ export class RecaptchaEnterpriseServiceClient { 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.listKeys(request, options, callback); @@ -1281,7 +1281,7 @@ export class RecaptchaEnterpriseServiceClient { 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['listKeys']; const callSettings = defaultCallSettings.merge(options); @@ -1331,7 +1331,7 @@ export class RecaptchaEnterpriseServiceClient { 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['listKeys']; const callSettings = defaultCallSettings.merge(options); @@ -1443,7 +1443,7 @@ export class RecaptchaEnterpriseServiceClient { 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.listRelatedAccountGroups( @@ -1493,7 +1493,7 @@ export class RecaptchaEnterpriseServiceClient { 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['listRelatedAccountGroups']; const callSettings = defaultCallSettings.merge(options); @@ -1548,7 +1548,7 @@ export class RecaptchaEnterpriseServiceClient { 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['listRelatedAccountGroups']; const callSettings = defaultCallSettings.merge(options); @@ -1661,7 +1661,7 @@ export class RecaptchaEnterpriseServiceClient { 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.listRelatedAccountGroupMemberships( @@ -1712,7 +1712,7 @@ export class RecaptchaEnterpriseServiceClient { 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['listRelatedAccountGroupMemberships']; @@ -1769,7 +1769,7 @@ export class RecaptchaEnterpriseServiceClient { 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['listRelatedAccountGroupMemberships']; @@ -1887,7 +1887,7 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - project: request.project || '', + project: request.project ?? '', }); this.initialize(); return this.innerApiCalls.searchRelatedAccountGroupMemberships( @@ -1942,7 +1942,7 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - project: request.project || '', + project: request.project ?? '', }); const defaultCallSettings = this._defaults['searchRelatedAccountGroupMemberships']; @@ -2003,7 +2003,7 @@ export class RecaptchaEnterpriseServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - project: request.project || '', + project: request.project ?? '', }); const defaultCallSettings = this._defaults['searchRelatedAccountGroupMemberships']; diff --git a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts index b7209573dd0..be347ee16e4 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1beta1/recaptcha_enterprise_service_v1_beta1_client.ts @@ -413,7 +413,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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.createAssessment(request, options, callback); @@ -524,7 +524,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client { 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.annotateAssessment(request, options, callback); diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index eab3fa483c1..bae8dafc370 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf} 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 @@ -248,26 +263,25 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateAssessmentRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Assessment() ); client.innerApiCalls.createAssessment = stubSimpleCall(expectedResponse); const [response] = await client.createAssessment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createAssessment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAssessment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createAssessment without error using callback', async () => { @@ -282,15 +296,11 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateAssessmentRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Assessment() ); @@ -313,11 +323,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createAssessment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAssessment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createAssessment with error', async () => { @@ -332,26 +345,25 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateAssessmentRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createAssessment = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createAssessment(request), expectedError); - assert( - (client.innerApiCalls.createAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createAssessment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAssessment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createAssessment with closed client', async () => { @@ -366,7 +378,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateAssessmentRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createAssessment(request), expectedError); @@ -386,15 +401,11 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('AnnotateAssessmentRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse() ); @@ -402,11 +413,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.annotateAssessment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.annotateAssessment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.annotateAssessment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes annotateAssessment without error using callback', async () => { @@ -421,15 +435,11 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('AnnotateAssessmentRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse() ); @@ -452,11 +462,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.annotateAssessment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.annotateAssessment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes annotateAssessment with error', async () => { @@ -471,26 +484,25 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('AnnotateAssessmentRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.annotateAssessment = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.annotateAssessment(request), expectedError); - assert( - (client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.annotateAssessment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.annotateAssessment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes annotateAssessment with closed client', async () => { @@ -505,7 +517,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('AnnotateAssessmentRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.annotateAssessment(request), expectedError); @@ -525,26 +540,23 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateKeyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() ); client.innerApiCalls.createKey = stubSimpleCall(expectedResponse); const [response] = await client.createKey(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createKey without error using callback', async () => { @@ -559,15 +571,9 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateKeyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() ); @@ -590,11 +596,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createKey with error', async () => { @@ -609,23 +618,20 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateKeyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createKey = stubSimpleCall(undefined, expectedError); await assert.rejects(client.createKey(request), expectedError); - assert( - (client.innerApiCalls.createKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createKey with closed client', async () => { @@ -640,7 +646,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateKeyRequest', ['parent']); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createKey(request), expectedError); @@ -660,26 +667,23 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetKeyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() ); client.innerApiCalls.getKey = stubSimpleCall(expectedResponse); const [response] = await client.getKey(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = (client.innerApiCalls.getKey as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getKey without error using callback', async () => { @@ -694,15 +698,9 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetKeyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() ); @@ -725,11 +723,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = (client.innerApiCalls.getKey as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getKey with error', async () => { @@ -744,23 +745,20 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetKeyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getKey(request), expectedError); - assert( - (client.innerApiCalls.getKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = (client.innerApiCalls.getKey as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getKey with closed client', async () => { @@ -775,7 +773,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetKeyRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getKey(request), expectedError); @@ -795,27 +794,27 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() ); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = 'key.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.key ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateKeyRequest', [ + 'key', + 'name', + ]); + request.key.name = defaultValue1; + const expectedHeaderRequestParams = `key.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() ); client.innerApiCalls.updateKey = stubSimpleCall(expectedResponse); const [response] = await client.updateKey(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateKey without error using callback', async () => { @@ -830,16 +829,13 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() ); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = 'key.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.key ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateKeyRequest', [ + 'key', + 'name', + ]); + request.key.name = defaultValue1; + const expectedHeaderRequestParams = `key.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() ); @@ -862,11 +858,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateKey with error', async () => { @@ -881,24 +880,24 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() ); - request.key = {}; - request.key.name = ''; - const expectedHeaderRequestParams = 'key.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.key ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateKeyRequest', [ + 'key', + 'name', + ]); + request.key.name = defaultValue1; + const expectedHeaderRequestParams = `key.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateKey = stubSimpleCall(undefined, expectedError); await assert.rejects(client.updateKey(request), expectedError); - assert( - (client.innerApiCalls.updateKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateKey with closed client', async () => { @@ -913,8 +912,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() ); - request.key = {}; - request.key.name = ''; + request.key ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateKeyRequest', [ + 'key', + 'name', + ]); + request.key.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateKey(request), expectedError); @@ -934,26 +937,23 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteKeyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); client.innerApiCalls.deleteKey = stubSimpleCall(expectedResponse); const [response] = await client.deleteKey(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteKey without error using callback', async () => { @@ -968,15 +968,9 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteKeyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -999,11 +993,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteKey with error', async () => { @@ -1018,23 +1015,20 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteKeyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteKey = stubSimpleCall(undefined, expectedError); await assert.rejects(client.deleteKey(request), expectedError); - assert( - (client.innerApiCalls.deleteKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteKey with closed client', async () => { @@ -1049,7 +1043,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteKeyRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteKey(request), expectedError); @@ -1069,26 +1064,23 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('MigrateKeyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() ); client.innerApiCalls.migrateKey = stubSimpleCall(expectedResponse); const [response] = await client.migrateKey(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.migrateKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.migrateKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.migrateKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes migrateKey without error using callback', async () => { @@ -1103,15 +1095,9 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('MigrateKeyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() ); @@ -1134,11 +1120,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.migrateKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.migrateKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.migrateKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes migrateKey with error', async () => { @@ -1153,26 +1142,23 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('MigrateKeyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.migrateKey = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.migrateKey(request), expectedError); - assert( - (client.innerApiCalls.migrateKey as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.migrateKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.migrateKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes migrateKey with closed client', async () => { @@ -1187,7 +1173,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('MigrateKeyRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.migrateKey(request), expectedError); @@ -1207,26 +1194,23 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetMetricsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetMetricsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Metrics() ); client.innerApiCalls.getMetrics = stubSimpleCall(expectedResponse); const [response] = await client.getMetrics(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getMetrics as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getMetrics as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetrics as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMetrics without error using callback', async () => { @@ -1241,15 +1225,9 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetMetricsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetMetricsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Metrics() ); @@ -1272,11 +1250,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getMetrics as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getMetrics as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetrics as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMetrics with error', async () => { @@ -1291,26 +1272,23 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetMetricsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetMetricsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getMetrics = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getMetrics(request), expectedError); - assert( - (client.innerApiCalls.getMetrics as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getMetrics as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetrics as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMetrics with closed client', async () => { @@ -1325,7 +1303,8 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetMetricsRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetMetricsRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getMetrics(request), expectedError); @@ -1345,15 +1324,9 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() @@ -1368,11 +1341,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { client.innerApiCalls.listKeys = stubSimpleCall(expectedResponse); const [response] = await client.listKeys(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listKeys as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listKeys as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listKeys as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listKeys without error using callback', async () => { @@ -1387,15 +1363,9 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() @@ -1426,11 +1396,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listKeys as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listKeys as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listKeys as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listKeys with error', async () => { @@ -1445,23 +1418,20 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listKeys(request), expectedError); - assert( - (client.innerApiCalls.listKeys as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listKeys as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listKeys as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listKeysStream without error', async () => { @@ -1476,8 +1446,9 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() @@ -1514,10 +1485,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listKeys, request) ); - assert.strictEqual( - (client.descriptors.page.listKeys.createStream as SinonStub).getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listKeys.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1533,8 +1506,9 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listKeys.createStream = stubPageStreamingCall( undefined, @@ -1562,10 +1536,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listKeys, request) ); - assert.strictEqual( - (client.descriptors.page.listKeys.createStream as SinonStub).getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listKeys.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1581,8 +1557,9 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.Key() @@ -1607,10 +1584,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { .args[1], request ); - assert.strictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listKeys.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1626,8 +1605,9 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListKeysRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( undefined, @@ -1645,10 +1625,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { .args[1], request ); - assert.strictEqual( - (client.descriptors.page.listKeys.asyncIterate as SinonStub).getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listKeys.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -1666,15 +1648,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListRelatedAccountGroupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup() @@ -1690,11 +1669,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listRelatedAccountGroups(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listRelatedAccountGroups as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listRelatedAccountGroups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRelatedAccountGroups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listRelatedAccountGroups without error using callback', async () => { @@ -1709,15 +1691,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListRelatedAccountGroupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup() @@ -1750,11 +1729,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listRelatedAccountGroups as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listRelatedAccountGroups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRelatedAccountGroups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listRelatedAccountGroups with error', async () => { @@ -1769,15 +1751,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListRelatedAccountGroupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listRelatedAccountGroups = stubSimpleCall( undefined, @@ -1787,11 +1766,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { client.listRelatedAccountGroups(request), expectedError ); - assert( - (client.innerApiCalls.listRelatedAccountGroups as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listRelatedAccountGroups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRelatedAccountGroups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listRelatedAccountGroupsStream without error', async () => { @@ -1806,8 +1788,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListRelatedAccountGroupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup() @@ -1850,12 +1836,15 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listRelatedAccountGroups, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listRelatedAccountGroups .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1871,8 +1860,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListRelatedAccountGroupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listRelatedAccountGroups.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1904,12 +1897,15 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listRelatedAccountGroups, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listRelatedAccountGroups .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1925,8 +1921,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListRelatedAccountGroupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroup() @@ -1954,12 +1954,15 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listRelatedAccountGroups .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1975,8 +1978,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListRelatedAccountGroupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listRelatedAccountGroups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1995,12 +2002,15 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listRelatedAccountGroups .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2018,15 +2028,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListRelatedAccountGroupMembershipsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() @@ -2044,11 +2051,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { request ); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listRelatedAccountGroupMemberships as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listRelatedAccountGroupMemberships as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRelatedAccountGroupMemberships as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listRelatedAccountGroupMemberships without error using callback', async () => { @@ -2063,15 +2073,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListRelatedAccountGroupMembershipsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() @@ -2104,11 +2111,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listRelatedAccountGroupMemberships as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listRelatedAccountGroupMemberships as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRelatedAccountGroupMemberships as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listRelatedAccountGroupMemberships with error', async () => { @@ -2123,15 +2133,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListRelatedAccountGroupMembershipsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listRelatedAccountGroupMemberships = stubSimpleCall( undefined, @@ -2141,11 +2148,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { client.listRelatedAccountGroupMemberships(request), expectedError ); - assert( - (client.innerApiCalls.listRelatedAccountGroupMemberships as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listRelatedAccountGroupMemberships as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRelatedAccountGroupMemberships as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listRelatedAccountGroupMembershipsStream without error', async () => { @@ -2160,8 +2170,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListRelatedAccountGroupMembershipsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() @@ -2207,12 +2221,15 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.listRelatedAccountGroupMemberships .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2228,8 +2245,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListRelatedAccountGroupMembershipsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listRelatedAccountGroupMemberships.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2264,12 +2285,15 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.listRelatedAccountGroupMemberships .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2285,8 +2309,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListRelatedAccountGroupMembershipsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() @@ -2314,12 +2342,15 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listRelatedAccountGroupMemberships .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2335,8 +2366,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListRelatedAccountGroupMembershipsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listRelatedAccountGroupMemberships.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2355,12 +2390,15 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listRelatedAccountGroupMemberships .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2378,15 +2416,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.project = ''; - const expectedHeaderRequestParams = 'project='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'SearchRelatedAccountGroupMembershipsRequest', + ['project'] + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() @@ -2404,11 +2439,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { request ); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchRelatedAccountGroupMemberships as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchRelatedAccountGroupMemberships as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchRelatedAccountGroupMemberships as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchRelatedAccountGroupMemberships without error using callback', async () => { @@ -2423,15 +2461,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.project = ''; - const expectedHeaderRequestParams = 'project='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'SearchRelatedAccountGroupMembershipsRequest', + ['project'] + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() @@ -2464,11 +2499,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchRelatedAccountGroupMemberships as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.searchRelatedAccountGroupMemberships as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchRelatedAccountGroupMemberships as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchRelatedAccountGroupMemberships with error', async () => { @@ -2483,15 +2521,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.project = ''; - const expectedHeaderRequestParams = 'project='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'SearchRelatedAccountGroupMembershipsRequest', + ['project'] + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.searchRelatedAccountGroupMemberships = stubSimpleCall(undefined, expectedError); @@ -2499,11 +2534,14 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { client.searchRelatedAccountGroupMemberships(request), expectedError ); - assert( - (client.innerApiCalls.searchRelatedAccountGroupMemberships as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchRelatedAccountGroupMemberships as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchRelatedAccountGroupMemberships as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchRelatedAccountGroupMembershipsStream without error', async () => { @@ -2518,8 +2556,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.project = ''; - const expectedHeaderRequestParams = 'project='; + const defaultValue1 = getTypeDefaultValue( + 'SearchRelatedAccountGroupMembershipsRequest', + ['project'] + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() @@ -2565,12 +2607,15 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.searchRelatedAccountGroupMemberships .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2586,8 +2631,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.project = ''; - const expectedHeaderRequestParams = 'project='; + const defaultValue1 = getTypeDefaultValue( + 'SearchRelatedAccountGroupMembershipsRequest', + ['project'] + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchRelatedAccountGroupMemberships.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2622,12 +2671,15 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.searchRelatedAccountGroupMemberships .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2643,8 +2695,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.project = ''; - const expectedHeaderRequestParams = 'project='; + const defaultValue1 = getTypeDefaultValue( + 'SearchRelatedAccountGroupMembershipsRequest', + ['project'] + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.RelatedAccountGroupMembership() @@ -2673,12 +2729,15 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.searchRelatedAccountGroupMemberships .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2694,8 +2753,12 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); - request.project = ''; - const expectedHeaderRequestParams = 'project='; + const defaultValue1 = getTypeDefaultValue( + 'SearchRelatedAccountGroupMembershipsRequest', + ['project'] + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchRelatedAccountGroupMemberships.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2715,12 +2778,15 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.searchRelatedAccountGroupMemberships .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts index 8c910f5669e..ce20908e74b 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts @@ -25,6 +25,21 @@ import * as recaptchaenterpriseservicev1beta1Module from '../src'; import {protobuf} 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 @@ -191,26 +206,25 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateAssessmentRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.Assessment() ); client.innerApiCalls.createAssessment = stubSimpleCall(expectedResponse); const [response] = await client.createAssessment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createAssessment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAssessment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createAssessment without error using callback', async () => { @@ -225,15 +239,11 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateAssessmentRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.Assessment() ); @@ -256,11 +266,14 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createAssessment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAssessment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createAssessment with error', async () => { @@ -275,26 +288,25 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateAssessmentRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createAssessment = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createAssessment(request), expectedError); - assert( - (client.innerApiCalls.createAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createAssessment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAssessment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createAssessment with closed client', async () => { @@ -309,7 +321,10 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateAssessmentRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createAssessment(request), expectedError); @@ -329,15 +344,11 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('AnnotateAssessmentRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse() ); @@ -345,11 +356,14 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { stubSimpleCall(expectedResponse); const [response] = await client.annotateAssessment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.annotateAssessment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.annotateAssessment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes annotateAssessment without error using callback', async () => { @@ -364,15 +378,11 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('AnnotateAssessmentRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse() ); @@ -395,11 +405,14 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.annotateAssessment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.annotateAssessment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes annotateAssessment with error', async () => { @@ -414,26 +427,25 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('AnnotateAssessmentRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.annotateAssessment = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.annotateAssessment(request), expectedError); - assert( - (client.innerApiCalls.annotateAssessment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.annotateAssessment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.annotateAssessment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes annotateAssessment with closed client', async () => { @@ -448,7 +460,10 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('AnnotateAssessmentRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.annotateAssessment(request), expectedError); From 101c709ccf218a7adb39362320a6b44aa469e32f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 13:22:58 -0700 Subject: [PATCH 245/253] test: use fully qualified request type name in tests (#409) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: use fully qualified request type name in tests PiperOrigin-RevId: 475685359 Source-Link: https://github.com/googleapis/googleapis/commit/7a129736313ceb1f277c3b7f7e16d2e04cc901dd Source-Link: https://github.com/googleapis/googleapis-gen/commit/370c729e2ba062a167449c27882ba5f379c5c34d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzcwYzcyOWUyYmEwNjJhMTY3NDQ5YzI3ODgyYmE1ZjM3OWM1YzM0ZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../gapic_recaptcha_enterprise_service_v1.ts | 265 ++++++++++++------ ...cha_enterprise_service_v1_beta1_v1beta1.ts | 56 ++-- 2 files changed, 209 insertions(+), 112 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index bae8dafc370..db170b7bde6 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -263,9 +263,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAssessmentRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -296,9 +297,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAssessmentRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -345,9 +347,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAssessmentRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -378,9 +381,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAssessmentRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -401,9 +405,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() ); - const defaultValue1 = getTypeDefaultValue('AnnotateAssessmentRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -435,9 +440,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() ); - const defaultValue1 = getTypeDefaultValue('AnnotateAssessmentRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -484,9 +490,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() ); - const defaultValue1 = getTypeDefaultValue('AnnotateAssessmentRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -517,9 +524,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest() ); - const defaultValue1 = getTypeDefaultValue('AnnotateAssessmentRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -540,7 +548,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateKeyRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.CreateKeyRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -571,7 +582,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateKeyRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.CreateKeyRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -618,7 +632,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateKeyRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.CreateKeyRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -646,7 +663,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.CreateKeyRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateKeyRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.CreateKeyRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -667,7 +687,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetKeyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.GetKeyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -698,7 +721,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetKeyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.GetKeyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -745,7 +771,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetKeyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.GetKeyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -773,7 +802,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetKeyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetKeyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.GetKeyRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -795,10 +827,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() ); request.key ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateKeyRequest', [ - 'key', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest', + ['key', 'name'] + ); request.key.name = defaultValue1; const expectedHeaderRequestParams = `key.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -830,10 +862,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() ); request.key ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateKeyRequest', [ - 'key', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest', + ['key', 'name'] + ); request.key.name = defaultValue1; const expectedHeaderRequestParams = `key.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -881,10 +913,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() ); request.key ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateKeyRequest', [ - 'key', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest', + ['key', 'name'] + ); request.key.name = defaultValue1; const expectedHeaderRequestParams = `key.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -913,10 +945,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest() ); request.key ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateKeyRequest', [ - 'key', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.UpdateKeyRequest', + ['key', 'name'] + ); request.key.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -937,7 +969,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteKeyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -968,7 +1003,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteKeyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1015,7 +1053,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteKeyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1043,7 +1084,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteKeyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.DeleteKeyRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1064,7 +1108,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest() ); - const defaultValue1 = getTypeDefaultValue('MigrateKeyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1095,7 +1142,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest() ); - const defaultValue1 = getTypeDefaultValue('MigrateKeyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1142,7 +1192,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest() ); - const defaultValue1 = getTypeDefaultValue('MigrateKeyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1173,7 +1226,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest() ); - const defaultValue1 = getTypeDefaultValue('MigrateKeyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.MigrateKeyRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1194,7 +1250,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetMetricsRequest() ); - const defaultValue1 = getTypeDefaultValue('GetMetricsRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.GetMetricsRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1225,7 +1284,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetMetricsRequest() ); - const defaultValue1 = getTypeDefaultValue('GetMetricsRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.GetMetricsRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1272,7 +1334,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetMetricsRequest() ); - const defaultValue1 = getTypeDefaultValue('GetMetricsRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.GetMetricsRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1303,7 +1368,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.GetMetricsRequest() ); - const defaultValue1 = getTypeDefaultValue('GetMetricsRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.GetMetricsRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1324,7 +1392,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() ); - const defaultValue1 = getTypeDefaultValue('ListKeysRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.ListKeysRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1363,7 +1434,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() ); - const defaultValue1 = getTypeDefaultValue('ListKeysRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.ListKeysRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1418,7 +1492,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() ); - const defaultValue1 = getTypeDefaultValue('ListKeysRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.ListKeysRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1446,7 +1523,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() ); - const defaultValue1 = getTypeDefaultValue('ListKeysRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.ListKeysRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1506,7 +1586,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() ); - const defaultValue1 = getTypeDefaultValue('ListKeysRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.ListKeysRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1557,7 +1640,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() ); - const defaultValue1 = getTypeDefaultValue('ListKeysRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.ListKeysRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1605,7 +1691,10 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1.ListKeysRequest() ); - const defaultValue1 = getTypeDefaultValue('ListKeysRequest', ['parent']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.ListKeysRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1649,7 +1738,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListRelatedAccountGroupsRequest', + '.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1692,7 +1781,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListRelatedAccountGroupsRequest', + '.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1752,7 +1841,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListRelatedAccountGroupsRequest', + '.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1789,7 +1878,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListRelatedAccountGroupsRequest', + '.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1861,7 +1950,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListRelatedAccountGroupsRequest', + '.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1922,7 +2011,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListRelatedAccountGroupsRequest', + '.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1979,7 +2068,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListRelatedAccountGroupsRequest', + '.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2029,7 +2118,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListRelatedAccountGroupMembershipsRequest', + '.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2074,7 +2163,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListRelatedAccountGroupMembershipsRequest', + '.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2134,7 +2223,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListRelatedAccountGroupMembershipsRequest', + '.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2171,7 +2260,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListRelatedAccountGroupMembershipsRequest', + '.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2246,7 +2335,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListRelatedAccountGroupMembershipsRequest', + '.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2310,7 +2399,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListRelatedAccountGroupMembershipsRequest', + '.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2367,7 +2456,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListRelatedAccountGroupMembershipsRequest', + '.google.cloud.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2417,7 +2506,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'SearchRelatedAccountGroupMembershipsRequest', + '.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest', ['project'] ); request.project = defaultValue1; @@ -2462,7 +2551,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'SearchRelatedAccountGroupMembershipsRequest', + '.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest', ['project'] ); request.project = defaultValue1; @@ -2522,7 +2611,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'SearchRelatedAccountGroupMembershipsRequest', + '.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest', ['project'] ); request.project = defaultValue1; @@ -2557,7 +2646,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'SearchRelatedAccountGroupMembershipsRequest', + '.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest', ['project'] ); request.project = defaultValue1; @@ -2632,7 +2721,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'SearchRelatedAccountGroupMembershipsRequest', + '.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest', ['project'] ); request.project = defaultValue1; @@ -2696,7 +2785,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'SearchRelatedAccountGroupMembershipsRequest', + '.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest', ['project'] ); request.project = defaultValue1; @@ -2754,7 +2843,7 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { new protos.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'SearchRelatedAccountGroupMembershipsRequest', + '.google.cloud.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest', ['project'] ); request.project = defaultValue1; diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts index ce20908e74b..fa441a00e8b 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1_beta1_v1beta1.ts @@ -206,9 +206,10 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAssessmentRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -239,9 +240,10 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAssessmentRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -288,9 +290,10 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAssessmentRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -321,9 +324,10 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAssessmentRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -344,9 +348,10 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() ); - const defaultValue1 = getTypeDefaultValue('AnnotateAssessmentRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -378,9 +383,10 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() ); - const defaultValue1 = getTypeDefaultValue('AnnotateAssessmentRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -427,9 +433,10 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() ); - const defaultValue1 = getTypeDefaultValue('AnnotateAssessmentRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -460,9 +467,10 @@ describe('v1beta1.RecaptchaEnterpriseServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest() ); - const defaultValue1 = getTypeDefaultValue('AnnotateAssessmentRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); From e8848ff041ac7bbb0d6168313d5bff81edecc01f 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:10:32 -0700 Subject: [PATCH 246/253] chore(main): release 3.0.4 (#404) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.0.4 * 🦉 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-recaptchaenterprise/CHANGELOG.md | 10 ++++++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- ...t_metadata.google.cloud.recaptchaenterprise.v1.json | 2 +- ...adata.google.cloud.recaptchaenterprise.v1beta1.json | 2 +- .../samples/package.json | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 5cf3452ae01..8dc0c2dbe83 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,16 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [3.0.4](https://github.com/googleapis/nodejs-recaptcha-enterprise/compare/v3.0.3...v3.0.4) (2022-09-22) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#403](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/403)) ([4e53af0](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/4e53af0efb857467f4100700243c269c2d35b2fd)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/1553)) ([#402](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/402)) ([a0508d7](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/a0508d77f3d4e46338b714555163b85c4d6871af)) +* Preserve default values in x-goog-request-params header ([#408](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/408)) ([53d8757](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/53d8757169e872522d8b1e6d2854bf75aac375fa)) +* use google-gax v3.3.0 ([a0508d7](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/a0508d77f3d4e46338b714555163b85c4d6871af)) + ## [3.0.3](https://github.com/googleapis/nodejs-recaptcha-enterprise/compare/v3.0.2...v3.0.3) (2022-08-23) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 6ed2155db76..6e7cf82b105 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "3.0.3", + "version": "3.0.4", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index d6356b8ba29..c249b471cf1 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "3.0.3", + "version": "3.0.4", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json index 65e23bbc8da..e7f35db693a 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "3.0.3", + "version": "3.0.4", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 0944f247088..796d59aca8a 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "echo add tests" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^3.0.3" + "@google-cloud/recaptcha-enterprise": "^3.0.4" }, "devDependencies": { "chai": "^4.2.0", From 0df934ca6980faa0ea57139ebf462b40c96d9e02 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 17:03:33 -0700 Subject: [PATCH 247/253] feat: add RetrieveLegacySecretKey method (#411) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add RetrieveLegacySecretKey method feat: add annotation reasons REFUND, REFUND_FRAUD, TRANSACTION_ACCEPTED, TRANSACTION_DECLINED and SOCIAL_SPAM PiperOrigin-RevId: 480357575 Source-Link: https://github.com/googleapis/googleapis/commit/cbd4501e0c0f53ef459f4c54d8cc7bbf6586be55 Source-Link: https://github.com/googleapis/googleapis-gen/commit/7155b97d98361f3fc44cc8cb53667498736a9bde Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzE1NWI5N2Q5ODM2MWYzZmM0NGNjOGNiNTM2Njc0OTg3MzZhOWJkZSJ9 * 🦉 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 --- .../v1/recaptchaenterprise.proto | 258 +- .../protos/protos.d.ts | 452 ++- .../protos/protos.js | 2798 ++++++++++------- .../protos/protos.json | 111 +- ..._enterprise_service.annotate_assessment.js | 13 +- ....list_related_account_group_memberships.js | 12 +- ...ise_service.list_related_account_groups.js | 15 +- ...rise_service.retrieve_legacy_secret_key.js | 62 + ...earch_related_account_group_memberships.js | 17 +- ...recaptcha_enterprise_service.update_key.js | 4 +- ...a.google.cloud.recaptchaenterprise.v1.json | 48 +- .../src/v1/gapic_metadata.json | 10 + .../v1/recaptcha_enterprise_service_client.ts | 256 +- ...tcha_enterprise_service_client_config.json | 4 + .../gapic_recaptcha_enterprise_service_v1.ts | 149 + 15 files changed, 2683 insertions(+), 1526 deletions(-) create mode 100644 packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.retrieve_legacy_secret_key.js diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index 7165d1bcc00..9376f342ce5 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -36,8 +36,7 @@ option ruby_package = "Google::Cloud::RecaptchaEnterprise::V1"; // Service to determine the likelihood an event is legitimate. service RecaptchaEnterpriseService { option (google.api.default_host) = "recaptchaenterprise.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Creates an Assessment of the likelihood an event is legitimate. rpc CreateAssessment(CreateAssessmentRequest) returns (Assessment) { @@ -50,8 +49,7 @@ service RecaptchaEnterpriseService { // Annotates a previously created Assessment to provide additional information // on whether the event turned out to be authentic or fraudulent. - rpc AnnotateAssessment(AnnotateAssessmentRequest) - returns (AnnotateAssessmentResponse) { + rpc AnnotateAssessment(AnnotateAssessmentRequest) returns (AnnotateAssessmentResponse) { option (google.api.http) = { post: "/v1/{name=projects/*/assessments/*}:annotate" body: "*" @@ -74,6 +72,16 @@ service RecaptchaEnterpriseService { }; } + // Returns the secret key related to the specified public key. + // You must use the legacy secret key only in a 3rd party integration with + // legacy reCAPTCHA. + rpc RetrieveLegacySecretKey(RetrieveLegacySecretKeyRequest) returns (RetrieveLegacySecretKeyResponse) { + option (google.api.http) = { + get: "/v1/{key=projects/*/keys/*}:retrieveLegacySecretKey" + }; + option (google.api.method_signature) = "key"; + } + // Returns the specified key. rpc GetKey(GetKeyRequest) returns (Key) { option (google.api.http) = { @@ -119,18 +127,15 @@ service RecaptchaEnterpriseService { } // List groups of related accounts. - rpc ListRelatedAccountGroups(ListRelatedAccountGroupsRequest) - returns (ListRelatedAccountGroupsResponse) { + rpc ListRelatedAccountGroups(ListRelatedAccountGroupsRequest) returns (ListRelatedAccountGroupsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*}/relatedaccountgroups" }; option (google.api.method_signature) = "parent"; } - // Get the memberships in a group of related accounts. - rpc ListRelatedAccountGroupMemberships( - ListRelatedAccountGroupMembershipsRequest) - returns (ListRelatedAccountGroupMembershipsResponse) { + // Get memberships in a group of related accounts. + rpc ListRelatedAccountGroupMemberships(ListRelatedAccountGroupMembershipsRequest) returns (ListRelatedAccountGroupMembershipsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/relatedaccountgroups/*}/memberships" }; @@ -138,9 +143,7 @@ service RecaptchaEnterpriseService { } // Search group memberships related to a given account. - rpc SearchRelatedAccountGroupMemberships( - SearchRelatedAccountGroupMembershipsRequest) - returns (SearchRelatedAccountGroupMembershipsResponse) { + rpc SearchRelatedAccountGroupMemberships(SearchRelatedAccountGroupMembershipsRequest) returns (SearchRelatedAccountGroupMembershipsResponse) { option (google.api.http) = { post: "/v1/{project=projects/*}/relatedaccountgroupmemberships:search" body: "*" @@ -193,21 +196,38 @@ message AnnotateAssessmentRequest { // Default unspecified reason. REASON_UNSPECIFIED = 0; - // Indicates a chargeback issued for the transaction with no other details. - // When possible, specify the type by using CHARGEBACK_FRAUD or + // Indicates that the transaction had a chargeback issued with no other + // details. When possible, specify the type by using CHARGEBACK_FRAUD or // CHARGEBACK_DISPUTE instead. CHARGEBACK = 1; - // Indicates a chargeback related to an alleged unauthorized transaction - // from the cardholder's perspective (for example, the card number was - // stolen). + // Indicates that the transaction had a chargeback issued related to an + // alleged unauthorized transaction from the cardholder's perspective (for + // example, the card number was stolen). CHARGEBACK_FRAUD = 8; - // Indicates a chargeback related to the cardholder having provided their - // card details but allegedly not being satisfied with the purchase - // (for example, misrepresentation, attempted cancellation). + // Indicates that the transaction had a chargeback issued related to the + // cardholder having provided their card details but allegedly not being + // satisfied with the purchase (for example, misrepresentation, attempted + // cancellation). CHARGEBACK_DISPUTE = 9; + // Indicates that the completed payment transaction was refunded by the + // seller. + REFUND = 10; + + // Indicates that the completed payment transaction was determined to be + // fraudulent by the seller, and was cancelled and refunded as a result. + REFUND_FRAUD = 11; + + // Indicates that the payment transaction was accepted, and the user was + // charged. + TRANSACTION_ACCEPTED = 12; + + // Indicates that the payment transaction was declined, for example due to + // invalid card details. + TRANSACTION_DECLINED = 13; + // Indicates the transaction associated with the assessment is suspected of // being fraudulent based on the payment method, billing details, shipping // address or other transaction information. @@ -230,6 +250,10 @@ message AnnotateAssessmentRequest { // Indicates the user provided an incorrect password. INCORRECT_PASSWORD = 6; + + // Indicates that the user sent unwanted and abusive messages to other users + // of the platform, such as spam, scams, phishing, or social engineering. + SOCIAL_SPAM = 14; } // Required. The resource name of the Assessment, in the format @@ -241,17 +265,16 @@ message AnnotateAssessmentRequest { } ]; - // Optional. The annotation that will be assigned to the Event. This field can - // be left empty to provide reasons that apply to an event without concluding - // whether the event is legitimate or fraudulent. + // Optional. The annotation that will be assigned to the Event. This field can be left + // empty to provide reasons that apply to an event without concluding whether + // the event is legitimate or fraudulent. Annotation annotation = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Optional reasons for the annotation that will be assigned to the - // Event. + // Optional. Optional reasons for the annotation that will be assigned to the Event. repeated Reason reasons = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Optional unique stable hashed user identifier to apply to the - // assessment. This is an alternative to setting the hashed_account_id in + // Optional. Unique stable hashed user identifier to apply to the assessment. + // This is an alternative to setting the hashed_account_id in // CreateAssessment, for example when the account identifier is not yet known // in the initial request. It is recommended that the identifier is hashed // using hmac-sha256 with stable secret. @@ -259,7 +282,31 @@ message AnnotateAssessmentRequest { } // Empty response for AnnotateAssessment. -message AnnotateAssessmentResponse {} +message AnnotateAssessmentResponse { + +} + +// Private password leak verification info. +message PrivatePasswordLeakVerification { + // Optional. Exactly 26-bit prefix of the SHA-256 hash of the canonicalized username. It + // is used to look up password leaks associated with that hash prefix. + bytes lookup_hash_prefix = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Encrypted Scrypt hash of the canonicalized username+password. It is + // re-encrypted by the server and returned through + // `reencrypted_user_credentials_hash`. + bytes encrypted_user_credentials_hash = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. List of prefixes of the encrypted potential password leaks that matched the + // given parameters. They must be compared with the client-side decryption + // prefix of `reencrypted_user_credentials_hash` + repeated bytes encrypted_leak_match_prefixes = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Corresponds to the re-encryption of the `encrypted_user_credentials_hash` + // field. It is used to match potential password leaks within + // `encrypted_leak_match_prefixes`. + bytes reencrypted_user_credentials_hash = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} // A recaptcha assessment resource. message Assessment { @@ -279,41 +326,40 @@ message Assessment { RiskAnalysis risk_analysis = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Properties of the provided event token. - TokenProperties token_properties = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; + TokenProperties token_properties = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Assessment returned by Account Defender when a hashed_account_id is + // Assessment returned by account defender when a hashed_account_id is // provided. AccountDefenderAssessment account_defender_assessment = 6; - // Password leak verification info. + // The private password leak verification field contains the parameters that + // are used to to check for leaks privately without sharing user credentials. PrivatePasswordLeakVerification private_password_leak_verification = 8; } message Event { - // Optional. The user response token provided by the reCAPTCHA client-side - // integration on your site. + // Optional. The user response token provided by the reCAPTCHA client-side integration + // on your site. string token = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The site key that was used to invoke reCAPTCHA on your site and - // generate the token. + // Optional. The site key that was used to invoke reCAPTCHA on your site and generate + // the token. string site_key = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The user agent present in the request from the user's device - // related to this event. + // Optional. The user agent present in the request from the user's device related to + // this event. string user_agent = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The IP address in the request from the user's device related to - // this event. + // Optional. The IP address in the request from the user's device related to this event. string user_ip_address = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The expected action for this type of event. This should be the - // same action provided at token generation time on client-side platforms - // already integrated with recaptcha enterprise. + // Optional. The expected action for this type of event. This should be the same action + // provided at token generation time on client-side platforms already + // integrated with recaptcha enterprise. string expected_action = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Optional unique stable hashed user identifier for the request. - // The identifier should ideally be hashed using sha256 with stable secret. + // Optional. Unique stable hashed user identifier for the request. The identifier must + // be hashed using hmac-sha256 with stable secret. bytes hashed_account_id = 6 [(google.api.field_behavior) = OPTIONAL]; } @@ -390,16 +436,16 @@ message TokenProperties { // The timestamp corresponding to the generation of the token. google.protobuf.Timestamp create_time = 3; - // The hostname of the page on which the token was generated. + // The hostname of the page on which the token was generated (Web keys only). string hostname = 4; // Action name provided at token generation. string action = 5; } -// Account Defender risk assessment. +// Account defender risk assessment. message AccountDefenderAssessment { - // Labels returned by Account Defender for this request. + // Labels returned by account defender for this request. enum AccountDefenderLabel { // Default unspecified type. ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0; @@ -407,17 +453,17 @@ message AccountDefenderAssessment { // The request matches a known good profile for the user. PROFILE_MATCH = 1; - // The request is potentially a suspicious login event and should be further - // verified either via multi-factor authentication or another system. + // The request is potentially a suspicious login event and must be further + // verified either through multi-factor authentication or another system. SUSPICIOUS_LOGIN_ACTIVITY = 2; // The request matched a profile that previously had suspicious account - // creation behavior. This could mean this is a fake account. + // creation behavior. This can mean that this is a fake account. SUSPICIOUS_ACCOUNT_CREATION = 3; // The account in the request has a high number of related accounts. It does - // not necessarily imply that the account is bad but could require - // investigating. + // not necessarily imply that the account is bad but can require further + // investigation. RELATED_ACCOUNTS_NUMBER_HIGH = 4; } @@ -425,31 +471,6 @@ message AccountDefenderAssessment { repeated AccountDefenderLabel labels = 1; } -// Private password leak verification info. -message PrivatePasswordLeakVerification { - // Exactly 26-bit prefix of the SHA-256 hash of the canonicalized username. It - // is used to look up password leaks associated with that hash prefix. - bytes lookup_hash_prefix = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Encrypted Scrypt hash of the canonicalized username+password. It is - // re-encrypted by the server and returned through - // `reencrypted_user_credentials_hash`. - bytes encrypted_user_credentials_hash = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // List of prefixes of the encrypted potential password leaks that matched the - // given parameters. They should be compared with the client-side decryption - // prefix of `reencrypted_user_credentials_hash` - repeated bytes encrypted_leak_match_prefixes = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Corresponds to the re-encryption of the `encrypted_user_credentials_hash` - // field. Used to match potential password leaks within - // `encrypted_leak_match_prefixes`. - bytes reencrypted_user_credentials_hash = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - // The create key request message. message CreateKeyRequest { // Required. The name of the project in which the key will be created, in the @@ -495,6 +516,18 @@ message ListKeysResponse { string next_page_token = 2; } +// The retrieve legacy secret key request message. +message RetrieveLegacySecretKeyRequest { + // Required. The public key name linked to the requested secret key in the format + // "projects/{project}/keys/{key}". + string key = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/Key" + } + ]; +} + // The get key request message. message GetKeyRequest { // Required. The name of the requested key, in the format @@ -512,10 +545,9 @@ message UpdateKeyRequest { // Required. The key to update. Key key = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The mask to control which fields of the key get updated. If the - // mask is not present, all fields will be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = OPTIONAL]; + // Optional. The mask to control which fields of the key get updated. If the mask is not + // present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; } // The delete key request message. @@ -578,6 +610,16 @@ message Metrics { repeated ChallengeMetrics challenge_metrics = 3; } +// Secret key is used only in legacy reCAPTCHA. It must be used in a 3rd party +// integration with legacy reCAPTCHA. +message RetrieveLegacySecretKeyResponse { + // The secret key (also known as shared secret) authorizes communication + // between your application backend and the reCAPTCHA Enterprise server to + // create an assessment. + // The secret key needs to be kept safe for security purposes. + string legacy_secret_key = 1; +} + // A key used to identify and configure applications (web and/or mobile) that // use reCAPTCHA Enterprise. message Key { @@ -593,8 +635,8 @@ message Key { // Human-readable display name of this key. Modifiable by user. string display_name = 2; - // Platform specific settings for this key. The key can only be used on one - // platform, the one it has settings for. + // Platform specific settings for this key. The key can only be used on a + // platform for which the settings are enabled. oneof platform_settings { // Settings for keys that can be used by websites. WebKeySettings web_settings = 3; @@ -777,14 +819,14 @@ message ListRelatedAccountGroupMembershipsRequest { } ]; - // Optional. The maximum number of accounts to return. The service may return - // fewer than this value. If unspecified, at most 50 accounts will be - // returned. The maximum value is 1000; values above 1000 will be coerced to - // 1000. + // Optional. The maximum number of accounts to return. The service might return fewer + // than this value. + // If unspecified, at most 50 accounts are returned. + // The maximum value is 1000; values above 1000 are coerced to 1000. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A page token, received from a previous - // `ListRelatedAccountGroupMemberships` call. + // Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` + // call. // // When paginating, all other parameters provided to // `ListRelatedAccountGroupMemberships` must match the call that provided the @@ -804,8 +846,8 @@ message ListRelatedAccountGroupMembershipsResponse { // The request message to list related account groups. message ListRelatedAccountGroupsRequest { - // Required. The name of the project to list related account groups from, in - // the format "projects/{project}". + // Required. The name of the project to list related account groups from, in the format + // "projects/{project}". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -813,13 +855,14 @@ message ListRelatedAccountGroupsRequest { } ]; - // Optional. The maximum number of groups to return. The service may return - // fewer than this value. If unspecified, at most 50 groups will be returned. - // The maximum value is 1000; values above 1000 will be coerced to 1000. + // Optional. The maximum number of groups to return. The service might return fewer than + // this value. + // If unspecified, at most 50 groups are returned. + // The maximum value is 1000; values above 1000 are coerced to 1000. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A page token, received from a previous `ListRelatedAccountGroups` - // call. Provide this to retrieve the subsequent page. + // Optional. A page token, received from a previous `ListRelatedAccountGroups` call. + // Provide this to retrieve the subsequent page. // // When paginating, all other parameters provided to // `ListRelatedAccountGroups` must match the call that provided the page @@ -839,8 +882,8 @@ message ListRelatedAccountGroupsResponse { // The request message to search related account group memberships. message SearchRelatedAccountGroupMembershipsRequest { - // Required. The name of the project to search related account group - // memberships from, in the format "projects/{project}". + // Required. The name of the project to search related account group memberships from. + // Specify the project name in the following format: "projects/{project}". string project = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -848,14 +891,15 @@ message SearchRelatedAccountGroupMembershipsRequest { } ]; - // Optional. The unique stable hashed user identifier we should search - // connections to. The identifier should correspond to a `hashed_account_id` - // provided in a previous CreateAssessment or AnnotateAssessment call. + // Optional. The unique stable hashed user identifier we should search connections to. + // The identifier should correspond to a `hashed_account_id` provided in a + // previous `CreateAssessment` or `AnnotateAssessment` call. bytes hashed_account_id = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The maximum number of groups to return. The service may return - // fewer than this value. If unspecified, at most 50 groups will be returned. - // The maximum value is 1000; values above 1000 will be coerced to 1000. + // Optional. The maximum number of groups to return. The service might return fewer than + // this value. + // If unspecified, at most 50 groups are returned. + // The maximum value is 1000; values above 1000 are coerced to 1000. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. A page token, received from a previous @@ -896,7 +940,7 @@ message RelatedAccountGroupMembership { // The unique stable hashed user identifier of the member. The identifier // corresponds to a `hashed_account_id` provided in a previous - // CreateAssessment or AnnotateAssessment call. + // `CreateAssessment` or `AnnotateAssessment` call. bytes hashed_account_id = 2; } diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 405be8a8ac4..a19b96effa5 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -102,6 +102,20 @@ export namespace google { */ public listKeys(request: google.cloud.recaptchaenterprise.v1.IListKeysRequest): Promise; + /** + * Calls RetrieveLegacySecretKey. + * @param request RetrieveLegacySecretKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RetrieveLegacySecretKeyResponse + */ + public retrieveLegacySecretKey(request: google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest, callback: google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.RetrieveLegacySecretKeyCallback): void; + + /** + * Calls RetrieveLegacySecretKey. + * @param request RetrieveLegacySecretKeyRequest message or plain object + * @returns Promise + */ + public retrieveLegacySecretKey(request: google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest): Promise; + /** * Calls GetKey. * @param request GetKeyRequest message or plain object @@ -245,6 +259,13 @@ export namespace google { */ type ListKeysCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.ListKeysResponse) => void; + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|retrieveLegacySecretKey}. + * @param error Error, if any + * @param [response] RetrieveLegacySecretKeyResponse + */ + type RetrieveLegacySecretKeyCallback = (error: (Error|null), response?: google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse) => void; + /** * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|getKey}. * @param error Error, if any @@ -537,12 +558,17 @@ export namespace google { CHARGEBACK = 1, CHARGEBACK_FRAUD = 8, CHARGEBACK_DISPUTE = 9, + REFUND = 10, + REFUND_FRAUD = 11, + TRANSACTION_ACCEPTED = 12, + TRANSACTION_DECLINED = 13, PAYMENT_HEURISTICS = 2, INITIATED_TWO_FACTOR = 7, PASSED_TWO_FACTOR = 3, FAILED_TWO_FACTOR = 4, CORRECT_PASSWORD = 5, - INCORRECT_PASSWORD = 6 + INCORRECT_PASSWORD = 6, + SOCIAL_SPAM = 14 } } @@ -637,6 +663,121 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a PrivatePasswordLeakVerification. */ + interface IPrivatePasswordLeakVerification { + + /** PrivatePasswordLeakVerification lookupHashPrefix */ + lookupHashPrefix?: (Uint8Array|string|null); + + /** PrivatePasswordLeakVerification encryptedUserCredentialsHash */ + encryptedUserCredentialsHash?: (Uint8Array|string|null); + + /** PrivatePasswordLeakVerification encryptedLeakMatchPrefixes */ + encryptedLeakMatchPrefixes?: (Uint8Array[]|null); + + /** PrivatePasswordLeakVerification reencryptedUserCredentialsHash */ + reencryptedUserCredentialsHash?: (Uint8Array|string|null); + } + + /** Represents a PrivatePasswordLeakVerification. */ + class PrivatePasswordLeakVerification implements IPrivatePasswordLeakVerification { + + /** + * Constructs a new PrivatePasswordLeakVerification. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification); + + /** PrivatePasswordLeakVerification lookupHashPrefix. */ + public lookupHashPrefix: (Uint8Array|string); + + /** PrivatePasswordLeakVerification encryptedUserCredentialsHash. */ + public encryptedUserCredentialsHash: (Uint8Array|string); + + /** PrivatePasswordLeakVerification encryptedLeakMatchPrefixes. */ + public encryptedLeakMatchPrefixes: Uint8Array[]; + + /** PrivatePasswordLeakVerification reencryptedUserCredentialsHash. */ + public reencryptedUserCredentialsHash: (Uint8Array|string); + + /** + * Creates a new PrivatePasswordLeakVerification instance using the specified properties. + * @param [properties] Properties to set + * @returns PrivatePasswordLeakVerification instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification): google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification; + + /** + * Encodes the specified PrivatePasswordLeakVerification message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.verify|verify} messages. + * @param message PrivatePasswordLeakVerification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrivatePasswordLeakVerification message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.verify|verify} messages. + * @param message PrivatePasswordLeakVerification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrivatePasswordLeakVerification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrivatePasswordLeakVerification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification; + + /** + * Decodes a PrivatePasswordLeakVerification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrivatePasswordLeakVerification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification; + + /** + * Verifies a PrivatePasswordLeakVerification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrivatePasswordLeakVerification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrivatePasswordLeakVerification + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification; + + /** + * Creates a plain object from a PrivatePasswordLeakVerification message. Also converts values to other types if specified. + * @param message PrivatePasswordLeakVerification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrivatePasswordLeakVerification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrivatePasswordLeakVerification + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an Assessment. */ interface IAssessment { @@ -1251,121 +1392,6 @@ export namespace google { } } - /** Properties of a PrivatePasswordLeakVerification. */ - interface IPrivatePasswordLeakVerification { - - /** PrivatePasswordLeakVerification lookupHashPrefix */ - lookupHashPrefix?: (Uint8Array|string|null); - - /** PrivatePasswordLeakVerification encryptedUserCredentialsHash */ - encryptedUserCredentialsHash?: (Uint8Array|string|null); - - /** PrivatePasswordLeakVerification encryptedLeakMatchPrefixes */ - encryptedLeakMatchPrefixes?: (Uint8Array[]|null); - - /** PrivatePasswordLeakVerification reencryptedUserCredentialsHash */ - reencryptedUserCredentialsHash?: (Uint8Array|string|null); - } - - /** Represents a PrivatePasswordLeakVerification. */ - class PrivatePasswordLeakVerification implements IPrivatePasswordLeakVerification { - - /** - * Constructs a new PrivatePasswordLeakVerification. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification); - - /** PrivatePasswordLeakVerification lookupHashPrefix. */ - public lookupHashPrefix: (Uint8Array|string); - - /** PrivatePasswordLeakVerification encryptedUserCredentialsHash. */ - public encryptedUserCredentialsHash: (Uint8Array|string); - - /** PrivatePasswordLeakVerification encryptedLeakMatchPrefixes. */ - public encryptedLeakMatchPrefixes: Uint8Array[]; - - /** PrivatePasswordLeakVerification reencryptedUserCredentialsHash. */ - public reencryptedUserCredentialsHash: (Uint8Array|string); - - /** - * Creates a new PrivatePasswordLeakVerification instance using the specified properties. - * @param [properties] Properties to set - * @returns PrivatePasswordLeakVerification instance - */ - public static create(properties?: google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification): google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification; - - /** - * Encodes the specified PrivatePasswordLeakVerification message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.verify|verify} messages. - * @param message PrivatePasswordLeakVerification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PrivatePasswordLeakVerification message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.verify|verify} messages. - * @param message PrivatePasswordLeakVerification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PrivatePasswordLeakVerification message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PrivatePasswordLeakVerification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification; - - /** - * Decodes a PrivatePasswordLeakVerification message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PrivatePasswordLeakVerification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification; - - /** - * Verifies a PrivatePasswordLeakVerification message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PrivatePasswordLeakVerification message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PrivatePasswordLeakVerification - */ - public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification; - - /** - * Creates a plain object from a PrivatePasswordLeakVerification message. Also converts values to other types if specified. - * @param message PrivatePasswordLeakVerification - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PrivatePasswordLeakVerification to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PrivatePasswordLeakVerification - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - /** Properties of a CreateKeyRequest. */ interface ICreateKeyRequest { @@ -1681,6 +1707,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a RetrieveLegacySecretKeyRequest. */ + interface IRetrieveLegacySecretKeyRequest { + + /** RetrieveLegacySecretKeyRequest key */ + key?: (string|null); + } + + /** Represents a RetrieveLegacySecretKeyRequest. */ + class RetrieveLegacySecretKeyRequest implements IRetrieveLegacySecretKeyRequest { + + /** + * Constructs a new RetrieveLegacySecretKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest); + + /** RetrieveLegacySecretKeyRequest key. */ + public key: string; + + /** + * Creates a new RetrieveLegacySecretKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveLegacySecretKeyRequest instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest): google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest; + + /** + * Encodes the specified RetrieveLegacySecretKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest.verify|verify} messages. + * @param message RetrieveLegacySecretKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveLegacySecretKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest.verify|verify} messages. + * @param message RetrieveLegacySecretKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveLegacySecretKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveLegacySecretKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest; + + /** + * Decodes a RetrieveLegacySecretKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveLegacySecretKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest; + + /** + * Verifies a RetrieveLegacySecretKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrieveLegacySecretKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveLegacySecretKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest; + + /** + * Creates a plain object from a RetrieveLegacySecretKeyRequest message. Also converts values to other types if specified. + * @param message RetrieveLegacySecretKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveLegacySecretKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveLegacySecretKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a GetKeyRequest. */ interface IGetKeyRequest { @@ -2287,6 +2410,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a RetrieveLegacySecretKeyResponse. */ + interface IRetrieveLegacySecretKeyResponse { + + /** RetrieveLegacySecretKeyResponse legacySecretKey */ + legacySecretKey?: (string|null); + } + + /** Represents a RetrieveLegacySecretKeyResponse. */ + class RetrieveLegacySecretKeyResponse implements IRetrieveLegacySecretKeyResponse { + + /** + * Constructs a new RetrieveLegacySecretKeyResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse); + + /** RetrieveLegacySecretKeyResponse legacySecretKey. */ + public legacySecretKey: string; + + /** + * Creates a new RetrieveLegacySecretKeyResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveLegacySecretKeyResponse instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse): google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse; + + /** + * Encodes the specified RetrieveLegacySecretKeyResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse.verify|verify} messages. + * @param message RetrieveLegacySecretKeyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveLegacySecretKeyResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse.verify|verify} messages. + * @param message RetrieveLegacySecretKeyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveLegacySecretKeyResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveLegacySecretKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse; + + /** + * Decodes a RetrieveLegacySecretKeyResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveLegacySecretKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse; + + /** + * Verifies a RetrieveLegacySecretKeyResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrieveLegacySecretKeyResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveLegacySecretKeyResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse; + + /** + * Creates a plain object from a RetrieveLegacySecretKeyResponse message. Also converts values to other types if specified. + * @param message RetrieveLegacySecretKeyResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveLegacySecretKeyResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveLegacySecretKeyResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Key. */ interface IKey { diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index bbe54b1e333..ab3c204895c 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -230,6 +230,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|retrieveLegacySecretKey}. + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @typedef RetrieveLegacySecretKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse} [response] RetrieveLegacySecretKeyResponse + */ + + /** + * Calls RetrieveLegacySecretKey. + * @function retrieveLegacySecretKey + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest} request RetrieveLegacySecretKeyRequest message or plain object + * @param {google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.RetrieveLegacySecretKeyCallback} callback Node-style callback called with the error, if any, and RetrieveLegacySecretKeyResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RecaptchaEnterpriseService.prototype.retrieveLegacySecretKey = function retrieveLegacySecretKey(request, callback) { + return this.rpcCall(retrieveLegacySecretKey, $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest, $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse, request, callback); + }, "name", { value: "RetrieveLegacySecretKey" }); + + /** + * Calls RetrieveLegacySecretKey. + * @function retrieveLegacySecretKey + * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService + * @instance + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest} request RetrieveLegacySecretKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService|getKey}. * @memberof google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService @@ -942,12 +975,17 @@ case 1: case 8: case 9: + case 10: + case 11: + case 12: + case 13: case 2: case 7: case 3: case 4: case 5: case 6: + case 14: break; } } @@ -1016,6 +1054,22 @@ case 9: message.reasons[i] = 9; break; + case "REFUND": + case 10: + message.reasons[i] = 10; + break; + case "REFUND_FRAUD": + case 11: + message.reasons[i] = 11; + break; + case "TRANSACTION_ACCEPTED": + case 12: + message.reasons[i] = 12; + break; + case "TRANSACTION_DECLINED": + case 13: + message.reasons[i] = 13; + break; case "PAYMENT_HEURISTICS": case 2: message.reasons[i] = 2; @@ -1040,6 +1094,10 @@ case 6: message.reasons[i] = 6; break; + case "SOCIAL_SPAM": + case 14: + message.reasons[i] = 14; + break; } } if (object.hashedAccountId != null) @@ -1144,12 +1202,17 @@ * @property {number} CHARGEBACK=1 CHARGEBACK value * @property {number} CHARGEBACK_FRAUD=8 CHARGEBACK_FRAUD value * @property {number} CHARGEBACK_DISPUTE=9 CHARGEBACK_DISPUTE value + * @property {number} REFUND=10 REFUND value + * @property {number} REFUND_FRAUD=11 REFUND_FRAUD value + * @property {number} TRANSACTION_ACCEPTED=12 TRANSACTION_ACCEPTED value + * @property {number} TRANSACTION_DECLINED=13 TRANSACTION_DECLINED value * @property {number} PAYMENT_HEURISTICS=2 PAYMENT_HEURISTICS value * @property {number} INITIATED_TWO_FACTOR=7 INITIATED_TWO_FACTOR value * @property {number} PASSED_TWO_FACTOR=3 PASSED_TWO_FACTOR value * @property {number} FAILED_TWO_FACTOR=4 FAILED_TWO_FACTOR value * @property {number} CORRECT_PASSWORD=5 CORRECT_PASSWORD value * @property {number} INCORRECT_PASSWORD=6 INCORRECT_PASSWORD value + * @property {number} SOCIAL_SPAM=14 SOCIAL_SPAM value */ AnnotateAssessmentRequest.Reason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -1157,12 +1220,17 @@ values[valuesById[1] = "CHARGEBACK"] = 1; values[valuesById[8] = "CHARGEBACK_FRAUD"] = 8; values[valuesById[9] = "CHARGEBACK_DISPUTE"] = 9; + values[valuesById[10] = "REFUND"] = 10; + values[valuesById[11] = "REFUND_FRAUD"] = 11; + values[valuesById[12] = "TRANSACTION_ACCEPTED"] = 12; + values[valuesById[13] = "TRANSACTION_DECLINED"] = 13; values[valuesById[2] = "PAYMENT_HEURISTICS"] = 2; values[valuesById[7] = "INITIATED_TWO_FACTOR"] = 7; values[valuesById[3] = "PASSED_TWO_FACTOR"] = 3; values[valuesById[4] = "FAILED_TWO_FACTOR"] = 4; values[valuesById[5] = "CORRECT_PASSWORD"] = 5; values[valuesById[6] = "INCORRECT_PASSWORD"] = 6; + values[valuesById[14] = "SOCIAL_SPAM"] = 14; return values; })(); @@ -1344,29 +1412,28 @@ return AnnotateAssessmentResponse; })(); - v1.Assessment = (function() { + v1.PrivatePasswordLeakVerification = (function() { /** - * Properties of an Assessment. + * Properties of a PrivatePasswordLeakVerification. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IAssessment - * @property {string|null} [name] Assessment name - * @property {google.cloud.recaptchaenterprise.v1.IEvent|null} [event] Assessment event - * @property {google.cloud.recaptchaenterprise.v1.IRiskAnalysis|null} [riskAnalysis] Assessment riskAnalysis - * @property {google.cloud.recaptchaenterprise.v1.ITokenProperties|null} [tokenProperties] Assessment tokenProperties - * @property {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment|null} [accountDefenderAssessment] Assessment accountDefenderAssessment - * @property {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification|null} [privatePasswordLeakVerification] Assessment privatePasswordLeakVerification + * @interface IPrivatePasswordLeakVerification + * @property {Uint8Array|null} [lookupHashPrefix] PrivatePasswordLeakVerification lookupHashPrefix + * @property {Uint8Array|null} [encryptedUserCredentialsHash] PrivatePasswordLeakVerification encryptedUserCredentialsHash + * @property {Array.|null} [encryptedLeakMatchPrefixes] PrivatePasswordLeakVerification encryptedLeakMatchPrefixes + * @property {Uint8Array|null} [reencryptedUserCredentialsHash] PrivatePasswordLeakVerification reencryptedUserCredentialsHash */ /** - * Constructs a new Assessment. + * Constructs a new PrivatePasswordLeakVerification. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents an Assessment. - * @implements IAssessment + * @classdesc Represents a PrivatePasswordLeakVerification. + * @implements IPrivatePasswordLeakVerification * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IAssessment=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification=} [properties] Properties to set */ - function Assessment(properties) { + function PrivatePasswordLeakVerification(properties) { + this.encryptedLeakMatchPrefixes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1374,145 +1441,120 @@ } /** - * Assessment name. - * @member {string} name - * @memberof google.cloud.recaptchaenterprise.v1.Assessment - * @instance - */ - Assessment.prototype.name = ""; - - /** - * Assessment event. - * @member {google.cloud.recaptchaenterprise.v1.IEvent|null|undefined} event - * @memberof google.cloud.recaptchaenterprise.v1.Assessment - * @instance - */ - Assessment.prototype.event = null; - - /** - * Assessment riskAnalysis. - * @member {google.cloud.recaptchaenterprise.v1.IRiskAnalysis|null|undefined} riskAnalysis - * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * PrivatePasswordLeakVerification lookupHashPrefix. + * @member {Uint8Array} lookupHashPrefix + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification * @instance */ - Assessment.prototype.riskAnalysis = null; + PrivatePasswordLeakVerification.prototype.lookupHashPrefix = $util.newBuffer([]); /** - * Assessment tokenProperties. - * @member {google.cloud.recaptchaenterprise.v1.ITokenProperties|null|undefined} tokenProperties - * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * PrivatePasswordLeakVerification encryptedUserCredentialsHash. + * @member {Uint8Array} encryptedUserCredentialsHash + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification * @instance */ - Assessment.prototype.tokenProperties = null; + PrivatePasswordLeakVerification.prototype.encryptedUserCredentialsHash = $util.newBuffer([]); /** - * Assessment accountDefenderAssessment. - * @member {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment|null|undefined} accountDefenderAssessment - * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * PrivatePasswordLeakVerification encryptedLeakMatchPrefixes. + * @member {Array.} encryptedLeakMatchPrefixes + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification * @instance */ - Assessment.prototype.accountDefenderAssessment = null; + PrivatePasswordLeakVerification.prototype.encryptedLeakMatchPrefixes = $util.emptyArray; /** - * Assessment privatePasswordLeakVerification. - * @member {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification|null|undefined} privatePasswordLeakVerification - * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * PrivatePasswordLeakVerification reencryptedUserCredentialsHash. + * @member {Uint8Array} reencryptedUserCredentialsHash + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification * @instance */ - Assessment.prototype.privatePasswordLeakVerification = null; + PrivatePasswordLeakVerification.prototype.reencryptedUserCredentialsHash = $util.newBuffer([]); /** - * Creates a new Assessment instance using the specified properties. + * Creates a new PrivatePasswordLeakVerification instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification * @static - * @param {google.cloud.recaptchaenterprise.v1.IAssessment=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.Assessment} Assessment instance + * @param {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification} PrivatePasswordLeakVerification instance */ - Assessment.create = function create(properties) { - return new Assessment(properties); + PrivatePasswordLeakVerification.create = function create(properties) { + return new PrivatePasswordLeakVerification(properties); }; /** - * Encodes the specified Assessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Assessment.verify|verify} messages. + * Encodes the specified PrivatePasswordLeakVerification message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification * @static - * @param {google.cloud.recaptchaenterprise.v1.IAssessment} message Assessment message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification} message PrivatePasswordLeakVerification message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Assessment.encode = function encode(message, writer) { + PrivatePasswordLeakVerification.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.event != null && Object.hasOwnProperty.call(message, "event")) - $root.google.cloud.recaptchaenterprise.v1.Event.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.riskAnalysis != null && Object.hasOwnProperty.call(message, "riskAnalysis")) - $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.encode(message.riskAnalysis, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.tokenProperties != null && Object.hasOwnProperty.call(message, "tokenProperties")) - $root.google.cloud.recaptchaenterprise.v1.TokenProperties.encode(message.tokenProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.accountDefenderAssessment != null && Object.hasOwnProperty.call(message, "accountDefenderAssessment")) - $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.encode(message.accountDefenderAssessment, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.privatePasswordLeakVerification != null && Object.hasOwnProperty.call(message, "privatePasswordLeakVerification")) - $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.encode(message.privatePasswordLeakVerification, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.lookupHashPrefix != null && Object.hasOwnProperty.call(message, "lookupHashPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.lookupHashPrefix); + if (message.encryptedUserCredentialsHash != null && Object.hasOwnProperty.call(message, "encryptedUserCredentialsHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.encryptedUserCredentialsHash); + if (message.encryptedLeakMatchPrefixes != null && message.encryptedLeakMatchPrefixes.length) + for (var i = 0; i < message.encryptedLeakMatchPrefixes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.encryptedLeakMatchPrefixes[i]); + if (message.reencryptedUserCredentialsHash != null && Object.hasOwnProperty.call(message, "reencryptedUserCredentialsHash")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.reencryptedUserCredentialsHash); return writer; }; /** - * Encodes the specified Assessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Assessment.verify|verify} messages. + * Encodes the specified PrivatePasswordLeakVerification message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification * @static - * @param {google.cloud.recaptchaenterprise.v1.IAssessment} message Assessment message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification} message PrivatePasswordLeakVerification message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Assessment.encodeDelimited = function encodeDelimited(message, writer) { + PrivatePasswordLeakVerification.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Assessment message from the specified reader or buffer. + * Decodes a PrivatePasswordLeakVerification message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1.Assessment} Assessment + * @returns {google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification} PrivatePasswordLeakVerification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Assessment.decode = function decode(reader, length) { + PrivatePasswordLeakVerification.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.Assessment(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.lookupHashPrefix = reader.bytes(); break; } case 2: { - message.event = $root.google.cloud.recaptchaenterprise.v1.Event.decode(reader, reader.uint32()); + message.encryptedUserCredentialsHash = reader.bytes(); break; } case 3: { - message.riskAnalysis = $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.decode(reader, reader.uint32()); + if (!(message.encryptedLeakMatchPrefixes && message.encryptedLeakMatchPrefixes.length)) + message.encryptedLeakMatchPrefixes = []; + message.encryptedLeakMatchPrefixes.push(reader.bytes()); break; } case 4: { - message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.decode(reader, reader.uint32()); - break; - } - case 6: { - message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.decode(reader, reader.uint32()); - break; - } - case 8: { - message.privatePasswordLeakVerification = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.decode(reader, reader.uint32()); + message.reencryptedUserCredentialsHash = reader.bytes(); break; } default: @@ -1524,193 +1566,195 @@ }; /** - * Decodes an Assessment message from the specified reader or buffer, length delimited. + * Decodes a PrivatePasswordLeakVerification message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.Assessment} Assessment + * @returns {google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification} PrivatePasswordLeakVerification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Assessment.decodeDelimited = function decodeDelimited(reader) { + PrivatePasswordLeakVerification.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Assessment message. + * Verifies a PrivatePasswordLeakVerification message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Assessment.verify = function verify(message) { + PrivatePasswordLeakVerification.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.event != null && message.hasOwnProperty("event")) { - var error = $root.google.cloud.recaptchaenterprise.v1.Event.verify(message.event); - if (error) - return "event." + error; - } - if (message.riskAnalysis != null && message.hasOwnProperty("riskAnalysis")) { - var error = $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.verify(message.riskAnalysis); - if (error) - return "riskAnalysis." + error; - } - if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) { - var error = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.verify(message.tokenProperties); - if (error) - return "tokenProperties." + error; - } - if (message.accountDefenderAssessment != null && message.hasOwnProperty("accountDefenderAssessment")) { - var error = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify(message.accountDefenderAssessment); - if (error) - return "accountDefenderAssessment." + error; - } - if (message.privatePasswordLeakVerification != null && message.hasOwnProperty("privatePasswordLeakVerification")) { - var error = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.verify(message.privatePasswordLeakVerification); - if (error) - return "privatePasswordLeakVerification." + error; + if (message.lookupHashPrefix != null && message.hasOwnProperty("lookupHashPrefix")) + if (!(message.lookupHashPrefix && typeof message.lookupHashPrefix.length === "number" || $util.isString(message.lookupHashPrefix))) + return "lookupHashPrefix: buffer expected"; + if (message.encryptedUserCredentialsHash != null && message.hasOwnProperty("encryptedUserCredentialsHash")) + if (!(message.encryptedUserCredentialsHash && typeof message.encryptedUserCredentialsHash.length === "number" || $util.isString(message.encryptedUserCredentialsHash))) + return "encryptedUserCredentialsHash: buffer expected"; + if (message.encryptedLeakMatchPrefixes != null && message.hasOwnProperty("encryptedLeakMatchPrefixes")) { + if (!Array.isArray(message.encryptedLeakMatchPrefixes)) + return "encryptedLeakMatchPrefixes: array expected"; + for (var i = 0; i < message.encryptedLeakMatchPrefixes.length; ++i) + if (!(message.encryptedLeakMatchPrefixes[i] && typeof message.encryptedLeakMatchPrefixes[i].length === "number" || $util.isString(message.encryptedLeakMatchPrefixes[i]))) + return "encryptedLeakMatchPrefixes: buffer[] expected"; } + if (message.reencryptedUserCredentialsHash != null && message.hasOwnProperty("reencryptedUserCredentialsHash")) + if (!(message.reencryptedUserCredentialsHash && typeof message.reencryptedUserCredentialsHash.length === "number" || $util.isString(message.reencryptedUserCredentialsHash))) + return "reencryptedUserCredentialsHash: buffer expected"; return null; }; /** - * Creates an Assessment message from a plain object. Also converts values to their respective internal types. + * Creates a PrivatePasswordLeakVerification message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.Assessment} Assessment + * @returns {google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification} PrivatePasswordLeakVerification */ - Assessment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.Assessment) + PrivatePasswordLeakVerification.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.Assessment(); - if (object.name != null) - message.name = String(object.name); - if (object.event != null) { - if (typeof object.event !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.event: object expected"); - message.event = $root.google.cloud.recaptchaenterprise.v1.Event.fromObject(object.event); - } - if (object.riskAnalysis != null) { - if (typeof object.riskAnalysis !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.riskAnalysis: object expected"); - message.riskAnalysis = $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.fromObject(object.riskAnalysis); - } - if (object.tokenProperties != null) { - if (typeof object.tokenProperties !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.tokenProperties: object expected"); - message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.fromObject(object.tokenProperties); - } - if (object.accountDefenderAssessment != null) { - if (typeof object.accountDefenderAssessment !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.accountDefenderAssessment: object expected"); - message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.fromObject(object.accountDefenderAssessment); - } - if (object.privatePasswordLeakVerification != null) { - if (typeof object.privatePasswordLeakVerification !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.privatePasswordLeakVerification: object expected"); - message.privatePasswordLeakVerification = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.fromObject(object.privatePasswordLeakVerification); + var message = new $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification(); + if (object.lookupHashPrefix != null) + if (typeof object.lookupHashPrefix === "string") + $util.base64.decode(object.lookupHashPrefix, message.lookupHashPrefix = $util.newBuffer($util.base64.length(object.lookupHashPrefix)), 0); + else if (object.lookupHashPrefix.length >= 0) + message.lookupHashPrefix = object.lookupHashPrefix; + if (object.encryptedUserCredentialsHash != null) + if (typeof object.encryptedUserCredentialsHash === "string") + $util.base64.decode(object.encryptedUserCredentialsHash, message.encryptedUserCredentialsHash = $util.newBuffer($util.base64.length(object.encryptedUserCredentialsHash)), 0); + else if (object.encryptedUserCredentialsHash.length >= 0) + message.encryptedUserCredentialsHash = object.encryptedUserCredentialsHash; + if (object.encryptedLeakMatchPrefixes) { + if (!Array.isArray(object.encryptedLeakMatchPrefixes)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.encryptedLeakMatchPrefixes: array expected"); + message.encryptedLeakMatchPrefixes = []; + for (var i = 0; i < object.encryptedLeakMatchPrefixes.length; ++i) + if (typeof object.encryptedLeakMatchPrefixes[i] === "string") + $util.base64.decode(object.encryptedLeakMatchPrefixes[i], message.encryptedLeakMatchPrefixes[i] = $util.newBuffer($util.base64.length(object.encryptedLeakMatchPrefixes[i])), 0); + else if (object.encryptedLeakMatchPrefixes[i].length >= 0) + message.encryptedLeakMatchPrefixes[i] = object.encryptedLeakMatchPrefixes[i]; } + if (object.reencryptedUserCredentialsHash != null) + if (typeof object.reencryptedUserCredentialsHash === "string") + $util.base64.decode(object.reencryptedUserCredentialsHash, message.reencryptedUserCredentialsHash = $util.newBuffer($util.base64.length(object.reencryptedUserCredentialsHash)), 0); + else if (object.reencryptedUserCredentialsHash.length >= 0) + message.reencryptedUserCredentialsHash = object.reencryptedUserCredentialsHash; return message; }; /** - * Creates a plain object from an Assessment message. Also converts values to other types if specified. + * Creates a plain object from a PrivatePasswordLeakVerification message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification * @static - * @param {google.cloud.recaptchaenterprise.v1.Assessment} message Assessment + * @param {google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification} message PrivatePasswordLeakVerification * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Assessment.toObject = function toObject(message, options) { + PrivatePasswordLeakVerification.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.encryptedLeakMatchPrefixes = []; if (options.defaults) { - object.name = ""; - object.event = null; - object.riskAnalysis = null; - object.tokenProperties = null; - object.accountDefenderAssessment = null; - object.privatePasswordLeakVerification = null; + if (options.bytes === String) + object.lookupHashPrefix = ""; + else { + object.lookupHashPrefix = []; + if (options.bytes !== Array) + object.lookupHashPrefix = $util.newBuffer(object.lookupHashPrefix); + } + if (options.bytes === String) + object.encryptedUserCredentialsHash = ""; + else { + object.encryptedUserCredentialsHash = []; + if (options.bytes !== Array) + object.encryptedUserCredentialsHash = $util.newBuffer(object.encryptedUserCredentialsHash); + } + if (options.bytes === String) + object.reencryptedUserCredentialsHash = ""; + else { + object.reencryptedUserCredentialsHash = []; + if (options.bytes !== Array) + object.reencryptedUserCredentialsHash = $util.newBuffer(object.reencryptedUserCredentialsHash); + } } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.event != null && message.hasOwnProperty("event")) - object.event = $root.google.cloud.recaptchaenterprise.v1.Event.toObject(message.event, options); - if (message.riskAnalysis != null && message.hasOwnProperty("riskAnalysis")) - object.riskAnalysis = $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.toObject(message.riskAnalysis, options); - if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) - object.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.toObject(message.tokenProperties, options); - if (message.accountDefenderAssessment != null && message.hasOwnProperty("accountDefenderAssessment")) - object.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.toObject(message.accountDefenderAssessment, options); - if (message.privatePasswordLeakVerification != null && message.hasOwnProperty("privatePasswordLeakVerification")) - object.privatePasswordLeakVerification = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.toObject(message.privatePasswordLeakVerification, options); + if (message.lookupHashPrefix != null && message.hasOwnProperty("lookupHashPrefix")) + object.lookupHashPrefix = options.bytes === String ? $util.base64.encode(message.lookupHashPrefix, 0, message.lookupHashPrefix.length) : options.bytes === Array ? Array.prototype.slice.call(message.lookupHashPrefix) : message.lookupHashPrefix; + if (message.encryptedUserCredentialsHash != null && message.hasOwnProperty("encryptedUserCredentialsHash")) + object.encryptedUserCredentialsHash = options.bytes === String ? $util.base64.encode(message.encryptedUserCredentialsHash, 0, message.encryptedUserCredentialsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedUserCredentialsHash) : message.encryptedUserCredentialsHash; + if (message.encryptedLeakMatchPrefixes && message.encryptedLeakMatchPrefixes.length) { + object.encryptedLeakMatchPrefixes = []; + for (var j = 0; j < message.encryptedLeakMatchPrefixes.length; ++j) + object.encryptedLeakMatchPrefixes[j] = options.bytes === String ? $util.base64.encode(message.encryptedLeakMatchPrefixes[j], 0, message.encryptedLeakMatchPrefixes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedLeakMatchPrefixes[j]) : message.encryptedLeakMatchPrefixes[j]; + } + if (message.reencryptedUserCredentialsHash != null && message.hasOwnProperty("reencryptedUserCredentialsHash")) + object.reencryptedUserCredentialsHash = options.bytes === String ? $util.base64.encode(message.reencryptedUserCredentialsHash, 0, message.reencryptedUserCredentialsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.reencryptedUserCredentialsHash) : message.reencryptedUserCredentialsHash; return object; }; /** - * Converts this Assessment to JSON. + * Converts this PrivatePasswordLeakVerification to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification * @instance * @returns {Object.} JSON object */ - Assessment.prototype.toJSON = function toJSON() { + PrivatePasswordLeakVerification.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Assessment + * Gets the default type url for PrivatePasswordLeakVerification * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Assessment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PrivatePasswordLeakVerification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.Assessment"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification"; }; - return Assessment; + return PrivatePasswordLeakVerification; })(); - v1.Event = (function() { + v1.Assessment = (function() { /** - * Properties of an Event. + * Properties of an Assessment. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IEvent - * @property {string|null} [token] Event token - * @property {string|null} [siteKey] Event siteKey - * @property {string|null} [userAgent] Event userAgent - * @property {string|null} [userIpAddress] Event userIpAddress - * @property {string|null} [expectedAction] Event expectedAction - * @property {Uint8Array|null} [hashedAccountId] Event hashedAccountId + * @interface IAssessment + * @property {string|null} [name] Assessment name + * @property {google.cloud.recaptchaenterprise.v1.IEvent|null} [event] Assessment event + * @property {google.cloud.recaptchaenterprise.v1.IRiskAnalysis|null} [riskAnalysis] Assessment riskAnalysis + * @property {google.cloud.recaptchaenterprise.v1.ITokenProperties|null} [tokenProperties] Assessment tokenProperties + * @property {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment|null} [accountDefenderAssessment] Assessment accountDefenderAssessment + * @property {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification|null} [privatePasswordLeakVerification] Assessment privatePasswordLeakVerification */ /** - * Constructs a new Event. + * Constructs a new Assessment. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents an Event. - * @implements IEvent + * @classdesc Represents an Assessment. + * @implements IAssessment * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IEvent=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IAssessment=} [properties] Properties to set */ - function Event(properties) { + function Assessment(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1718,145 +1762,145 @@ } /** - * Event token. - * @member {string} token - * @memberof google.cloud.recaptchaenterprise.v1.Event + * Assessment name. + * @member {string} name + * @memberof google.cloud.recaptchaenterprise.v1.Assessment * @instance */ - Event.prototype.token = ""; + Assessment.prototype.name = ""; /** - * Event siteKey. - * @member {string} siteKey - * @memberof google.cloud.recaptchaenterprise.v1.Event + * Assessment event. + * @member {google.cloud.recaptchaenterprise.v1.IEvent|null|undefined} event + * @memberof google.cloud.recaptchaenterprise.v1.Assessment * @instance */ - Event.prototype.siteKey = ""; + Assessment.prototype.event = null; /** - * Event userAgent. - * @member {string} userAgent - * @memberof google.cloud.recaptchaenterprise.v1.Event + * Assessment riskAnalysis. + * @member {google.cloud.recaptchaenterprise.v1.IRiskAnalysis|null|undefined} riskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.Assessment * @instance */ - Event.prototype.userAgent = ""; + Assessment.prototype.riskAnalysis = null; /** - * Event userIpAddress. - * @member {string} userIpAddress - * @memberof google.cloud.recaptchaenterprise.v1.Event + * Assessment tokenProperties. + * @member {google.cloud.recaptchaenterprise.v1.ITokenProperties|null|undefined} tokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.Assessment * @instance */ - Event.prototype.userIpAddress = ""; + Assessment.prototype.tokenProperties = null; /** - * Event expectedAction. - * @member {string} expectedAction - * @memberof google.cloud.recaptchaenterprise.v1.Event + * Assessment accountDefenderAssessment. + * @member {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment|null|undefined} accountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.Assessment * @instance */ - Event.prototype.expectedAction = ""; + Assessment.prototype.accountDefenderAssessment = null; /** - * Event hashedAccountId. - * @member {Uint8Array} hashedAccountId - * @memberof google.cloud.recaptchaenterprise.v1.Event + * Assessment privatePasswordLeakVerification. + * @member {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification|null|undefined} privatePasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1.Assessment * @instance */ - Event.prototype.hashedAccountId = $util.newBuffer([]); + Assessment.prototype.privatePasswordLeakVerification = null; /** - * Creates a new Event instance using the specified properties. + * Creates a new Assessment instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.Event + * @memberof google.cloud.recaptchaenterprise.v1.Assessment * @static - * @param {google.cloud.recaptchaenterprise.v1.IEvent=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.Event} Event instance + * @param {google.cloud.recaptchaenterprise.v1.IAssessment=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.Assessment} Assessment instance */ - Event.create = function create(properties) { - return new Event(properties); + Assessment.create = function create(properties) { + return new Assessment(properties); }; /** - * Encodes the specified Event message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Event.verify|verify} messages. + * Encodes the specified Assessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Assessment.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.Event + * @memberof google.cloud.recaptchaenterprise.v1.Assessment * @static - * @param {google.cloud.recaptchaenterprise.v1.IEvent} message Event message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IAssessment} message Assessment message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Event.encode = function encode(message, writer) { + Assessment.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.token != null && Object.hasOwnProperty.call(message, "token")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); - if (message.siteKey != null && Object.hasOwnProperty.call(message, "siteKey")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.siteKey); - if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.userAgent); - if (message.userIpAddress != null && Object.hasOwnProperty.call(message, "userIpAddress")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.userIpAddress); - if (message.expectedAction != null && Object.hasOwnProperty.call(message, "expectedAction")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.expectedAction); - if (message.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.hashedAccountId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.google.cloud.recaptchaenterprise.v1.Event.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.riskAnalysis != null && Object.hasOwnProperty.call(message, "riskAnalysis")) + $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.encode(message.riskAnalysis, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.tokenProperties != null && Object.hasOwnProperty.call(message, "tokenProperties")) + $root.google.cloud.recaptchaenterprise.v1.TokenProperties.encode(message.tokenProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.accountDefenderAssessment != null && Object.hasOwnProperty.call(message, "accountDefenderAssessment")) + $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.encode(message.accountDefenderAssessment, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.privatePasswordLeakVerification != null && Object.hasOwnProperty.call(message, "privatePasswordLeakVerification")) + $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.encode(message.privatePasswordLeakVerification, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Event.verify|verify} messages. + * Encodes the specified Assessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Assessment.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.Event + * @memberof google.cloud.recaptchaenterprise.v1.Assessment * @static - * @param {google.cloud.recaptchaenterprise.v1.IEvent} message Event message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IAssessment} message Assessment message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Event.encodeDelimited = function encodeDelimited(message, writer) { + Assessment.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Event message from the specified reader or buffer. + * Decodes an Assessment message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.Event + * @memberof google.cloud.recaptchaenterprise.v1.Assessment * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1.Event} Event + * @returns {google.cloud.recaptchaenterprise.v1.Assessment} Assessment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Event.decode = function decode(reader, length) { + Assessment.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.Event(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.Assessment(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.token = reader.string(); + message.name = reader.string(); break; } case 2: { - message.siteKey = reader.string(); + message.event = $root.google.cloud.recaptchaenterprise.v1.Event.decode(reader, reader.uint32()); break; } case 3: { - message.userAgent = reader.string(); + message.riskAnalysis = $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.decode(reader, reader.uint32()); break; } case 4: { - message.userIpAddress = reader.string(); + message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.decode(reader, reader.uint32()); break; } - case 5: { - message.expectedAction = reader.string(); + case 6: { + message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.decode(reader, reader.uint32()); break; } - case 6: { - message.hashedAccountId = reader.bytes(); + case 8: { + message.privatePasswordLeakVerification = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.decode(reader, reader.uint32()); break; } default: @@ -1868,174 +1912,193 @@ }; /** - * Decodes an Event message from the specified reader or buffer, length delimited. + * Decodes an Assessment message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.Event + * @memberof google.cloud.recaptchaenterprise.v1.Assessment * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.Event} Event + * @returns {google.cloud.recaptchaenterprise.v1.Assessment} Assessment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Event.decodeDelimited = function decodeDelimited(reader) { + Assessment.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Event message. + * Verifies an Assessment message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.Event + * @memberof google.cloud.recaptchaenterprise.v1.Assessment * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Event.verify = function verify(message) { + Assessment.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.token != null && message.hasOwnProperty("token")) - if (!$util.isString(message.token)) - return "token: string expected"; - if (message.siteKey != null && message.hasOwnProperty("siteKey")) - if (!$util.isString(message.siteKey)) - return "siteKey: string expected"; - if (message.userAgent != null && message.hasOwnProperty("userAgent")) - if (!$util.isString(message.userAgent)) - return "userAgent: string expected"; - if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) - if (!$util.isString(message.userIpAddress)) - return "userIpAddress: string expected"; - if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) - if (!$util.isString(message.expectedAction)) - return "expectedAction: string expected"; - if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) - if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) - return "hashedAccountId: buffer expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.event != null && message.hasOwnProperty("event")) { + var error = $root.google.cloud.recaptchaenterprise.v1.Event.verify(message.event); + if (error) + return "event." + error; + } + if (message.riskAnalysis != null && message.hasOwnProperty("riskAnalysis")) { + var error = $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.verify(message.riskAnalysis); + if (error) + return "riskAnalysis." + error; + } + if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) { + var error = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.verify(message.tokenProperties); + if (error) + return "tokenProperties." + error; + } + if (message.accountDefenderAssessment != null && message.hasOwnProperty("accountDefenderAssessment")) { + var error = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify(message.accountDefenderAssessment); + if (error) + return "accountDefenderAssessment." + error; + } + if (message.privatePasswordLeakVerification != null && message.hasOwnProperty("privatePasswordLeakVerification")) { + var error = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.verify(message.privatePasswordLeakVerification); + if (error) + return "privatePasswordLeakVerification." + error; + } return null; }; /** - * Creates an Event message from a plain object. Also converts values to their respective internal types. + * Creates an Assessment message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.Event + * @memberof google.cloud.recaptchaenterprise.v1.Assessment * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.Event} Event + * @returns {google.cloud.recaptchaenterprise.v1.Assessment} Assessment */ - Event.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.Event) + Assessment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.Assessment) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.Event(); - if (object.token != null) - message.token = String(object.token); - if (object.siteKey != null) - message.siteKey = String(object.siteKey); - if (object.userAgent != null) - message.userAgent = String(object.userAgent); - if (object.userIpAddress != null) - message.userIpAddress = String(object.userIpAddress); - if (object.expectedAction != null) - message.expectedAction = String(object.expectedAction); - if (object.hashedAccountId != null) - if (typeof object.hashedAccountId === "string") - $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); - else if (object.hashedAccountId.length >= 0) - message.hashedAccountId = object.hashedAccountId; + var message = new $root.google.cloud.recaptchaenterprise.v1.Assessment(); + if (object.name != null) + message.name = String(object.name); + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.event: object expected"); + message.event = $root.google.cloud.recaptchaenterprise.v1.Event.fromObject(object.event); + } + if (object.riskAnalysis != null) { + if (typeof object.riskAnalysis !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.riskAnalysis: object expected"); + message.riskAnalysis = $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.fromObject(object.riskAnalysis); + } + if (object.tokenProperties != null) { + if (typeof object.tokenProperties !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.tokenProperties: object expected"); + message.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.fromObject(object.tokenProperties); + } + if (object.accountDefenderAssessment != null) { + if (typeof object.accountDefenderAssessment !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.accountDefenderAssessment: object expected"); + message.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.fromObject(object.accountDefenderAssessment); + } + if (object.privatePasswordLeakVerification != null) { + if (typeof object.privatePasswordLeakVerification !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.privatePasswordLeakVerification: object expected"); + message.privatePasswordLeakVerification = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.fromObject(object.privatePasswordLeakVerification); + } return message; }; /** - * Creates a plain object from an Event message. Also converts values to other types if specified. + * Creates a plain object from an Assessment message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.Event + * @memberof google.cloud.recaptchaenterprise.v1.Assessment * @static - * @param {google.cloud.recaptchaenterprise.v1.Event} message Event + * @param {google.cloud.recaptchaenterprise.v1.Assessment} message Assessment * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Event.toObject = function toObject(message, options) { + Assessment.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.token = ""; - object.siteKey = ""; - object.userAgent = ""; - object.userIpAddress = ""; - object.expectedAction = ""; - if (options.bytes === String) - object.hashedAccountId = ""; - else { - object.hashedAccountId = []; - if (options.bytes !== Array) - object.hashedAccountId = $util.newBuffer(object.hashedAccountId); - } + object.name = ""; + object.event = null; + object.riskAnalysis = null; + object.tokenProperties = null; + object.accountDefenderAssessment = null; + object.privatePasswordLeakVerification = null; } - if (message.token != null && message.hasOwnProperty("token")) - object.token = message.token; - if (message.siteKey != null && message.hasOwnProperty("siteKey")) - object.siteKey = message.siteKey; - if (message.userAgent != null && message.hasOwnProperty("userAgent")) - object.userAgent = message.userAgent; - if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) - object.userIpAddress = message.userIpAddress; - if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) - object.expectedAction = message.expectedAction; - if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) - object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.event != null && message.hasOwnProperty("event")) + object.event = $root.google.cloud.recaptchaenterprise.v1.Event.toObject(message.event, options); + if (message.riskAnalysis != null && message.hasOwnProperty("riskAnalysis")) + object.riskAnalysis = $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.toObject(message.riskAnalysis, options); + if (message.tokenProperties != null && message.hasOwnProperty("tokenProperties")) + object.tokenProperties = $root.google.cloud.recaptchaenterprise.v1.TokenProperties.toObject(message.tokenProperties, options); + if (message.accountDefenderAssessment != null && message.hasOwnProperty("accountDefenderAssessment")) + object.accountDefenderAssessment = $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.toObject(message.accountDefenderAssessment, options); + if (message.privatePasswordLeakVerification != null && message.hasOwnProperty("privatePasswordLeakVerification")) + object.privatePasswordLeakVerification = $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.toObject(message.privatePasswordLeakVerification, options); return object; }; /** - * Converts this Event to JSON. + * Converts this Assessment to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.Event + * @memberof google.cloud.recaptchaenterprise.v1.Assessment * @instance * @returns {Object.} JSON object */ - Event.prototype.toJSON = function toJSON() { + Assessment.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Event + * Gets the default type url for Assessment * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.Event + * @memberof google.cloud.recaptchaenterprise.v1.Assessment * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Assessment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.Event"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.Assessment"; }; - return Event; + return Assessment; })(); - v1.RiskAnalysis = (function() { + v1.Event = (function() { /** - * Properties of a RiskAnalysis. + * Properties of an Event. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IRiskAnalysis - * @property {number|null} [score] RiskAnalysis score - * @property {Array.|null} [reasons] RiskAnalysis reasons + * @interface IEvent + * @property {string|null} [token] Event token + * @property {string|null} [siteKey] Event siteKey + * @property {string|null} [userAgent] Event userAgent + * @property {string|null} [userIpAddress] Event userIpAddress + * @property {string|null} [expectedAction] Event expectedAction + * @property {Uint8Array|null} [hashedAccountId] Event hashedAccountId */ /** - * Constructs a new RiskAnalysis. + * Constructs a new Event. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a RiskAnalysis. - * @implements IRiskAnalysis + * @classdesc Represents an Event. + * @implements IEvent * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IEvent=} [properties] Properties to set */ - function RiskAnalysis(properties) { - this.reasons = []; + function Event(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2043,100 +2106,145 @@ } /** - * RiskAnalysis score. - * @member {number} score - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * Event token. + * @member {string} token + * @memberof google.cloud.recaptchaenterprise.v1.Event * @instance */ - RiskAnalysis.prototype.score = 0; + Event.prototype.token = ""; /** - * RiskAnalysis reasons. - * @member {Array.} reasons - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * Event siteKey. + * @member {string} siteKey + * @memberof google.cloud.recaptchaenterprise.v1.Event * @instance */ - RiskAnalysis.prototype.reasons = $util.emptyArray; + Event.prototype.siteKey = ""; /** - * Creates a new RiskAnalysis instance using the specified properties. - * @function create - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis - * @static - * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis instance + * Event userAgent. + * @member {string} userAgent + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @instance */ - RiskAnalysis.create = function create(properties) { - return new RiskAnalysis(properties); - }; + Event.prototype.userAgent = ""; /** - * Encodes the specified RiskAnalysis message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RiskAnalysis.verify|verify} messages. - * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis - * @static - * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis} message RiskAnalysis message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RiskAnalysis.encode = function encode(message, writer) { + * Event userIpAddress. + * @member {string} userIpAddress + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @instance + */ + Event.prototype.userIpAddress = ""; + + /** + * Event expectedAction. + * @member {string} expectedAction + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @instance + */ + Event.prototype.expectedAction = ""; + + /** + * Event hashedAccountId. + * @member {Uint8Array} hashedAccountId + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @instance + */ + Event.prototype.hashedAccountId = $util.newBuffer([]); + + /** + * Creates a new Event instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @static + * @param {google.cloud.recaptchaenterprise.v1.IEvent=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.Event} Event instance + */ + Event.create = function create(properties) { + return new Event(properties); + }; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Event.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.Event + * @static + * @param {google.cloud.recaptchaenterprise.v1.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); - if (message.reasons != null && message.reasons.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.reasons.length; ++i) - writer.int32(message.reasons[i]); - writer.ldelim(); - } + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); + if (message.siteKey != null && Object.hasOwnProperty.call(message, "siteKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.siteKey); + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userAgent); + if (message.userIpAddress != null && Object.hasOwnProperty.call(message, "userIpAddress")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.userIpAddress); + if (message.expectedAction != null && Object.hasOwnProperty.call(message, "expectedAction")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.expectedAction); + if (message.hashedAccountId != null && Object.hasOwnProperty.call(message, "hashedAccountId")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.hashedAccountId); return writer; }; /** - * Encodes the specified RiskAnalysis message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RiskAnalysis.verify|verify} messages. + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.Event.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.Event * @static - * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis} message RiskAnalysis message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IEvent} message Event message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RiskAnalysis.encodeDelimited = function encodeDelimited(message, writer) { + Event.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RiskAnalysis message from the specified reader or buffer. + * Decodes an Event message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.Event * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis + * @returns {google.cloud.recaptchaenterprise.v1.Event} Event * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RiskAnalysis.decode = function decode(reader, length) { + Event.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.Event(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.score = reader.float(); + message.token = reader.string(); break; } case 2: { - if (!(message.reasons && message.reasons.length)) - message.reasons = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.reasons.push(reader.int32()); - } else - message.reasons.push(reader.int32()); + message.siteKey = reader.string(); + break; + } + case 3: { + message.userAgent = reader.string(); + break; + } + case 4: { + message.userIpAddress = reader.string(); + break; + } + case 5: { + message.expectedAction = reader.string(); + break; + } + case 6: { + message.hashedAccountId = reader.bytes(); break; } default: @@ -2148,204 +2256,174 @@ }; /** - * Decodes a RiskAnalysis message from the specified reader or buffer, length delimited. + * Decodes an Event message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.Event * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis + * @returns {google.cloud.recaptchaenterprise.v1.Event} Event * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RiskAnalysis.decodeDelimited = function decodeDelimited(reader) { + Event.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RiskAnalysis message. + * Verifies an Event message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.Event * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RiskAnalysis.verify = function verify(message) { + Event.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.score != null && message.hasOwnProperty("score")) - if (typeof message.score !== "number") - return "score: number expected"; - if (message.reasons != null && message.hasOwnProperty("reasons")) { - if (!Array.isArray(message.reasons)) - return "reasons: array expected"; - for (var i = 0; i < message.reasons.length; ++i) - switch (message.reasons[i]) { - default: - return "reasons: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - } + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + if (message.siteKey != null && message.hasOwnProperty("siteKey")) + if (!$util.isString(message.siteKey)) + return "siteKey: string expected"; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + if (!$util.isString(message.userAgent)) + return "userAgent: string expected"; + if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) + if (!$util.isString(message.userIpAddress)) + return "userIpAddress: string expected"; + if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) + if (!$util.isString(message.expectedAction)) + return "expectedAction: string expected"; + if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + if (!(message.hashedAccountId && typeof message.hashedAccountId.length === "number" || $util.isString(message.hashedAccountId))) + return "hashedAccountId: buffer expected"; return null; }; /** - * Creates a RiskAnalysis message from a plain object. Also converts values to their respective internal types. + * Creates an Event message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.Event * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis + * @returns {google.cloud.recaptchaenterprise.v1.Event} Event */ - RiskAnalysis.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis) + Event.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.Event) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis(); - if (object.score != null) - message.score = Number(object.score); - if (object.reasons) { - if (!Array.isArray(object.reasons)) - throw TypeError(".google.cloud.recaptchaenterprise.v1.RiskAnalysis.reasons: array expected"); - message.reasons = []; - for (var i = 0; i < object.reasons.length; ++i) - switch (object.reasons[i]) { - default: - case "CLASSIFICATION_REASON_UNSPECIFIED": - case 0: - message.reasons[i] = 0; - break; - case "AUTOMATION": - case 1: - message.reasons[i] = 1; - break; - case "UNEXPECTED_ENVIRONMENT": - case 2: - message.reasons[i] = 2; - break; - case "TOO_MUCH_TRAFFIC": - case 3: - message.reasons[i] = 3; - break; - case "UNEXPECTED_USAGE_PATTERNS": - case 4: - message.reasons[i] = 4; - break; - case "LOW_CONFIDENCE_SCORE": - case 5: - message.reasons[i] = 5; - break; - } - } + var message = new $root.google.cloud.recaptchaenterprise.v1.Event(); + if (object.token != null) + message.token = String(object.token); + if (object.siteKey != null) + message.siteKey = String(object.siteKey); + if (object.userAgent != null) + message.userAgent = String(object.userAgent); + if (object.userIpAddress != null) + message.userIpAddress = String(object.userIpAddress); + if (object.expectedAction != null) + message.expectedAction = String(object.expectedAction); + if (object.hashedAccountId != null) + if (typeof object.hashedAccountId === "string") + $util.base64.decode(object.hashedAccountId, message.hashedAccountId = $util.newBuffer($util.base64.length(object.hashedAccountId)), 0); + else if (object.hashedAccountId.length >= 0) + message.hashedAccountId = object.hashedAccountId; return message; }; /** - * Creates a plain object from a RiskAnalysis message. Also converts values to other types if specified. + * Creates a plain object from an Event message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.Event * @static - * @param {google.cloud.recaptchaenterprise.v1.RiskAnalysis} message RiskAnalysis + * @param {google.cloud.recaptchaenterprise.v1.Event} message Event * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RiskAnalysis.toObject = function toObject(message, options) { + Event.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.reasons = []; - if (options.defaults) - object.score = 0; - if (message.score != null && message.hasOwnProperty("score")) - object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; - if (message.reasons && message.reasons.length) { - object.reasons = []; - for (var j = 0; j < message.reasons.length; ++j) - object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason[message.reasons[j]] : message.reasons[j]; + if (options.defaults) { + object.token = ""; + object.siteKey = ""; + object.userAgent = ""; + object.userIpAddress = ""; + object.expectedAction = ""; + if (options.bytes === String) + object.hashedAccountId = ""; + else { + object.hashedAccountId = []; + if (options.bytes !== Array) + object.hashedAccountId = $util.newBuffer(object.hashedAccountId); + } } - return object; - }; + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + if (message.siteKey != null && message.hasOwnProperty("siteKey")) + object.siteKey = message.siteKey; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + object.userAgent = message.userAgent; + if (message.userIpAddress != null && message.hasOwnProperty("userIpAddress")) + object.userIpAddress = message.userIpAddress; + if (message.expectedAction != null && message.hasOwnProperty("expectedAction")) + object.expectedAction = message.expectedAction; + if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) + object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; + return object; + }; /** - * Converts this RiskAnalysis to JSON. + * Converts this Event to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.Event * @instance * @returns {Object.} JSON object */ - RiskAnalysis.prototype.toJSON = function toJSON() { + Event.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RiskAnalysis + * Gets the default type url for Event * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis + * @memberof google.cloud.recaptchaenterprise.v1.Event * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RiskAnalysis.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.RiskAnalysis"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.Event"; }; - /** - * ClassificationReason enum. - * @name google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason - * @enum {number} - * @property {number} CLASSIFICATION_REASON_UNSPECIFIED=0 CLASSIFICATION_REASON_UNSPECIFIED value - * @property {number} AUTOMATION=1 AUTOMATION value - * @property {number} UNEXPECTED_ENVIRONMENT=2 UNEXPECTED_ENVIRONMENT value - * @property {number} TOO_MUCH_TRAFFIC=3 TOO_MUCH_TRAFFIC value - * @property {number} UNEXPECTED_USAGE_PATTERNS=4 UNEXPECTED_USAGE_PATTERNS value - * @property {number} LOW_CONFIDENCE_SCORE=5 LOW_CONFIDENCE_SCORE value - */ - RiskAnalysis.ClassificationReason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLASSIFICATION_REASON_UNSPECIFIED"] = 0; - values[valuesById[1] = "AUTOMATION"] = 1; - values[valuesById[2] = "UNEXPECTED_ENVIRONMENT"] = 2; - values[valuesById[3] = "TOO_MUCH_TRAFFIC"] = 3; - values[valuesById[4] = "UNEXPECTED_USAGE_PATTERNS"] = 4; - values[valuesById[5] = "LOW_CONFIDENCE_SCORE"] = 5; - return values; - })(); - - return RiskAnalysis; + return Event; })(); - v1.TokenProperties = (function() { + v1.RiskAnalysis = (function() { /** - * Properties of a TokenProperties. + * Properties of a RiskAnalysis. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface ITokenProperties - * @property {boolean|null} [valid] TokenProperties valid - * @property {google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason|null} [invalidReason] TokenProperties invalidReason - * @property {google.protobuf.ITimestamp|null} [createTime] TokenProperties createTime - * @property {string|null} [hostname] TokenProperties hostname - * @property {string|null} [action] TokenProperties action + * @interface IRiskAnalysis + * @property {number|null} [score] RiskAnalysis score + * @property {Array.|null} [reasons] RiskAnalysis reasons */ /** - * Constructs a new TokenProperties. + * Constructs a new RiskAnalysis. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a TokenProperties. - * @implements ITokenProperties + * @classdesc Represents a RiskAnalysis. + * @implements IRiskAnalysis * @constructor - * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis=} [properties] Properties to set */ - function TokenProperties(properties) { + function RiskAnalysis(properties) { + this.reasons = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2353,131 +2431,100 @@ } /** - * TokenProperties valid. - * @member {boolean} valid - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties - * @instance - */ - TokenProperties.prototype.valid = false; - - /** - * TokenProperties invalidReason. - * @member {google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason} invalidReason - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties - * @instance - */ - TokenProperties.prototype.invalidReason = 0; - - /** - * TokenProperties createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties - * @instance - */ - TokenProperties.prototype.createTime = null; - - /** - * TokenProperties hostname. - * @member {string} hostname - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * RiskAnalysis score. + * @member {number} score + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @instance */ - TokenProperties.prototype.hostname = ""; + RiskAnalysis.prototype.score = 0; /** - * TokenProperties action. - * @member {string} action - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * RiskAnalysis reasons. + * @member {Array.} reasons + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @instance */ - TokenProperties.prototype.action = ""; + RiskAnalysis.prototype.reasons = $util.emptyArray; /** - * Creates a new TokenProperties instance using the specified properties. + * Creates a new RiskAnalysis instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static - * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties instance + * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis instance */ - TokenProperties.create = function create(properties) { - return new TokenProperties(properties); + RiskAnalysis.create = function create(properties) { + return new RiskAnalysis(properties); }; /** - * Encodes the specified TokenProperties message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TokenProperties.verify|verify} messages. + * Encodes the specified RiskAnalysis message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RiskAnalysis.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static - * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties} message TokenProperties message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis} message RiskAnalysis message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TokenProperties.encode = function encode(message, writer) { + RiskAnalysis.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.valid != null && Object.hasOwnProperty.call(message, "valid")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid); - if (message.invalidReason != null && Object.hasOwnProperty.call(message, "invalidReason")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.invalidReason); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.hostname); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.action); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + if (message.reasons != null && message.reasons.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.reasons.length; ++i) + writer.int32(message.reasons[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified TokenProperties message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TokenProperties.verify|verify} messages. + * Encodes the specified RiskAnalysis message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RiskAnalysis.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static - * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties} message TokenProperties message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IRiskAnalysis} message RiskAnalysis message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TokenProperties.encodeDelimited = function encodeDelimited(message, writer) { + RiskAnalysis.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TokenProperties message from the specified reader or buffer. + * Decodes a RiskAnalysis message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties + * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TokenProperties.decode = function decode(reader, length) { + RiskAnalysis.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.TokenProperties(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.valid = reader.bool(); + message.score = reader.float(); break; } case 2: { - message.invalidReason = reader.int32(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.hostname = reader.string(); - break; - } - case 5: { - message.action = reader.string(); + if (!(message.reasons && message.reasons.length)) + message.reasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.reasons.push(reader.int32()); + } else + message.reasons.push(reader.int32()); break; } default: @@ -2489,223 +2536,204 @@ }; /** - * Decodes a TokenProperties message from the specified reader or buffer, length delimited. + * Decodes a RiskAnalysis message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties + * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TokenProperties.decodeDelimited = function decodeDelimited(reader) { + RiskAnalysis.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TokenProperties message. + * Verifies a RiskAnalysis message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TokenProperties.verify = function verify(message) { + RiskAnalysis.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.valid != null && message.hasOwnProperty("valid")) - if (typeof message.valid !== "boolean") - return "valid: boolean expected"; - if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) - switch (message.invalidReason) { - default: - return "invalidReason: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.reasons != null && message.hasOwnProperty("reasons")) { + if (!Array.isArray(message.reasons)) + return "reasons: array expected"; + for (var i = 0; i < message.reasons.length; ++i) + switch (message.reasons[i]) { + default: + return "reasons: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } } - if (message.hostname != null && message.hasOwnProperty("hostname")) - if (!$util.isString(message.hostname)) - return "hostname: string expected"; - if (message.action != null && message.hasOwnProperty("action")) - if (!$util.isString(message.action)) - return "action: string expected"; return null; }; /** - * Creates a TokenProperties message from a plain object. Also converts values to their respective internal types. + * Creates a RiskAnalysis message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties + * @returns {google.cloud.recaptchaenterprise.v1.RiskAnalysis} RiskAnalysis */ - TokenProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.TokenProperties) + RiskAnalysis.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.TokenProperties(); - if (object.valid != null) - message.valid = Boolean(object.valid); - switch (object.invalidReason) { - case "INVALID_REASON_UNSPECIFIED": - case 0: - message.invalidReason = 0; - break; - case "UNKNOWN_INVALID_REASON": - case 1: - message.invalidReason = 1; - break; - case "MALFORMED": - case 2: - message.invalidReason = 2; - break; - case "EXPIRED": - case 3: - message.invalidReason = 3; - break; - case "DUPE": - case 4: - message.invalidReason = 4; - break; - case "MISSING": - case 5: - message.invalidReason = 5; - break; - case "BROWSER_ERROR": - case 6: - message.invalidReason = 6; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.TokenProperties.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + var message = new $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis(); + if (object.score != null) + message.score = Number(object.score); + if (object.reasons) { + if (!Array.isArray(object.reasons)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.RiskAnalysis.reasons: array expected"); + message.reasons = []; + for (var i = 0; i < object.reasons.length; ++i) + switch (object.reasons[i]) { + default: + case "CLASSIFICATION_REASON_UNSPECIFIED": + case 0: + message.reasons[i] = 0; + break; + case "AUTOMATION": + case 1: + message.reasons[i] = 1; + break; + case "UNEXPECTED_ENVIRONMENT": + case 2: + message.reasons[i] = 2; + break; + case "TOO_MUCH_TRAFFIC": + case 3: + message.reasons[i] = 3; + break; + case "UNEXPECTED_USAGE_PATTERNS": + case 4: + message.reasons[i] = 4; + break; + case "LOW_CONFIDENCE_SCORE": + case 5: + message.reasons[i] = 5; + break; + } } - if (object.hostname != null) - message.hostname = String(object.hostname); - if (object.action != null) - message.action = String(object.action); return message; }; /** - * Creates a plain object from a TokenProperties message. Also converts values to other types if specified. + * Creates a plain object from a RiskAnalysis message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static - * @param {google.cloud.recaptchaenterprise.v1.TokenProperties} message TokenProperties + * @param {google.cloud.recaptchaenterprise.v1.RiskAnalysis} message RiskAnalysis * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TokenProperties.toObject = function toObject(message, options) { + RiskAnalysis.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.valid = false; - object.invalidReason = options.enums === String ? "INVALID_REASON_UNSPECIFIED" : 0; - object.createTime = null; - object.hostname = ""; - object.action = ""; + if (options.arrays || options.defaults) + object.reasons = []; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.reasons && message.reasons.length) { + object.reasons = []; + for (var j = 0; j < message.reasons.length; ++j) + object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason[message.reasons[j]] : message.reasons[j]; } - if (message.valid != null && message.hasOwnProperty("valid")) - object.valid = message.valid; - if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) - object.invalidReason = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason[message.invalidReason] : message.invalidReason; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.hostname != null && message.hasOwnProperty("hostname")) - object.hostname = message.hostname; - if (message.action != null && message.hasOwnProperty("action")) - object.action = message.action; return object; }; /** - * Converts this TokenProperties to JSON. + * Converts this RiskAnalysis to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @instance * @returns {Object.} JSON object */ - TokenProperties.prototype.toJSON = function toJSON() { + RiskAnalysis.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TokenProperties + * Gets the default type url for RiskAnalysis * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @memberof google.cloud.recaptchaenterprise.v1.RiskAnalysis * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TokenProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RiskAnalysis.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.TokenProperties"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.RiskAnalysis"; }; /** - * InvalidReason enum. - * @name google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason + * ClassificationReason enum. + * @name google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason * @enum {number} - * @property {number} INVALID_REASON_UNSPECIFIED=0 INVALID_REASON_UNSPECIFIED value - * @property {number} UNKNOWN_INVALID_REASON=1 UNKNOWN_INVALID_REASON value - * @property {number} MALFORMED=2 MALFORMED value - * @property {number} EXPIRED=3 EXPIRED value - * @property {number} DUPE=4 DUPE value - * @property {number} MISSING=5 MISSING value - * @property {number} BROWSER_ERROR=6 BROWSER_ERROR value + * @property {number} CLASSIFICATION_REASON_UNSPECIFIED=0 CLASSIFICATION_REASON_UNSPECIFIED value + * @property {number} AUTOMATION=1 AUTOMATION value + * @property {number} UNEXPECTED_ENVIRONMENT=2 UNEXPECTED_ENVIRONMENT value + * @property {number} TOO_MUCH_TRAFFIC=3 TOO_MUCH_TRAFFIC value + * @property {number} UNEXPECTED_USAGE_PATTERNS=4 UNEXPECTED_USAGE_PATTERNS value + * @property {number} LOW_CONFIDENCE_SCORE=5 LOW_CONFIDENCE_SCORE value */ - TokenProperties.InvalidReason = (function() { + RiskAnalysis.ClassificationReason = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INVALID_REASON_UNSPECIFIED"] = 0; - values[valuesById[1] = "UNKNOWN_INVALID_REASON"] = 1; - values[valuesById[2] = "MALFORMED"] = 2; - values[valuesById[3] = "EXPIRED"] = 3; - values[valuesById[4] = "DUPE"] = 4; - values[valuesById[5] = "MISSING"] = 5; - values[valuesById[6] = "BROWSER_ERROR"] = 6; + values[valuesById[0] = "CLASSIFICATION_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTOMATION"] = 1; + values[valuesById[2] = "UNEXPECTED_ENVIRONMENT"] = 2; + values[valuesById[3] = "TOO_MUCH_TRAFFIC"] = 3; + values[valuesById[4] = "UNEXPECTED_USAGE_PATTERNS"] = 4; + values[valuesById[5] = "LOW_CONFIDENCE_SCORE"] = 5; return values; })(); - return TokenProperties; + return RiskAnalysis; })(); - v1.AccountDefenderAssessment = (function() { + v1.TokenProperties = (function() { /** - * Properties of an AccountDefenderAssessment. + * Properties of a TokenProperties. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IAccountDefenderAssessment - * @property {Array.|null} [labels] AccountDefenderAssessment labels + * @interface ITokenProperties + * @property {boolean|null} [valid] TokenProperties valid + * @property {google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason|null} [invalidReason] TokenProperties invalidReason + * @property {google.protobuf.ITimestamp|null} [createTime] TokenProperties createTime + * @property {string|null} [hostname] TokenProperties hostname + * @property {string|null} [action] TokenProperties action */ /** - * Constructs a new AccountDefenderAssessment. + * Constructs a new TokenProperties. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents an AccountDefenderAssessment. - * @implements IAccountDefenderAssessment + * @classdesc Represents a TokenProperties. + * @implements ITokenProperties * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties=} [properties] Properties to set */ - function AccountDefenderAssessment(properties) { - this.labels = []; + function TokenProperties(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2713,86 +2741,131 @@ } /** - * AccountDefenderAssessment labels. - * @member {Array.} labels - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * TokenProperties valid. + * @member {boolean} valid + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @instance */ - AccountDefenderAssessment.prototype.labels = $util.emptyArray; + TokenProperties.prototype.valid = false; /** - * Creates a new AccountDefenderAssessment instance using the specified properties. + * TokenProperties invalidReason. + * @member {google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason} invalidReason + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @instance + */ + TokenProperties.prototype.invalidReason = 0; + + /** + * TokenProperties createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @instance + */ + TokenProperties.prototype.createTime = null; + + /** + * TokenProperties hostname. + * @member {string} hostname + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @instance + */ + TokenProperties.prototype.hostname = ""; + + /** + * TokenProperties action. + * @member {string} action + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties + * @instance + */ + TokenProperties.prototype.action = ""; + + /** + * Creates a new TokenProperties instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static - * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment instance + * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties instance */ - AccountDefenderAssessment.create = function create(properties) { - return new AccountDefenderAssessment(properties); + TokenProperties.create = function create(properties) { + return new TokenProperties(properties); }; /** - * Encodes the specified AccountDefenderAssessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify|verify} messages. + * Encodes the specified TokenProperties message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TokenProperties.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static - * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment} message AccountDefenderAssessment message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties} message TokenProperties message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AccountDefenderAssessment.encode = function encode(message, writer) { + TokenProperties.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.labels != null && message.labels.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.labels.length; ++i) - writer.int32(message.labels[i]); - writer.ldelim(); - } + if (message.valid != null && Object.hasOwnProperty.call(message, "valid")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid); + if (message.invalidReason != null && Object.hasOwnProperty.call(message, "invalidReason")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.invalidReason); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.hostname); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.action); return writer; }; /** - * Encodes the specified AccountDefenderAssessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify|verify} messages. + * Encodes the specified TokenProperties message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.TokenProperties.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static - * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment} message AccountDefenderAssessment message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.ITokenProperties} message TokenProperties message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AccountDefenderAssessment.encodeDelimited = function encodeDelimited(message, writer) { + TokenProperties.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AccountDefenderAssessment message from the specified reader or buffer. + * Decodes a TokenProperties message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment + * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AccountDefenderAssessment.decode = function decode(reader, length) { + TokenProperties.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.TokenProperties(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.labels && message.labels.length)) - message.labels = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.labels.push(reader.int32()); - } else - message.labels.push(reader.int32()); + message.valid = reader.bool(); + break; + } + case 2: { + message.invalidReason = reader.int32(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.hostname = reader.string(); + break; + } + case 5: { + message.action = reader.string(); break; } default: @@ -2804,188 +2877,223 @@ }; /** - * Decodes an AccountDefenderAssessment message from the specified reader or buffer, length delimited. + * Decodes a TokenProperties message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment + * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AccountDefenderAssessment.decodeDelimited = function decodeDelimited(reader) { + TokenProperties.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AccountDefenderAssessment message. + * Verifies a TokenProperties message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AccountDefenderAssessment.verify = function verify(message) { + TokenProperties.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!Array.isArray(message.labels)) - return "labels: array expected"; - for (var i = 0; i < message.labels.length; ++i) - switch (message.labels[i]) { - default: - return "labels: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } + if (message.valid != null && message.hasOwnProperty("valid")) + if (typeof message.valid !== "boolean") + return "valid: boolean expected"; + if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) + switch (message.invalidReason) { + default: + return "invalidReason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; } + if (message.hostname != null && message.hasOwnProperty("hostname")) + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; return null; }; /** - * Creates an AccountDefenderAssessment message from a plain object. Also converts values to their respective internal types. + * Creates a TokenProperties message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment + * @returns {google.cloud.recaptchaenterprise.v1.TokenProperties} TokenProperties */ - AccountDefenderAssessment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment) + TokenProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.TokenProperties) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment(); - if (object.labels) { - if (!Array.isArray(object.labels)) - throw TypeError(".google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.labels: array expected"); - message.labels = []; - for (var i = 0; i < object.labels.length; ++i) - switch (object.labels[i]) { - default: - case "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED": - case 0: - message.labels[i] = 0; - break; - case "PROFILE_MATCH": - case 1: - message.labels[i] = 1; - break; - case "SUSPICIOUS_LOGIN_ACTIVITY": - case 2: - message.labels[i] = 2; - break; - case "SUSPICIOUS_ACCOUNT_CREATION": - case 3: - message.labels[i] = 3; - break; - case "RELATED_ACCOUNTS_NUMBER_HIGH": - case 4: - message.labels[i] = 4; - break; - } + var message = new $root.google.cloud.recaptchaenterprise.v1.TokenProperties(); + if (object.valid != null) + message.valid = Boolean(object.valid); + switch (object.invalidReason) { + case "INVALID_REASON_UNSPECIFIED": + case 0: + message.invalidReason = 0; + break; + case "UNKNOWN_INVALID_REASON": + case 1: + message.invalidReason = 1; + break; + case "MALFORMED": + case 2: + message.invalidReason = 2; + break; + case "EXPIRED": + case 3: + message.invalidReason = 3; + break; + case "DUPE": + case 4: + message.invalidReason = 4; + break; + case "MISSING": + case 5: + message.invalidReason = 5; + break; + case "BROWSER_ERROR": + case 6: + message.invalidReason = 6; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.TokenProperties.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } + if (object.hostname != null) + message.hostname = String(object.hostname); + if (object.action != null) + message.action = String(object.action); return message; }; /** - * Creates a plain object from an AccountDefenderAssessment message. Also converts values to other types if specified. + * Creates a plain object from a TokenProperties message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static - * @param {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} message AccountDefenderAssessment + * @param {google.cloud.recaptchaenterprise.v1.TokenProperties} message TokenProperties * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AccountDefenderAssessment.toObject = function toObject(message, options) { + TokenProperties.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.labels = []; - if (message.labels && message.labels.length) { - object.labels = []; - for (var j = 0; j < message.labels.length; ++j) - object.labels[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel[message.labels[j]] : message.labels[j]; + if (options.defaults) { + object.valid = false; + object.invalidReason = options.enums === String ? "INVALID_REASON_UNSPECIFIED" : 0; + object.createTime = null; + object.hostname = ""; + object.action = ""; } + if (message.valid != null && message.hasOwnProperty("valid")) + object.valid = message.valid; + if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) + object.invalidReason = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason[message.invalidReason] : message.invalidReason; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.hostname != null && message.hasOwnProperty("hostname")) + object.hostname = message.hostname; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; return object; }; /** - * Converts this AccountDefenderAssessment to JSON. + * Converts this TokenProperties to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @instance * @returns {Object.} JSON object */ - AccountDefenderAssessment.prototype.toJSON = function toJSON() { + TokenProperties.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AccountDefenderAssessment + * Gets the default type url for TokenProperties * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment + * @memberof google.cloud.recaptchaenterprise.v1.TokenProperties * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AccountDefenderAssessment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + TokenProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.TokenProperties"; }; /** - * AccountDefenderLabel enum. - * @name google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel + * InvalidReason enum. + * @name google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason * @enum {number} - * @property {number} ACCOUNT_DEFENDER_LABEL_UNSPECIFIED=0 ACCOUNT_DEFENDER_LABEL_UNSPECIFIED value - * @property {number} PROFILE_MATCH=1 PROFILE_MATCH value - * @property {number} SUSPICIOUS_LOGIN_ACTIVITY=2 SUSPICIOUS_LOGIN_ACTIVITY value - * @property {number} SUSPICIOUS_ACCOUNT_CREATION=3 SUSPICIOUS_ACCOUNT_CREATION value - * @property {number} RELATED_ACCOUNTS_NUMBER_HIGH=4 RELATED_ACCOUNTS_NUMBER_HIGH value + * @property {number} INVALID_REASON_UNSPECIFIED=0 INVALID_REASON_UNSPECIFIED value + * @property {number} UNKNOWN_INVALID_REASON=1 UNKNOWN_INVALID_REASON value + * @property {number} MALFORMED=2 MALFORMED value + * @property {number} EXPIRED=3 EXPIRED value + * @property {number} DUPE=4 DUPE value + * @property {number} MISSING=5 MISSING value + * @property {number} BROWSER_ERROR=6 BROWSER_ERROR value */ - AccountDefenderAssessment.AccountDefenderLabel = (function() { + TokenProperties.InvalidReason = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "PROFILE_MATCH"] = 1; - values[valuesById[2] = "SUSPICIOUS_LOGIN_ACTIVITY"] = 2; - values[valuesById[3] = "SUSPICIOUS_ACCOUNT_CREATION"] = 3; - values[valuesById[4] = "RELATED_ACCOUNTS_NUMBER_HIGH"] = 4; + values[valuesById[0] = "INVALID_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNKNOWN_INVALID_REASON"] = 1; + values[valuesById[2] = "MALFORMED"] = 2; + values[valuesById[3] = "EXPIRED"] = 3; + values[valuesById[4] = "DUPE"] = 4; + values[valuesById[5] = "MISSING"] = 5; + values[valuesById[6] = "BROWSER_ERROR"] = 6; return values; })(); - return AccountDefenderAssessment; + return TokenProperties; })(); - v1.PrivatePasswordLeakVerification = (function() { + v1.AccountDefenderAssessment = (function() { /** - * Properties of a PrivatePasswordLeakVerification. + * Properties of an AccountDefenderAssessment. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IPrivatePasswordLeakVerification - * @property {Uint8Array|null} [lookupHashPrefix] PrivatePasswordLeakVerification lookupHashPrefix - * @property {Uint8Array|null} [encryptedUserCredentialsHash] PrivatePasswordLeakVerification encryptedUserCredentialsHash - * @property {Array.|null} [encryptedLeakMatchPrefixes] PrivatePasswordLeakVerification encryptedLeakMatchPrefixes - * @property {Uint8Array|null} [reencryptedUserCredentialsHash] PrivatePasswordLeakVerification reencryptedUserCredentialsHash + * @interface IAccountDefenderAssessment + * @property {Array.|null} [labels] AccountDefenderAssessment labels */ /** - * Constructs a new PrivatePasswordLeakVerification. + * Constructs a new AccountDefenderAssessment. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a PrivatePasswordLeakVerification. - * @implements IPrivatePasswordLeakVerification + * @classdesc Represents an AccountDefenderAssessment. + * @implements IAccountDefenderAssessment * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment=} [properties] Properties to set */ - function PrivatePasswordLeakVerification(properties) { - this.encryptedLeakMatchPrefixes = []; + function AccountDefenderAssessment(properties) { + this.labels = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2993,120 +3101,86 @@ } /** - * PrivatePasswordLeakVerification lookupHashPrefix. - * @member {Uint8Array} lookupHashPrefix - * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification - * @instance - */ - PrivatePasswordLeakVerification.prototype.lookupHashPrefix = $util.newBuffer([]); - - /** - * PrivatePasswordLeakVerification encryptedUserCredentialsHash. - * @member {Uint8Array} encryptedUserCredentialsHash - * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification - * @instance - */ - PrivatePasswordLeakVerification.prototype.encryptedUserCredentialsHash = $util.newBuffer([]); - - /** - * PrivatePasswordLeakVerification encryptedLeakMatchPrefixes. - * @member {Array.} encryptedLeakMatchPrefixes - * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification - * @instance - */ - PrivatePasswordLeakVerification.prototype.encryptedLeakMatchPrefixes = $util.emptyArray; - - /** - * PrivatePasswordLeakVerification reencryptedUserCredentialsHash. - * @member {Uint8Array} reencryptedUserCredentialsHash - * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * AccountDefenderAssessment labels. + * @member {Array.} labels + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @instance */ - PrivatePasswordLeakVerification.prototype.reencryptedUserCredentialsHash = $util.newBuffer([]); + AccountDefenderAssessment.prototype.labels = $util.emptyArray; /** - * Creates a new PrivatePasswordLeakVerification instance using the specified properties. + * Creates a new AccountDefenderAssessment instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static - * @param {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification} PrivatePasswordLeakVerification instance + * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment instance */ - PrivatePasswordLeakVerification.create = function create(properties) { - return new PrivatePasswordLeakVerification(properties); + AccountDefenderAssessment.create = function create(properties) { + return new AccountDefenderAssessment(properties); }; /** - * Encodes the specified PrivatePasswordLeakVerification message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.verify|verify} messages. + * Encodes the specified AccountDefenderAssessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static - * @param {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification} message PrivatePasswordLeakVerification message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment} message AccountDefenderAssessment message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrivatePasswordLeakVerification.encode = function encode(message, writer) { + AccountDefenderAssessment.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.lookupHashPrefix != null && Object.hasOwnProperty.call(message, "lookupHashPrefix")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.lookupHashPrefix); - if (message.encryptedUserCredentialsHash != null && Object.hasOwnProperty.call(message, "encryptedUserCredentialsHash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.encryptedUserCredentialsHash); - if (message.encryptedLeakMatchPrefixes != null && message.encryptedLeakMatchPrefixes.length) - for (var i = 0; i < message.encryptedLeakMatchPrefixes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.encryptedLeakMatchPrefixes[i]); - if (message.reencryptedUserCredentialsHash != null && Object.hasOwnProperty.call(message, "reencryptedUserCredentialsHash")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.reencryptedUserCredentialsHash); + if (message.labels != null && message.labels.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.labels.length; ++i) + writer.int32(message.labels[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified PrivatePasswordLeakVerification message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.verify|verify} messages. + * Encodes the specified AccountDefenderAssessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static - * @param {google.cloud.recaptchaenterprise.v1.IPrivatePasswordLeakVerification} message PrivatePasswordLeakVerification message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IAccountDefenderAssessment} message AccountDefenderAssessment message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrivatePasswordLeakVerification.encodeDelimited = function encodeDelimited(message, writer) { + AccountDefenderAssessment.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PrivatePasswordLeakVerification message from the specified reader or buffer. + * Decodes an AccountDefenderAssessment message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification} PrivatePasswordLeakVerification + * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrivatePasswordLeakVerification.decode = function decode(reader, length) { + AccountDefenderAssessment.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.lookupHashPrefix = reader.bytes(); - break; - } - case 2: { - message.encryptedUserCredentialsHash = reader.bytes(); - break; - } - case 3: { - if (!(message.encryptedLeakMatchPrefixes && message.encryptedLeakMatchPrefixes.length)) - message.encryptedLeakMatchPrefixes = []; - message.encryptedLeakMatchPrefixes.push(reader.bytes()); - break; - } - case 4: { - message.reencryptedUserCredentialsHash = reader.bytes(); + if (!(message.labels && message.labels.length)) + message.labels = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.labels.push(reader.int32()); + } else + message.labels.push(reader.int32()); break; } default: @@ -3118,170 +3192,164 @@ }; /** - * Decodes a PrivatePasswordLeakVerification message from the specified reader or buffer, length delimited. + * Decodes an AccountDefenderAssessment message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification} PrivatePasswordLeakVerification + * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrivatePasswordLeakVerification.decodeDelimited = function decodeDelimited(reader) { + AccountDefenderAssessment.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PrivatePasswordLeakVerification message. + * Verifies an AccountDefenderAssessment message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PrivatePasswordLeakVerification.verify = function verify(message) { + AccountDefenderAssessment.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.lookupHashPrefix != null && message.hasOwnProperty("lookupHashPrefix")) - if (!(message.lookupHashPrefix && typeof message.lookupHashPrefix.length === "number" || $util.isString(message.lookupHashPrefix))) - return "lookupHashPrefix: buffer expected"; - if (message.encryptedUserCredentialsHash != null && message.hasOwnProperty("encryptedUserCredentialsHash")) - if (!(message.encryptedUserCredentialsHash && typeof message.encryptedUserCredentialsHash.length === "number" || $util.isString(message.encryptedUserCredentialsHash))) - return "encryptedUserCredentialsHash: buffer expected"; - if (message.encryptedLeakMatchPrefixes != null && message.hasOwnProperty("encryptedLeakMatchPrefixes")) { - if (!Array.isArray(message.encryptedLeakMatchPrefixes)) - return "encryptedLeakMatchPrefixes: array expected"; - for (var i = 0; i < message.encryptedLeakMatchPrefixes.length; ++i) - if (!(message.encryptedLeakMatchPrefixes[i] && typeof message.encryptedLeakMatchPrefixes[i].length === "number" || $util.isString(message.encryptedLeakMatchPrefixes[i]))) - return "encryptedLeakMatchPrefixes: buffer[] expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) + switch (message.labels[i]) { + default: + return "labels: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } } - if (message.reencryptedUserCredentialsHash != null && message.hasOwnProperty("reencryptedUserCredentialsHash")) - if (!(message.reencryptedUserCredentialsHash && typeof message.reencryptedUserCredentialsHash.length === "number" || $util.isString(message.reencryptedUserCredentialsHash))) - return "reencryptedUserCredentialsHash: buffer expected"; return null; }; /** - * Creates a PrivatePasswordLeakVerification message from a plain object. Also converts values to their respective internal types. + * Creates an AccountDefenderAssessment message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification} PrivatePasswordLeakVerification + * @returns {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} AccountDefenderAssessment */ - PrivatePasswordLeakVerification.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification) + AccountDefenderAssessment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification(); - if (object.lookupHashPrefix != null) - if (typeof object.lookupHashPrefix === "string") - $util.base64.decode(object.lookupHashPrefix, message.lookupHashPrefix = $util.newBuffer($util.base64.length(object.lookupHashPrefix)), 0); - else if (object.lookupHashPrefix.length >= 0) - message.lookupHashPrefix = object.lookupHashPrefix; - if (object.encryptedUserCredentialsHash != null) - if (typeof object.encryptedUserCredentialsHash === "string") - $util.base64.decode(object.encryptedUserCredentialsHash, message.encryptedUserCredentialsHash = $util.newBuffer($util.base64.length(object.encryptedUserCredentialsHash)), 0); - else if (object.encryptedUserCredentialsHash.length >= 0) - message.encryptedUserCredentialsHash = object.encryptedUserCredentialsHash; - if (object.encryptedLeakMatchPrefixes) { - if (!Array.isArray(object.encryptedLeakMatchPrefixes)) - throw TypeError(".google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification.encryptedLeakMatchPrefixes: array expected"); - message.encryptedLeakMatchPrefixes = []; - for (var i = 0; i < object.encryptedLeakMatchPrefixes.length; ++i) - if (typeof object.encryptedLeakMatchPrefixes[i] === "string") - $util.base64.decode(object.encryptedLeakMatchPrefixes[i], message.encryptedLeakMatchPrefixes[i] = $util.newBuffer($util.base64.length(object.encryptedLeakMatchPrefixes[i])), 0); - else if (object.encryptedLeakMatchPrefixes[i].length >= 0) - message.encryptedLeakMatchPrefixes[i] = object.encryptedLeakMatchPrefixes[i]; + var message = new $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment(); + if (object.labels) { + if (!Array.isArray(object.labels)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) + switch (object.labels[i]) { + default: + case "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED": + case 0: + message.labels[i] = 0; + break; + case "PROFILE_MATCH": + case 1: + message.labels[i] = 1; + break; + case "SUSPICIOUS_LOGIN_ACTIVITY": + case 2: + message.labels[i] = 2; + break; + case "SUSPICIOUS_ACCOUNT_CREATION": + case 3: + message.labels[i] = 3; + break; + case "RELATED_ACCOUNTS_NUMBER_HIGH": + case 4: + message.labels[i] = 4; + break; + } } - if (object.reencryptedUserCredentialsHash != null) - if (typeof object.reencryptedUserCredentialsHash === "string") - $util.base64.decode(object.reencryptedUserCredentialsHash, message.reencryptedUserCredentialsHash = $util.newBuffer($util.base64.length(object.reencryptedUserCredentialsHash)), 0); - else if (object.reencryptedUserCredentialsHash.length >= 0) - message.reencryptedUserCredentialsHash = object.reencryptedUserCredentialsHash; return message; }; /** - * Creates a plain object from a PrivatePasswordLeakVerification message. Also converts values to other types if specified. + * Creates a plain object from an AccountDefenderAssessment message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static - * @param {google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification} message PrivatePasswordLeakVerification + * @param {google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment} message AccountDefenderAssessment * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PrivatePasswordLeakVerification.toObject = function toObject(message, options) { + AccountDefenderAssessment.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.encryptedLeakMatchPrefixes = []; - if (options.defaults) { - if (options.bytes === String) - object.lookupHashPrefix = ""; - else { - object.lookupHashPrefix = []; - if (options.bytes !== Array) - object.lookupHashPrefix = $util.newBuffer(object.lookupHashPrefix); - } - if (options.bytes === String) - object.encryptedUserCredentialsHash = ""; - else { - object.encryptedUserCredentialsHash = []; - if (options.bytes !== Array) - object.encryptedUserCredentialsHash = $util.newBuffer(object.encryptedUserCredentialsHash); - } - if (options.bytes === String) - object.reencryptedUserCredentialsHash = ""; - else { - object.reencryptedUserCredentialsHash = []; - if (options.bytes !== Array) - object.reencryptedUserCredentialsHash = $util.newBuffer(object.reencryptedUserCredentialsHash); - } - } - if (message.lookupHashPrefix != null && message.hasOwnProperty("lookupHashPrefix")) - object.lookupHashPrefix = options.bytes === String ? $util.base64.encode(message.lookupHashPrefix, 0, message.lookupHashPrefix.length) : options.bytes === Array ? Array.prototype.slice.call(message.lookupHashPrefix) : message.lookupHashPrefix; - if (message.encryptedUserCredentialsHash != null && message.hasOwnProperty("encryptedUserCredentialsHash")) - object.encryptedUserCredentialsHash = options.bytes === String ? $util.base64.encode(message.encryptedUserCredentialsHash, 0, message.encryptedUserCredentialsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedUserCredentialsHash) : message.encryptedUserCredentialsHash; - if (message.encryptedLeakMatchPrefixes && message.encryptedLeakMatchPrefixes.length) { - object.encryptedLeakMatchPrefixes = []; - for (var j = 0; j < message.encryptedLeakMatchPrefixes.length; ++j) - object.encryptedLeakMatchPrefixes[j] = options.bytes === String ? $util.base64.encode(message.encryptedLeakMatchPrefixes[j], 0, message.encryptedLeakMatchPrefixes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedLeakMatchPrefixes[j]) : message.encryptedLeakMatchPrefixes[j]; + object.labels = []; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel[message.labels[j]] : message.labels[j]; } - if (message.reencryptedUserCredentialsHash != null && message.hasOwnProperty("reencryptedUserCredentialsHash")) - object.reencryptedUserCredentialsHash = options.bytes === String ? $util.base64.encode(message.reencryptedUserCredentialsHash, 0, message.reencryptedUserCredentialsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.reencryptedUserCredentialsHash) : message.reencryptedUserCredentialsHash; return object; }; /** - * Converts this PrivatePasswordLeakVerification to JSON. + * Converts this AccountDefenderAssessment to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @instance * @returns {Object.} JSON object */ - PrivatePasswordLeakVerification.prototype.toJSON = function toJSON() { + AccountDefenderAssessment.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PrivatePasswordLeakVerification + * Gets the default type url for AccountDefenderAssessment * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification + * @memberof google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PrivatePasswordLeakVerification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AccountDefenderAssessment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.PrivatePasswordLeakVerification"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment"; }; - return PrivatePasswordLeakVerification; + /** + * AccountDefenderLabel enum. + * @name google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel + * @enum {number} + * @property {number} ACCOUNT_DEFENDER_LABEL_UNSPECIFIED=0 ACCOUNT_DEFENDER_LABEL_UNSPECIFIED value + * @property {number} PROFILE_MATCH=1 PROFILE_MATCH value + * @property {number} SUSPICIOUS_LOGIN_ACTIVITY=2 SUSPICIOUS_LOGIN_ACTIVITY value + * @property {number} SUSPICIOUS_ACCOUNT_CREATION=3 SUSPICIOUS_ACCOUNT_CREATION value + * @property {number} RELATED_ACCOUNTS_NUMBER_HIGH=4 RELATED_ACCOUNTS_NUMBER_HIGH value + */ + AccountDefenderAssessment.AccountDefenderLabel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROFILE_MATCH"] = 1; + values[valuesById[2] = "SUSPICIOUS_LOGIN_ACTIVITY"] = 2; + values[valuesById[3] = "SUSPICIOUS_ACCOUNT_CREATION"] = 3; + values[valuesById[4] = "RELATED_ACCOUNTS_NUMBER_HIGH"] = 4; + return values; + })(); + + return AccountDefenderAssessment; })(); v1.CreateKeyRequest = (function() { @@ -3760,32 +3828,278 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ListKeysRequest"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ListKeysRequest"; + }; + + return ListKeysRequest; + })(); + + v1.ListKeysResponse = (function() { + + /** + * Properties of a ListKeysResponse. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IListKeysResponse + * @property {Array.|null} [keys] ListKeysResponse keys + * @property {string|null} [nextPageToken] ListKeysResponse nextPageToken + */ + + /** + * Constructs a new ListKeysResponse. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a ListKeysResponse. + * @implements IListKeysResponse + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse=} [properties] Properties to set + */ + function ListKeysResponse(properties) { + this.keys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListKeysResponse keys. + * @member {Array.} keys + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @instance + */ + ListKeysResponse.prototype.keys = $util.emptyArray; + + /** + * ListKeysResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @instance + */ + ListKeysResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListKeysResponse instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse instance + */ + ListKeysResponse.create = function create(properties) { + return new ListKeysResponse(properties); + }; + + /** + * Encodes the specified ListKeysResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse} message ListKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKeysResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListKeysResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse} message ListKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListKeysResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKeysResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.ListKeysResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListKeysResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKeysResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListKeysResponse message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListKeysResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) { + var error = $root.google.cloud.recaptchaenterprise.v1.Key.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListKeysResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse + */ + ListKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ListKeysResponse) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.ListKeysResponse(); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.ListKeysResponse.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.ListKeysResponse.keys: object expected"); + message.keys[i] = $root.google.cloud.recaptchaenterprise.v1.Key.fromObject(object.keys[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListKeysResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.ListKeysResponse} message ListKeysResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListKeysResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keys = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.cloud.recaptchaenterprise.v1.Key.toObject(message.keys[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListKeysResponse to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @instance + * @returns {Object.} JSON object + */ + ListKeysResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListKeysResponse + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListKeysResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ListKeysResponse"; }; - return ListKeysRequest; + return ListKeysResponse; })(); - v1.ListKeysResponse = (function() { + v1.RetrieveLegacySecretKeyRequest = (function() { /** - * Properties of a ListKeysResponse. + * Properties of a RetrieveLegacySecretKeyRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @interface IListKeysResponse - * @property {Array.|null} [keys] ListKeysResponse keys - * @property {string|null} [nextPageToken] ListKeysResponse nextPageToken + * @interface IRetrieveLegacySecretKeyRequest + * @property {string|null} [key] RetrieveLegacySecretKeyRequest key */ /** - * Constructs a new ListKeysResponse. + * Constructs a new RetrieveLegacySecretKeyRequest. * @memberof google.cloud.recaptchaenterprise.v1 - * @classdesc Represents a ListKeysResponse. - * @implements IListKeysResponse + * @classdesc Represents a RetrieveLegacySecretKeyRequest. + * @implements IRetrieveLegacySecretKeyRequest * @constructor - * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse=} [properties] Properties to set + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest=} [properties] Properties to set */ - function ListKeysResponse(properties) { - this.keys = []; + function RetrieveLegacySecretKeyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3793,92 +4107,75 @@ } /** - * ListKeysResponse keys. - * @member {Array.} keys - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse - * @instance - */ - ListKeysResponse.prototype.keys = $util.emptyArray; - - /** - * ListKeysResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * RetrieveLegacySecretKeyRequest key. + * @member {string} key + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @instance */ - ListKeysResponse.prototype.nextPageToken = ""; + RetrieveLegacySecretKeyRequest.prototype.key = ""; /** - * Creates a new ListKeysResponse instance using the specified properties. + * Creates a new RetrieveLegacySecretKeyRequest instance using the specified properties. * @function create - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse=} [properties] Properties to set - * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse instance + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest} RetrieveLegacySecretKeyRequest instance */ - ListKeysResponse.create = function create(properties) { - return new ListKeysResponse(properties); + RetrieveLegacySecretKeyRequest.create = function create(properties) { + return new RetrieveLegacySecretKeyRequest(properties); }; /** - * Encodes the specified ListKeysResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysResponse.verify|verify} messages. + * Encodes the specified RetrieveLegacySecretKeyRequest message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse} message ListKeysResponse message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest} message RetrieveLegacySecretKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListKeysResponse.encode = function encode(message, writer) { + RetrieveLegacySecretKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - $root.google.cloud.recaptchaenterprise.v1.Key.encode(message.keys[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.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); return writer; }; /** - * Encodes the specified ListKeysResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.ListKeysResponse.verify|verify} messages. + * Encodes the specified RetrieveLegacySecretKeyRequest message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.IListKeysResponse} message ListKeysResponse message or plain object to encode + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest} message RetrieveLegacySecretKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + RetrieveLegacySecretKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListKeysResponse message from the specified reader or buffer. + * Decodes a RetrieveLegacySecretKeyRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse + * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest} RetrieveLegacySecretKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListKeysResponse.decode = function decode(reader, length) { + RetrieveLegacySecretKeyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.ListKeysResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.cloud.recaptchaenterprise.v1.Key.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); + message.key = reader.string(); break; } default: @@ -3890,128 +4187,102 @@ }; /** - * Decodes a ListKeysResponse message from the specified reader or buffer, length delimited. + * Decodes a RetrieveLegacySecretKeyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse + * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest} RetrieveLegacySecretKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListKeysResponse.decodeDelimited = function decodeDelimited(reader) { + RetrieveLegacySecretKeyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListKeysResponse message. + * Verifies a RetrieveLegacySecretKeyRequest message. * @function verify - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListKeysResponse.verify = function verify(message) { + RetrieveLegacySecretKeyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.keys != null && message.hasOwnProperty("keys")) { - if (!Array.isArray(message.keys)) - return "keys: array expected"; - for (var i = 0; i < message.keys.length; ++i) { - var error = $root.google.cloud.recaptchaenterprise.v1.Key.verify(message.keys[i]); - if (error) - return "keys." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; return null; }; /** - * Creates a ListKeysResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RetrieveLegacySecretKeyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.recaptchaenterprise.v1.ListKeysResponse} ListKeysResponse + * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest} RetrieveLegacySecretKeyRequest */ - ListKeysResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.recaptchaenterprise.v1.ListKeysResponse) + RetrieveLegacySecretKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest) return object; - var message = new $root.google.cloud.recaptchaenterprise.v1.ListKeysResponse(); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".google.cloud.recaptchaenterprise.v1.ListKeysResponse.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".google.cloud.recaptchaenterprise.v1.ListKeysResponse.keys: object expected"); - message.keys[i] = $root.google.cloud.recaptchaenterprise.v1.Key.fromObject(object.keys[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + var message = new $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest(); + if (object.key != null) + message.key = String(object.key); return message; }; /** - * Creates a plain object from a ListKeysResponse message. Also converts values to other types if specified. + * Creates a plain object from a RetrieveLegacySecretKeyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static - * @param {google.cloud.recaptchaenterprise.v1.ListKeysResponse} message ListKeysResponse + * @param {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest} message RetrieveLegacySecretKeyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListKeysResponse.toObject = function toObject(message, options) { + RetrieveLegacySecretKeyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.keys = []; if (options.defaults) - object.nextPageToken = ""; - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.cloud.recaptchaenterprise.v1.Key.toObject(message.keys[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + object.key = ""; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; return object; }; /** - * Converts this ListKeysResponse to JSON. + * Converts this RetrieveLegacySecretKeyRequest to JSON. * @function toJSON - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @instance * @returns {Object.} JSON object */ - ListKeysResponse.prototype.toJSON = function toJSON() { + RetrieveLegacySecretKeyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListKeysResponse + * Gets the default type url for RetrieveLegacySecretKeyRequest * @function getTypeUrl - * @memberof google.cloud.recaptchaenterprise.v1.ListKeysResponse + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListKeysResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RetrieveLegacySecretKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.ListKeysResponse"; + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest"; }; - return ListKeysResponse; + return RetrieveLegacySecretKeyRequest; })(); v1.GetKeyRequest = (function() { @@ -5385,6 +5656,209 @@ return Metrics; })(); + v1.RetrieveLegacySecretKeyResponse = (function() { + + /** + * Properties of a RetrieveLegacySecretKeyResponse. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IRetrieveLegacySecretKeyResponse + * @property {string|null} [legacySecretKey] RetrieveLegacySecretKeyResponse legacySecretKey + */ + + /** + * Constructs a new RetrieveLegacySecretKeyResponse. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a RetrieveLegacySecretKeyResponse. + * @implements IRetrieveLegacySecretKeyResponse + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse=} [properties] Properties to set + */ + function RetrieveLegacySecretKeyResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrieveLegacySecretKeyResponse legacySecretKey. + * @member {string} legacySecretKey + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @instance + */ + RetrieveLegacySecretKeyResponse.prototype.legacySecretKey = ""; + + /** + * Creates a new RetrieveLegacySecretKeyResponse instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse} RetrieveLegacySecretKeyResponse instance + */ + RetrieveLegacySecretKeyResponse.create = function create(properties) { + return new RetrieveLegacySecretKeyResponse(properties); + }; + + /** + * Encodes the specified RetrieveLegacySecretKeyResponse message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse} message RetrieveLegacySecretKeyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveLegacySecretKeyResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.legacySecretKey != null && Object.hasOwnProperty.call(message, "legacySecretKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.legacySecretKey); + return writer; + }; + + /** + * Encodes the specified RetrieveLegacySecretKeyResponse message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse} message RetrieveLegacySecretKeyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveLegacySecretKeyResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveLegacySecretKeyResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse} RetrieveLegacySecretKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveLegacySecretKeyResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.legacySecretKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveLegacySecretKeyResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse} RetrieveLegacySecretKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveLegacySecretKeyResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveLegacySecretKeyResponse message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveLegacySecretKeyResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.legacySecretKey != null && message.hasOwnProperty("legacySecretKey")) + if (!$util.isString(message.legacySecretKey)) + return "legacySecretKey: string expected"; + return null; + }; + + /** + * Creates a RetrieveLegacySecretKeyResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse} RetrieveLegacySecretKeyResponse + */ + RetrieveLegacySecretKeyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse(); + if (object.legacySecretKey != null) + message.legacySecretKey = String(object.legacySecretKey); + return message; + }; + + /** + * Creates a plain object from a RetrieveLegacySecretKeyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @static + * @param {google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse} message RetrieveLegacySecretKeyResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveLegacySecretKeyResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.legacySecretKey = ""; + if (message.legacySecretKey != null && message.hasOwnProperty("legacySecretKey")) + object.legacySecretKey = message.legacySecretKey; + return object; + }; + + /** + * Converts this RetrieveLegacySecretKeyResponse to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @instance + * @returns {Object.} JSON object + */ + RetrieveLegacySecretKeyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveLegacySecretKeyResponse + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveLegacySecretKeyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse"; + }; + + return RetrieveLegacySecretKeyResponse; + })(); + v1.Key = (function() { /** diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index d3ef26da0a5..740e42bfc12 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -94,6 +94,24 @@ } ] }, + "RetrieveLegacySecretKey": { + "requestType": "RetrieveLegacySecretKeyRequest", + "responseType": "RetrieveLegacySecretKeyResponse", + "options": { + "(google.api.http).get": "/v1/{key=projects/*/keys/*}:retrieveLegacySecretKey", + "(google.api.method_signature)": "key" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{key=projects/*/keys/*}:retrieveLegacySecretKey" + } + }, + { + "(google.api.method_signature)": "key" + } + ] + }, "GetKey": { "requestType": "GetKeyRequest", "responseType": "Key", @@ -298,12 +316,17 @@ "CHARGEBACK": 1, "CHARGEBACK_FRAUD": 8, "CHARGEBACK_DISPUTE": 9, + "REFUND": 10, + "REFUND_FRAUD": 11, + "TRANSACTION_ACCEPTED": 12, + "TRANSACTION_DECLINED": 13, "PAYMENT_HEURISTICS": 2, "INITIATED_TWO_FACTOR": 7, "PASSED_TWO_FACTOR": 3, "FAILED_TWO_FACTOR": 4, "CORRECT_PASSWORD": 5, - "INCORRECT_PASSWORD": 6 + "INCORRECT_PASSWORD": 6, + "SOCIAL_SPAM": 14 } } } @@ -311,6 +334,39 @@ "AnnotateAssessmentResponse": { "fields": {} }, + "PrivatePasswordLeakVerification": { + "fields": { + "lookupHashPrefix": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptedUserCredentialsHash": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptedLeakMatchPrefixes": { + "rule": "repeated", + "type": "bytes", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reencryptedUserCredentialsHash": { + "type": "bytes", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "Assessment": { "options": { "(google.api.resource).type": "recaptchaenterprise.googleapis.com/Assessment", @@ -480,39 +536,6 @@ } } }, - "PrivatePasswordLeakVerification": { - "fields": { - "lookupHashPrefix": { - "type": "bytes", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptedUserCredentialsHash": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptedLeakMatchPrefixes": { - "rule": "repeated", - "type": "bytes", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "reencryptedUserCredentialsHash": { - "type": "bytes", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, "CreateKeyRequest": { "fields": { "parent": { @@ -571,6 +594,18 @@ } } }, + "RetrieveLegacySecretKeyRequest": { + "fields": { + "key": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recaptchaenterprise.googleapis.com/Key" + } + } + } + }, "GetKeyRequest": { "fields": { "name": { @@ -666,6 +701,14 @@ } } }, + "RetrieveLegacySecretKeyResponse": { + "fields": { + "legacySecretKey": { + "type": "string", + "id": 1 + } + } + }, "Key": { "options": { "(google.api.resource).type": "recaptchaenterprise.googleapis.com/Key", diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js index 9a5a2ad4a34..24146c3cd7d 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.annotate_assessment.js @@ -34,19 +34,18 @@ function main(name) { */ // const name = 'abc123' /** - * Optional. The annotation that will be assigned to the Event. This field can - * be left empty to provide reasons that apply to an event without concluding - * whether the event is legitimate or fraudulent. + * Optional. The annotation that will be assigned to the Event. This field can be left + * empty to provide reasons that apply to an event without concluding whether + * the event is legitimate or fraudulent. */ // const annotation = {} /** - * Optional. Optional reasons for the annotation that will be assigned to the - * Event. + * Optional. Optional reasons for the annotation that will be assigned to the Event. */ // const reasons = 1234 /** - * Optional. Optional unique stable hashed user identifier to apply to the - * assessment. This is an alternative to setting the hashed_account_id in + * Optional. Unique stable hashed user identifier to apply to the assessment. + * This is an alternative to setting the hashed_account_id in * CreateAssessment, for example when the account identifier is not yet known * in the initial request. It is recommended that the identifier is hashed * using hmac-sha256 with stable secret. diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js index c12e903eb25..097f294ce3c 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_group_memberships.js @@ -34,15 +34,15 @@ function main(parent) { */ // const parent = 'abc123' /** - * Optional. The maximum number of accounts to return. The service may return - * fewer than this value. If unspecified, at most 50 accounts will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. + * Optional. The maximum number of accounts to return. The service might return fewer + * than this value. + * If unspecified, at most 50 accounts are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. */ // const pageSize = 1234 /** - * Optional. A page token, received from a previous - * `ListRelatedAccountGroupMemberships` call. + * Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` + * call. * When paginating, all other parameters provided to * `ListRelatedAccountGroupMemberships` must match the call that provided the * page token. diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js index e4b1eb7c198..9be614706a0 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.list_related_account_groups.js @@ -29,19 +29,20 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the project to list related account groups from, in - * the format "projects/{project}". + * Required. The name of the project to list related account groups from, in the format + * "projects/{project}". */ // const parent = 'abc123' /** - * Optional. The maximum number of groups to return. The service may return - * fewer than this value. If unspecified, at most 50 groups will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * Optional. The maximum number of groups to return. The service might return fewer than + * this value. + * If unspecified, at most 50 groups are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. */ // const pageSize = 1234 /** - * Optional. A page token, received from a previous `ListRelatedAccountGroups` - * call. Provide this to retrieve the subsequent page. + * Optional. A page token, received from a previous `ListRelatedAccountGroups` call. + * Provide this to retrieve the subsequent page. * When paginating, all other parameters provided to * `ListRelatedAccountGroups` must match the call that provided the page * token. diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.retrieve_legacy_secret_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.retrieve_legacy_secret_key.js new file mode 100644 index 00000000000..95cb5eb22e9 --- /dev/null +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.retrieve_legacy_secret_key.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(key) { + // [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RetrieveLegacySecretKey_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The public key name linked to the requested secret key in the format + * "projects/{project}/keys/{key}". + */ + // const key = 'abc123' + + // Imports the Recaptchaenterprise library + const {RecaptchaEnterpriseServiceClient} = require('@google-cloud/recaptcha-enterprise').v1; + + // Instantiates a client + const recaptchaenterpriseClient = new RecaptchaEnterpriseServiceClient(); + + async function callRetrieveLegacySecretKey() { + // Construct request + const request = { + key, + }; + + // Run request + const response = await recaptchaenterpriseClient.retrieveLegacySecretKey(request); + console.log(response); + } + + callRetrieveLegacySecretKey(); + // [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RetrieveLegacySecretKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js index c06150a8a2b..1e85d154cb6 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.search_related_account_group_memberships.js @@ -29,20 +29,21 @@ function main(project) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the project to search related account group - * memberships from, in the format "projects/{project}". + * Required. The name of the project to search related account group memberships from. + * Specify the project name in the following format: "projects/{project}". */ // const project = 'my-project' /** - * Optional. The unique stable hashed user identifier we should search - * connections to. The identifier should correspond to a `hashed_account_id` - * provided in a previous CreateAssessment or AnnotateAssessment call. + * Optional. The unique stable hashed user identifier we should search connections to. + * The identifier should correspond to a `hashed_account_id` provided in a + * previous `CreateAssessment` or `AnnotateAssessment` call. */ // const hashedAccountId = 'Buffer.from('string')' /** - * Optional. The maximum number of groups to return. The service may return - * fewer than this value. If unspecified, at most 50 groups will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * Optional. The maximum number of groups to return. The service might return fewer than + * this value. + * If unspecified, at most 50 groups are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. */ // const pageSize = 1234 /** diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js index b50005c503d..b7fc0fc86cd 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/recaptcha_enterprise_service.update_key.js @@ -33,8 +33,8 @@ function main(key) { */ // const key = {} /** - * Optional. The mask to control which fields of the key get updated. If the - * mask is not present, all fields will be updated. + * Optional. The mask to control which fields of the key get updated. If the mask is not + * present, all fields will be updated. */ // const updateMask = {} diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index c249b471cf1..077f8dfc9f4 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -66,7 +66,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 72, "type": "FULL" } ], @@ -199,6 +199,46 @@ } } }, + { + "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RetrieveLegacySecretKey_async", + "title": "RecaptchaEnterpriseService retrieveLegacySecretKey Sample", + "origin": "API_DEFINITION", + "description": " Returns the secret key related to the specified public key. You must use the legacy secret key only in a 3rd party integration with legacy reCAPTCHA.", + "canonical": true, + "file": "recaptcha_enterprise_service.retrieve_legacy_secret_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RetrieveLegacySecretKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.RetrieveLegacySecretKey", + "async": true, + "parameters": [ + { + "name": "key", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse", + "client": { + "shortName": "RecaptchaEnterpriseServiceClient", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient" + }, + "method": { + "shortName": "RetrieveLegacySecretKey", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService.RetrieveLegacySecretKey", + "service": { + "shortName": "RecaptchaEnterpriseService", + "fullName": "google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService" + } + } + } + }, { "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_async", "title": "RecaptchaEnterpriseService getKey Sample", @@ -414,7 +454,7 @@ "segments": [ { "start": 25, - "end": 70, + "end": 71, "type": "FULL" } ], @@ -455,7 +495,7 @@ "regionTag": "recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_async", "title": "RecaptchaEnterpriseService listRelatedAccountGroupMemberships Sample", "origin": "API_DEFINITION", - "description": " Get the memberships in a group of related accounts.", + "description": " Get memberships in a group of related accounts.", "canonical": true, "file": "recaptcha_enterprise_service.list_related_account_group_memberships.js", "language": "JAVASCRIPT", @@ -510,7 +550,7 @@ "segments": [ { "start": 25, - "end": 77, + "end": 78, "type": "FULL" } ], diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json b/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json index 09321f22a15..023c63fe31e 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json +++ b/packages/google-cloud-recaptchaenterprise/src/v1/gapic_metadata.json @@ -25,6 +25,11 @@ "createKey" ] }, + "RetrieveLegacySecretKey": { + "methods": [ + "retrieveLegacySecretKey" + ] + }, "GetKey": { "methods": [ "getKey" @@ -98,6 +103,11 @@ "createKey" ] }, + "RetrieveLegacySecretKey": { + "methods": [ + "retrieveLegacySecretKey" + ] + }, "GetKey": { "methods": [ "getKey" diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts index bc800f8e8dc..f4b28da6fb2 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client.ts @@ -278,6 +278,7 @@ export class RecaptchaEnterpriseServiceClient { 'annotateAssessment', 'createKey', 'listKeys', + 'retrieveLegacySecretKey', 'getKey', 'updateKey', 'deleteKey', @@ -479,15 +480,14 @@ export class RecaptchaEnterpriseServiceClient { * Required. The resource name of the Assessment, in the format * "projects/{project}/assessments/{assessment}". * @param {google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation} [request.annotation] - * Optional. The annotation that will be assigned to the Event. This field can - * be left empty to provide reasons that apply to an event without concluding - * whether the event is legitimate or fraudulent. + * Optional. The annotation that will be assigned to the Event. This field can be left + * empty to provide reasons that apply to an event without concluding whether + * the event is legitimate or fraudulent. * @param {number[]} [request.reasons] - * Optional. Optional reasons for the annotation that will be assigned to the - * Event. + * Optional. Optional reasons for the annotation that will be assigned to the Event. * @param {Buffer} [request.hashedAccountId] - * Optional. Optional unique stable hashed user identifier to apply to the - * assessment. This is an alternative to setting the hashed_account_id in + * Optional. Unique stable hashed user identifier to apply to the assessment. + * This is an alternative to setting the hashed_account_id in * CreateAssessment, for example when the account identifier is not yet known * in the initial request. It is recommended that the identifier is hashed * using hmac-sha256 with stable secret. @@ -675,6 +675,110 @@ export class RecaptchaEnterpriseServiceClient { this.initialize(); return this.innerApiCalls.createKey(request, options, callback); } + /** + * Returns the secret key related to the specified public key. + * You must use the legacy secret key only in a 3rd party integration with + * legacy reCAPTCHA. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.key + * Required. The public key name linked to the requested secret key in the format + * "projects/{project}/keys/{key}". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RetrieveLegacySecretKeyResponse]{@link google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse}. + * 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/recaptcha_enterprise_service.retrieve_legacy_secret_key.js + * region_tag:recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RetrieveLegacySecretKey_async + */ + retrieveLegacySecretKey( + request?: protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse, + ( + | protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest + | undefined + ), + {} | undefined + ] + >; + retrieveLegacySecretKey( + request: protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse, + | protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + retrieveLegacySecretKey( + request: protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest, + callback: Callback< + protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse, + | protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + retrieveLegacySecretKey( + request?: protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse, + | protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse, + | protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse, + ( + | protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + key: request.key ?? '', + }); + this.initialize(); + return this.innerApiCalls.retrieveLegacySecretKey( + request, + options, + callback + ); + } /** * Returns the specified key. * @@ -775,8 +879,8 @@ export class RecaptchaEnterpriseServiceClient { * @param {google.cloud.recaptchaenterprise.v1.Key} request.key * Required. The key to update. * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The mask to control which fields of the key get updated. If the - * mask is not present, all fields will be updated. + * Optional. The mask to control which fields of the key get updated. If the mask is not + * present, all fields will be 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. @@ -1348,15 +1452,16 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project to list related account groups from, in - * the format "projects/{project}". + * Required. The name of the project to list related account groups from, in the format + * "projects/{project}". * @param {number} [request.pageSize] - * Optional. The maximum number of groups to return. The service may return - * fewer than this value. If unspecified, at most 50 groups will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * Optional. The maximum number of groups to return. The service might return fewer than + * this value. + * If unspecified, at most 50 groups are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRelatedAccountGroups` - * call. Provide this to retrieve the subsequent page. + * Optional. A page token, received from a previous `ListRelatedAccountGroups` call. + * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to * `ListRelatedAccountGroups` must match the call that provided the page @@ -1458,15 +1563,16 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project to list related account groups from, in - * the format "projects/{project}". + * Required. The name of the project to list related account groups from, in the format + * "projects/{project}". * @param {number} [request.pageSize] - * Optional. The maximum number of groups to return. The service may return - * fewer than this value. If unspecified, at most 50 groups will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * Optional. The maximum number of groups to return. The service might return fewer than + * this value. + * If unspecified, at most 50 groups are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRelatedAccountGroups` - * call. Provide this to retrieve the subsequent page. + * Optional. A page token, received from a previous `ListRelatedAccountGroups` call. + * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to * `ListRelatedAccountGroups` must match the call that provided the page @@ -1512,15 +1618,16 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project to list related account groups from, in - * the format "projects/{project}". + * Required. The name of the project to list related account groups from, in the format + * "projects/{project}". * @param {number} [request.pageSize] - * Optional. The maximum number of groups to return. The service may return - * fewer than this value. If unspecified, at most 50 groups will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * Optional. The maximum number of groups to return. The service might return fewer than + * this value. + * If unspecified, at most 50 groups are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRelatedAccountGroups` - * call. Provide this to retrieve the subsequent page. + * Optional. A page token, received from a previous `ListRelatedAccountGroups` call. + * Provide this to retrieve the subsequent page. * * When paginating, all other parameters provided to * `ListRelatedAccountGroups` must match the call that provided the page @@ -1560,7 +1667,7 @@ export class RecaptchaEnterpriseServiceClient { ) as AsyncIterable; } /** - * Get the memberships in a group of related accounts. + * Get memberships in a group of related accounts. * * @param {Object} request * The request object that will be sent. @@ -1568,13 +1675,13 @@ export class RecaptchaEnterpriseServiceClient { * Required. The resource name for the related account group in the format * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. * @param {number} [request.pageSize] - * Optional. The maximum number of accounts to return. The service may return - * fewer than this value. If unspecified, at most 50 accounts will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. + * Optional. The maximum number of accounts to return. The service might return fewer + * than this value. + * If unspecified, at most 50 accounts are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListRelatedAccountGroupMemberships` call. + * Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` + * call. * * When paginating, all other parameters provided to * `ListRelatedAccountGroupMemberships` must match the call that provided the @@ -1679,13 +1786,13 @@ export class RecaptchaEnterpriseServiceClient { * Required. The resource name for the related account group in the format * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. * @param {number} [request.pageSize] - * Optional. The maximum number of accounts to return. The service may return - * fewer than this value. If unspecified, at most 50 accounts will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. + * Optional. The maximum number of accounts to return. The service might return fewer + * than this value. + * If unspecified, at most 50 accounts are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListRelatedAccountGroupMemberships` call. + * Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` + * call. * * When paginating, all other parameters provided to * `ListRelatedAccountGroupMemberships` must match the call that provided the @@ -1735,13 +1842,13 @@ export class RecaptchaEnterpriseServiceClient { * Required. The resource name for the related account group in the format * `projects/{project}/relatedaccountgroups/{relatedaccountgroup}`. * @param {number} [request.pageSize] - * Optional. The maximum number of accounts to return. The service may return - * fewer than this value. If unspecified, at most 50 accounts will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. + * Optional. The maximum number of accounts to return. The service might return fewer + * than this value. + * If unspecified, at most 50 accounts are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListRelatedAccountGroupMemberships` call. + * Optional. A page token, received from a previous `ListRelatedAccountGroupMemberships` + * call. * * When paginating, all other parameters provided to * `ListRelatedAccountGroupMemberships` must match the call that provided the @@ -1787,16 +1894,17 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.project - * Required. The name of the project to search related account group - * memberships from, in the format "projects/{project}". + * Required. The name of the project to search related account group memberships from. + * Specify the project name in the following format: "projects/{project}". * @param {Buffer} [request.hashedAccountId] - * Optional. The unique stable hashed user identifier we should search - * connections to. The identifier should correspond to a `hashed_account_id` - * provided in a previous CreateAssessment or AnnotateAssessment call. + * Optional. The unique stable hashed user identifier we should search connections to. + * The identifier should correspond to a `hashed_account_id` provided in a + * previous `CreateAssessment` or `AnnotateAssessment` call. * @param {number} [request.pageSize] - * Optional. The maximum number of groups to return. The service may return - * fewer than this value. If unspecified, at most 50 groups will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * Optional. The maximum number of groups to return. The service might return fewer than + * this value. + * If unspecified, at most 50 groups are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. * @param {string} [request.pageToken] * Optional. A page token, received from a previous * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the @@ -1902,16 +2010,17 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.project - * Required. The name of the project to search related account group - * memberships from, in the format "projects/{project}". + * Required. The name of the project to search related account group memberships from. + * Specify the project name in the following format: "projects/{project}". * @param {Buffer} [request.hashedAccountId] - * Optional. The unique stable hashed user identifier we should search - * connections to. The identifier should correspond to a `hashed_account_id` - * provided in a previous CreateAssessment or AnnotateAssessment call. + * Optional. The unique stable hashed user identifier we should search connections to. + * The identifier should correspond to a `hashed_account_id` provided in a + * previous `CreateAssessment` or `AnnotateAssessment` call. * @param {number} [request.pageSize] - * Optional. The maximum number of groups to return. The service may return - * fewer than this value. If unspecified, at most 50 groups will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * Optional. The maximum number of groups to return. The service might return fewer than + * this value. + * If unspecified, at most 50 groups are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. * @param {string} [request.pageToken] * Optional. A page token, received from a previous * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the @@ -1962,16 +2071,17 @@ export class RecaptchaEnterpriseServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.project - * Required. The name of the project to search related account group - * memberships from, in the format "projects/{project}". + * Required. The name of the project to search related account group memberships from. + * Specify the project name in the following format: "projects/{project}". * @param {Buffer} [request.hashedAccountId] - * Optional. The unique stable hashed user identifier we should search - * connections to. The identifier should correspond to a `hashed_account_id` - * provided in a previous CreateAssessment or AnnotateAssessment call. + * Optional. The unique stable hashed user identifier we should search connections to. + * The identifier should correspond to a `hashed_account_id` provided in a + * previous `CreateAssessment` or `AnnotateAssessment` call. * @param {number} [request.pageSize] - * Optional. The maximum number of groups to return. The service may return - * fewer than this value. If unspecified, at most 50 groups will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. + * Optional. The maximum number of groups to return. The service might return fewer than + * this value. + * If unspecified, at most 50 groups are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. * @param {string} [request.pageToken] * Optional. A page token, received from a previous * `SearchRelatedAccountGroupMemberships` call. Provide this to retrieve the diff --git a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json index 66fe297cf6f..acb5f95bd9c 100644 --- a/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json +++ b/packages/google-cloud-recaptchaenterprise/src/v1/recaptcha_enterprise_service_client_config.json @@ -40,6 +40,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "RetrieveLegacySecretKey": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "GetKey": { "timeout_millis": 600000, "retry_codes_name": "non_idempotent", diff --git a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts index db170b7bde6..ab5f746919a 100644 --- a/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts +++ b/packages/google-cloud-recaptchaenterprise/test/gapic_recaptcha_enterprise_service_v1.ts @@ -674,6 +674,155 @@ describe('v1.RecaptchaEnterpriseServiceClient', () => { }); }); + describe('retrieveLegacySecretKey', () => { + it('invokes retrieveLegacySecretKey without error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest', + ['key'] + ); + request.key = defaultValue1; + const expectedHeaderRequestParams = `key=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse() + ); + client.innerApiCalls.retrieveLegacySecretKey = + stubSimpleCall(expectedResponse); + const [response] = await client.retrieveLegacySecretKey(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.retrieveLegacySecretKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.retrieveLegacySecretKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveLegacySecretKey without error using callback', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest', + ['key'] + ); + request.key = defaultValue1; + const expectedHeaderRequestParams = `key=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse() + ); + client.innerApiCalls.retrieveLegacySecretKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.retrieveLegacySecretKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recaptchaenterprise.v1.IRetrieveLegacySecretKeyResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.retrieveLegacySecretKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.retrieveLegacySecretKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveLegacySecretKey with error', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest', + ['key'] + ); + request.key = defaultValue1; + const expectedHeaderRequestParams = `key=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.retrieveLegacySecretKey = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.retrieveLegacySecretKey(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.retrieveLegacySecretKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.retrieveLegacySecretKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveLegacySecretKey with closed client', async () => { + const client = + new recaptchaenterpriseserviceModule.v1.RecaptchaEnterpriseServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest', + ['key'] + ); + request.key = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.retrieveLegacySecretKey(request), + expectedError + ); + }); + }); + describe('getKey', () => { it('invokes getKey without error', async () => { const client = From 6d50a28cc452d821ef34dcf40e24c02b444bc821 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 19:12:17 +0000 Subject: [PATCH 248/253] chore(main): release 3.1.0 (#412) :robot: I have created a release *beep* *boop* --- ## [3.1.0](https://togithub.com/googleapis/nodejs-recaptcha-enterprise/compare/v3.0.4...v3.1.0) (2022-10-13) ### Features * Add RetrieveLegacySecretKey method ([#411](https://togithub.com/googleapis/nodejs-recaptcha-enterprise/issues/411)) ([2e8fa59](https://togithub.com/googleapis/nodejs-recaptcha-enterprise/commit/2e8fa599b514e9e666bd04d009dd503318c205e4)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 7 +++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- ...ippet_metadata.google.cloud.recaptchaenterprise.v1.json | 2 +- ..._metadata.google.cloud.recaptchaenterprise.v1beta1.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 8dc0c2dbe83..76aa349fdfb 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [3.1.0](https://github.com/googleapis/nodejs-recaptcha-enterprise/compare/v3.0.4...v3.1.0) (2022-10-13) + + +### Features + +* Add RetrieveLegacySecretKey method ([#411](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/411)) ([2e8fa59](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/2e8fa599b514e9e666bd04d009dd503318c205e4)) + ## [3.0.4](https://github.com/googleapis/nodejs-recaptcha-enterprise/compare/v3.0.3...v3.0.4) (2022-09-22) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 6e7cf82b105..356abe11fd7 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "3.0.4", + "version": "3.1.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index 077f8dfc9f4..19fc9b0213f 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "3.0.4", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json index e7f35db693a..31239291add 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "3.0.4", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 796d59aca8a..bdfe155de09 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "echo add tests" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^3.0.4" + "@google-cloud/recaptcha-enterprise": "^3.1.0" }, "devDependencies": { "chai": "^4.2.0", From 18c785fd0f05bc4fbdb81b02ca76a82e2b084561 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 3 Nov 2022 23:47:24 -0700 Subject: [PATCH 249/253] fix(deps): use google-gax v3.5.2 (#415) --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 356abe11fd7..25cb175c29b 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -25,7 +25,7 @@ "reCAPTCHA Enterprise API" ], "dependencies": { - "google-gax": "^3.3.0" + "google-gax": "^3.5.2" }, "devDependencies": { "@types/mocha": "^9.0.0", From 25ae5252dd06189c5e400b94a09ef3d9a2e03a1d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 10:30:22 +0100 Subject: [PATCH 250/253] chore(deps): update dependency jsdoc to v4 (#418) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc](https://togithub.com/jsdoc/jsdoc) | [`^3.6.2` -> `^4.0.0`](https://renovatebot.com/diffs/npm/jsdoc/3.6.11/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/compatibility-slim/3.6.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/confidence-slim/3.6.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
jsdoc/jsdoc ### [`v4.0.0`](https://togithub.com/jsdoc/jsdoc/blob/HEAD/CHANGES.md#​400-November-2022) [Compare Source](https://togithub.com/jsdoc/jsdoc/compare/3.6.11...084218523a7d69fec14a852ce680f374f526af28) - JSDoc releases now use [semantic versioning](https://semver.org/). If JSDoc makes backwards-incompatible changes in the future, the major version will be incremented. - JSDoc no longer uses the [`taffydb`](https://taffydb.com/) package. If your JSDoc template or plugin uses the `taffydb` package, see the [instructions for replacing `taffydb` with `@jsdoc/salty`](https://togithub.com/jsdoc/jsdoc/tree/main/packages/jsdoc-salty#use-salty-in-a-jsdoc-template). - JSDoc now supports Node.js 12.0.0 and later.
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 25cb175c29b..4b7e705ab37 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -33,7 +33,7 @@ "@types/sinon": "^10.0.0", "c8": "^7.0.0", "gts": "^3.1.0", - "jsdoc": "^3.6.2", + "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^4.0.0", From 237a359288c99d49ee22e6a63b145ee1a9be88c2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 01:00:22 +0000 Subject: [PATCH 251/253] fix: regenerated protos JS and TS definitions (#419) samples: pull in latest typeless bot, clean up some comments Source-Link: https://togithub.com/googleapis/synthtool/commit/0a68e568b6911b60bb6fd452eba4848b176031d8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:5b05f26103855c3a15433141389c478d1d3fe088fb5d4e3217c4793f6b3f245e --- .../protos/protos.d.ts | 2 +- .../protos/protos.js | 184 +++++++++++++++--- .../protos/protos.json | 21 ++ 3 files changed, 181 insertions(+), 26 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index a19b96effa5..819d15cf6a6 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Long = require("long"); import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index ab3c204895c..479c0761672 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -1010,6 +1010,12 @@ if (object.name != null) message.name = String(object.name); switch (object.annotation) { + default: + if (typeof object.annotation === "number") { + message.annotation = object.annotation; + break; + } + break; case "ANNOTATION_UNSPECIFIED": case 0: message.annotation = 0; @@ -1038,6 +1044,10 @@ for (var i = 0; i < object.reasons.length; ++i) switch (object.reasons[i]) { default: + if (typeof object.reasons[i] === "number") { + message.reasons[i] = object.reasons[i]; + break; + } case "REASON_UNSPECIFIED": case 0: message.reasons[i] = 0; @@ -1137,11 +1147,11 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.annotation != null && message.hasOwnProperty("annotation")) - object.annotation = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation[message.annotation] : message.annotation; + object.annotation = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation[message.annotation] === undefined ? message.annotation : $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation[message.annotation] : message.annotation; if (message.reasons && message.reasons.length) { object.reasons = []; for (var j = 0; j < message.reasons.length; ++j) - object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason[message.reasons[j]] : message.reasons[j]; + object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason[message.reasons[j]] === undefined ? message.reasons[j] : $root.google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason[message.reasons[j]] : message.reasons[j]; } if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; @@ -2605,6 +2615,10 @@ for (var i = 0; i < object.reasons.length; ++i) switch (object.reasons[i]) { default: + if (typeof object.reasons[i] === "number") { + message.reasons[i] = object.reasons[i]; + break; + } case "CLASSIFICATION_REASON_UNSPECIFIED": case 0: message.reasons[i] = 0; @@ -2656,7 +2670,7 @@ if (message.reasons && message.reasons.length) { object.reasons = []; for (var j = 0; j < message.reasons.length; ++j) - object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason[message.reasons[j]] : message.reasons[j]; + object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason[message.reasons[j]] === undefined ? message.reasons[j] : $root.google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason[message.reasons[j]] : message.reasons[j]; } return object; }; @@ -2948,6 +2962,12 @@ if (object.valid != null) message.valid = Boolean(object.valid); switch (object.invalidReason) { + default: + if (typeof object.invalidReason === "number") { + message.invalidReason = object.invalidReason; + break; + } + break; case "INVALID_REASON_UNSPECIFIED": case 0: message.invalidReason = 0; @@ -3012,7 +3032,7 @@ if (message.valid != null && message.hasOwnProperty("valid")) object.valid = message.valid; if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) - object.invalidReason = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason[message.invalidReason] : message.invalidReason; + object.invalidReason = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason[message.invalidReason] === undefined ? message.invalidReason : $root.google.cloud.recaptchaenterprise.v1.TokenProperties.InvalidReason[message.invalidReason] : message.invalidReason; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.hostname != null && message.hasOwnProperty("hostname")) @@ -3255,6 +3275,10 @@ for (var i = 0; i < object.labels.length; ++i) switch (object.labels[i]) { default: + if (typeof object.labels[i] === "number") { + message.labels[i] = object.labels[i]; + break; + } case "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED": case 0: message.labels[i] = 0; @@ -3298,7 +3322,7 @@ if (message.labels && message.labels.length) { object.labels = []; for (var j = 0; j < message.labels.length; ++j) - object.labels[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel[message.labels[j]] : message.labels[j]; + object.labels[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel[message.labels[j]] === undefined ? message.labels[j] : $root.google.cloud.recaptchaenterprise.v1.AccountDefenderAssessment.AccountDefenderLabel[message.labels[j]] : message.labels[j]; } return object; }; @@ -6523,6 +6547,12 @@ if (object.testingScore != null) message.testingScore = Number(object.testingScore); switch (object.testingChallenge) { + default: + if (typeof object.testingChallenge === "number") { + message.testingChallenge = object.testingChallenge; + break; + } + break; case "TESTING_CHALLENGE_UNSPECIFIED": case 0: message.testingChallenge = 0; @@ -6559,7 +6589,7 @@ if (message.testingScore != null && message.hasOwnProperty("testingScore")) object.testingScore = options.json && !isFinite(message.testingScore) ? String(message.testingScore) : message.testingScore; if (message.testingChallenge != null && message.hasOwnProperty("testingChallenge")) - object.testingChallenge = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge[message.testingChallenge] : message.testingChallenge; + object.testingChallenge = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge[message.testingChallenge] === undefined ? message.testingChallenge : $root.google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge[message.testingChallenge] : message.testingChallenge; return object; }; @@ -6863,6 +6893,12 @@ if (object.allowAmpTraffic != null) message.allowAmpTraffic = Boolean(object.allowAmpTraffic); switch (object.integrationType) { + default: + if (typeof object.integrationType === "number") { + message.integrationType = object.integrationType; + break; + } + break; case "INTEGRATION_TYPE_UNSPECIFIED": case 0: message.integrationType = 0; @@ -6881,6 +6917,12 @@ break; } switch (object.challengeSecurityPreference) { + default: + if (typeof object.challengeSecurityPreference === "number") { + message.challengeSecurityPreference = object.challengeSecurityPreference; + break; + } + break; case "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED": case 0: message.challengeSecurityPreference = 0; @@ -6932,9 +6974,9 @@ if (message.allowAllDomains != null && message.hasOwnProperty("allowAllDomains")) object.allowAllDomains = message.allowAllDomains; if (message.integrationType != null && message.hasOwnProperty("integrationType")) - object.integrationType = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType[message.integrationType] : message.integrationType; + object.integrationType = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType[message.integrationType] === undefined ? message.integrationType : $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType[message.integrationType] : message.integrationType; if (message.challengeSecurityPreference != null && message.hasOwnProperty("challengeSecurityPreference")) - object.challengeSecurityPreference = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference[message.challengeSecurityPreference] : message.challengeSecurityPreference; + object.challengeSecurityPreference = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference[message.challengeSecurityPreference] === undefined ? message.challengeSecurityPreference : $root.google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference[message.challengeSecurityPreference] : message.challengeSecurityPreference; return object; }; @@ -10488,6 +10530,12 @@ return object; var message = new $root.google.cloud.recaptchaenterprise.v1.WafSettings(); switch (object.wafService) { + default: + if (typeof object.wafService === "number") { + message.wafService = object.wafService; + break; + } + break; case "WAF_SERVICE_UNSPECIFIED": case 0: message.wafService = 0; @@ -10498,6 +10546,12 @@ break; } switch (object.wafFeature) { + default: + if (typeof object.wafFeature === "number") { + message.wafFeature = object.wafFeature; + break; + } + break; case "WAF_FEATURE_UNSPECIFIED": case 0: message.wafFeature = 0; @@ -10536,9 +10590,9 @@ object.wafFeature = options.enums === String ? "WAF_FEATURE_UNSPECIFIED" : 0; } if (message.wafService != null && message.hasOwnProperty("wafService")) - object.wafService = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WafSettings.WafService[message.wafService] : message.wafService; + object.wafService = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WafSettings.WafService[message.wafService] === undefined ? message.wafService : $root.google.cloud.recaptchaenterprise.v1.WafSettings.WafService[message.wafService] : message.wafService; if (message.wafFeature != null && message.hasOwnProperty("wafFeature")) - object.wafFeature = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature[message.wafFeature] : message.wafFeature; + object.wafFeature = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature[message.wafFeature] === undefined ? message.wafFeature : $root.google.cloud.recaptchaenterprise.v1.WafSettings.WafFeature[message.wafFeature] : message.wafFeature; return object; }; @@ -11191,6 +11245,12 @@ if (object.name != null) message.name = String(object.name); switch (object.annotation) { + default: + if (typeof object.annotation === "number") { + message.annotation = object.annotation; + break; + } + break; case "ANNOTATION_UNSPECIFIED": case 0: message.annotation = 0; @@ -11219,6 +11279,10 @@ for (var i = 0; i < object.reasons.length; ++i) switch (object.reasons[i]) { default: + if (typeof object.reasons[i] === "number") { + message.reasons[i] = object.reasons[i]; + break; + } case "REASON_UNSPECIFIED": case 0: message.reasons[i] = 0; @@ -11298,11 +11362,11 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.annotation != null && message.hasOwnProperty("annotation")) - object.annotation = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation[message.annotation] : message.annotation; + object.annotation = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation[message.annotation] === undefined ? message.annotation : $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation[message.annotation] : message.annotation; if (message.reasons && message.reasons.length) { object.reasons = []; for (var j = 0; j < message.reasons.length; ++j) - object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Reason[message.reasons[j]] : message.reasons[j]; + object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Reason[message.reasons[j]] === undefined ? message.reasons[j] : $root.google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Reason[message.reasons[j]] : message.reasons[j]; } if (message.hashedAccountId != null && message.hasOwnProperty("hashedAccountId")) object.hashedAccountId = options.bytes === String ? $util.base64.encode(message.hashedAccountId, 0, message.hashedAccountId.length) : options.bytes === Array ? Array.prototype.slice.call(message.hashedAccountId) : message.hashedAccountId; @@ -12133,6 +12197,10 @@ for (var i = 0; i < object.reasons.length; ++i) switch (object.reasons[i]) { default: + if (typeof object.reasons[i] === "number") { + message.reasons[i] = object.reasons[i]; + break; + } case "CLASSIFICATION_REASON_UNSPECIFIED": case 0: message.reasons[i] = 0; @@ -12206,7 +12274,7 @@ if (message.reasons && message.reasons.length) { object.reasons = []; for (var j = 0; j < message.reasons.length; ++j) - object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason[message.reasons[j]] : message.reasons[j]; + object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason[message.reasons[j]] === undefined ? message.reasons[j] : $root.google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason[message.reasons[j]] : message.reasons[j]; } if (message.passwordLeakVerification != null && message.hasOwnProperty("passwordLeakVerification")) object.passwordLeakVerification = $root.google.cloud.recaptchaenterprise.v1beta1.PasswordLeakVerification.toObject(message.passwordLeakVerification, options); @@ -12831,6 +12899,12 @@ if (object.valid != null) message.valid = Boolean(object.valid); switch (object.invalidReason) { + default: + if (typeof object.invalidReason === "number") { + message.invalidReason = object.invalidReason; + break; + } + break; case "INVALID_REASON_UNSPECIFIED": case 0: message.invalidReason = 0; @@ -12899,7 +12973,7 @@ if (message.valid != null && message.hasOwnProperty("valid")) object.valid = message.valid; if (message.invalidReason != null && message.hasOwnProperty("invalidReason")) - object.invalidReason = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason[message.invalidReason] : message.invalidReason; + object.invalidReason = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason[message.invalidReason] === undefined ? message.invalidReason : $root.google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason[message.invalidReason] : message.invalidReason; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.hostname != null && message.hasOwnProperty("hostname")) @@ -13144,6 +13218,10 @@ for (var i = 0; i < object.labels.length; ++i) switch (object.labels[i]) { default: + if (typeof object.labels[i] === "number") { + message.labels[i] = object.labels[i]; + break; + } case "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED": case 0: message.labels[i] = 0; @@ -13187,7 +13265,7 @@ if (message.labels && message.labels.length) { object.labels = []; for (var j = 0; j < message.labels.length; ++j) - object.labels[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.AccountDefenderLabel[message.labels[j]] : message.labels[j]; + object.labels[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.AccountDefenderLabel[message.labels[j]] === undefined ? message.labels[j] : $root.google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment.AccountDefenderLabel[message.labels[j]] : message.labels[j]; } return object; }; @@ -14552,6 +14630,12 @@ if (object.nameField != null) message.nameField = String(object.nameField); switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; case "HISTORY_UNSPECIFIED": case 0: message.history = 0; @@ -14576,6 +14660,10 @@ for (var i = 0; i < object.style.length; ++i) switch (object.style[i]) { default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } case "STYLE_UNSPECIFIED": case 0: message.style[i] = 0; @@ -14623,7 +14711,7 @@ if (message.nameField != null && message.hasOwnProperty("nameField")) object.nameField = message.nameField; if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; if (message.plural != null && message.hasOwnProperty("plural")) object.plural = message.plural; if (message.singular != null && message.hasOwnProperty("singular")) @@ -14631,7 +14719,7 @@ if (message.style && message.style.length) { object.style = []; for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; } return object; }; @@ -17442,6 +17530,12 @@ if (object.number != null) message.number = object.number | 0; switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; case "LABEL_OPTIONAL": case 1: message.label = 1; @@ -17456,6 +17550,12 @@ break; } switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_DOUBLE": case 1: message.type = 1; @@ -17582,9 +17682,9 @@ if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; if (message.typeName != null && message.hasOwnProperty("typeName")) object.typeName = message.typeName; if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) @@ -19931,6 +20031,12 @@ if (object.javaStringCheckUtf8 != null) message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; case "SPEED": case 1: message.optimizeFor = 1; @@ -20039,7 +20145,7 @@ if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) object.javaOuterClassname = message.javaOuterClassname; if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) object.javaMultipleFiles = message.javaMultipleFiles; if (message.goPackage != null && message.hasOwnProperty("goPackage")) @@ -20841,6 +20947,12 @@ return object; var message = new $root.google.protobuf.FieldOptions(); switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; case "STRING": case 0: message.ctype = 0; @@ -20857,6 +20969,12 @@ if (object.packed != null) message.packed = Boolean(object.packed); switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; case "JS_NORMAL": case 0: message.jstype = 0; @@ -20895,6 +21013,10 @@ for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) switch (object[".google.api.fieldBehavior"][i]) { default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } case "FIELD_BEHAVIOR_UNSPECIFIED": case 0: message[".google.api.fieldBehavior"][i] = 0; @@ -20965,7 +21087,7 @@ object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; if (message.packed != null && message.hasOwnProperty("packed")) object.packed = message.packed; if (message.deprecated != null && message.hasOwnProperty("deprecated")) @@ -20973,7 +21095,7 @@ if (message.lazy != null && message.hasOwnProperty("lazy")) object.lazy = message.lazy; if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; if (message.weak != null && message.hasOwnProperty("weak")) object.weak = message.weak; if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) @@ -20986,7 +21108,7 @@ if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { object[".google.api.fieldBehavior"] = []; for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; } if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); @@ -22343,6 +22465,12 @@ if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; case "IDEMPOTENCY_UNKNOWN": case 0: message.idempotencyLevel = 0; @@ -22406,7 +22534,7 @@ if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -24159,6 +24287,12 @@ if (object.end != null) message.end = object.end | 0; switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; case "NONE": case 0: message.semantic = 0; @@ -24208,7 +24342,7 @@ if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; return object; }; diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index 740e42bfc12..305751757a8 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -302,6 +302,14 @@ }, "nested": { "Annotation": { + "valuesOptions": { + "PASSWORD_CORRECT": { + "deprecated": true + }, + "PASSWORD_INCORRECT": { + "deprecated": true + } + }, "values": { "ANNOTATION_UNSPECIFIED": 0, "LEGITIMATE": 1, @@ -1208,6 +1216,14 @@ }, "nested": { "Annotation": { + "valuesOptions": { + "PASSWORD_CORRECT": { + "deprecated": true + }, + "PASSWORD_INCORRECT": { + "deprecated": true + } + }, "values": { "ANNOTATION_UNSPECIFIED": 0, "LEGITIMATE": 1, @@ -1392,6 +1408,11 @@ }, "nested": { "InvalidReason": { + "valuesOptions": { + "SITE_MISMATCH": { + "deprecated": true + } + }, "values": { "INVALID_REASON_UNSPECIFIED": 0, "UNKNOWN_INVALID_REASON": 1, From ed06d5648c21602d83b7bac77c99bf79db06ad6a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 11 Nov 2022 04:52:14 +0100 Subject: [PATCH 252/253] chore(deps): update dependency @types/node to v18 (#413) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`^16.0.0` -> `^18.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/16.18.3/18.11.9) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/compatibility-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/confidence-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-recaptcha-enterprise). --- packages/google-cloud-recaptchaenterprise/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index 4b7e705ab37..e00dcbf16d5 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -29,7 +29,7 @@ }, "devDependencies": { "@types/mocha": "^9.0.0", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/sinon": "^10.0.0", "c8": "^7.0.0", "gts": "^3.1.0", From f7eeafca073216698a4f6c0025279a71ec269dfb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 18:30:14 +0000 Subject: [PATCH 253/253] chore(main): release 3.1.1 (#417) :robot: I have created a release *beep* *boop* --- ## [3.1.1](https://togithub.com/googleapis/nodejs-recaptcha-enterprise/compare/v3.1.0...v3.1.1) (2022-11-11) ### Bug Fixes * **deps:** Use google-gax v3.5.2 ([#415](https://togithub.com/googleapis/nodejs-recaptcha-enterprise/issues/415)) ([c6c07ec](https://togithub.com/googleapis/nodejs-recaptcha-enterprise/commit/c6c07ecfc53d1983dbd7d87a3a6e917629bf1cf3)) * Regenerated protos JS and TS definitions ([#419](https://togithub.com/googleapis/nodejs-recaptcha-enterprise/issues/419)) ([932b9c7](https://togithub.com/googleapis/nodejs-recaptcha-enterprise/commit/932b9c7a3dcfd2fbed34647d2050c22a34e79b5a)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- packages/google-cloud-recaptchaenterprise/CHANGELOG.md | 8 ++++++++ packages/google-cloud-recaptchaenterprise/package.json | 2 +- ...ppet_metadata.google.cloud.recaptchaenterprise.v1.json | 2 +- ...metadata.google.cloud.recaptchaenterprise.v1beta1.json | 2 +- .../google-cloud-recaptchaenterprise/samples/package.json | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index 76aa349fdfb..42cf3fec26e 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [3.1.1](https://github.com/googleapis/nodejs-recaptcha-enterprise/compare/v3.1.0...v3.1.1) (2022-11-11) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#415](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/415)) ([c6c07ec](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/c6c07ecfc53d1983dbd7d87a3a6e917629bf1cf3)) +* Regenerated protos JS and TS definitions ([#419](https://github.com/googleapis/nodejs-recaptcha-enterprise/issues/419)) ([932b9c7](https://github.com/googleapis/nodejs-recaptcha-enterprise/commit/932b9c7a3dcfd2fbed34647d2050c22a34e79b5a)) + ## [3.1.0](https://github.com/googleapis/nodejs-recaptcha-enterprise/compare/v3.0.4...v3.1.0) (2022-10-13) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index e00dcbf16d5..0a64f4fab59 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-recaptcha-enterprise", "name": "@google-cloud/recaptcha-enterprise", - "version": "3.1.0", + "version": "3.1.1", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index 19fc9b0213f..8084719b40d 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "3.1.0", + "version": "3.1.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json index 31239291add..97050889533 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "3.1.0", + "version": "3.1.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index bdfe155de09..e7f32ba05a0 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "echo add tests" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^3.1.0" + "@google-cloud/recaptcha-enterprise": "^3.1.1" }, "devDependencies": { "chai": "^4.2.0",